Skip to content

Instantly share code, notes, and snippets.

@devdrops
Forked from Starefossen/vim-cheats.md
Created February 24, 2018 13:47
Show Gist options
  • Save devdrops/ce64ba1f59b48711c48b4498f352d3a5 to your computer and use it in GitHub Desktop.
Save devdrops/ce64ba1f59b48711c48b4498f352d3a5 to your computer and use it in GitHub Desktop.

Revisions

  1. @Starefossen Starefossen revised this gist Aug 7, 2013. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions vim-cheats.md
    Original file line number Diff line number Diff line change
    @@ -27,6 +27,8 @@

    ### New Split

    `Pro-Tip:` control splitting directionality by setting `splitright` and `splitbelow` options.

    * `<C-w>n` (`:new [file]`) - split horizontaly
    * `<C-w>s` (`:split [file]`) - split horizontaly
    * `<C-w>v ` (`:vsplit [file]`) - split verticaly
  2. @Starefossen Starefossen revised this gist Jul 9, 2013. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion vim-cheats.md
    Original file line number Diff line number Diff line change
    @@ -66,4 +66,5 @@

    * http://codeincomplete.com/posts/2011/2/14/split_windows_and_tabs_in_vim/
    * http://robots.thoughtbot.com/post/48275867281/vim-splits-move-faster-and-more-naturally
    * http://vim.wikia.com/wiki/Using_tab_pages
    * http://vim.wikia.com/wiki/Using_tab_pages
    * http://vim.wikia.com/wiki/Resize_splits_more_quickly
  3. @Starefossen Starefossen revised this gist Jul 9, 2013. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions vim-cheats.md
    Original file line number Diff line number Diff line change
    @@ -27,9 +27,9 @@

    ### New Split

    * `<C-w>n` (`:new`) - new horizontal split
    * `<C-w>s` (`:split`) - split window horizontaly
    * `<C-w>v ` (`:vsplit`) - split window verticaly
    * `<C-w>n` (`:new [file]`) - split horizontaly
    * `<C-w>s` (`:split [file]`) - split horizontaly
    * `<C-w>v ` (`:vsplit [file]`) - split verticaly

    ### Cursor Movement

  4. @Starefossen Starefossen created this gist Jul 9, 2013.
    69 changes: 69 additions & 0 deletions vim-cheats.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,69 @@
    ## Tabs

    ### New Tab

    * `:tabnew` - new blank tab
    * `:tabedit [file]` - open file in tab

    ### Cursor Movement

    * `gt` (`:tabn`) - next tab
    * `gT` (`:tabp`) - previous tab
    * `[i]gt` - go to tab `[i]`

    ### Tabs Management

    * `:tabs` - list open tabs
    * `:tabm 0` - move current tab to first position
    * `:tabm` - move current tab to last position
    * `:tabm [i]` - move current tab to position `[i]`

    ### Close Tab

    * `:tabc` - close current tab
    * `:tabo` - close all other tabs

    ## Window Split

    ### New Split

    * `<C-w>n` (`:new`) - new horizontal split
    * `<C-w>s` (`:split`) - split window horizontaly
    * `<C-w>v ` (`:vsplit`) - split window verticaly

    ### Cursor Movement

    * `<C-w>w` - next split
    * `<C-w>p` - previous split
    * `<C-w><Up>` - move above
    * `<C-w><Down>` - move bellow
    * `<C-w><Left>` - move left
    * `<C-w><Right>` - move right

    ### Splits Movement

    * `<C-w>r` - rotate to the right
    * `<C-w>H` - move to the left
    * `<C-w>J` - move to the bottom
    * `<C-w>K` - move to the top
    * `<C-w>L` - move to the right
    * `<C-w>T` - (`:tab split`) move split to new tab

    ### Resize Split

    * `<C-w>p +` - increase height
    * `<C-w>p -` - decrease height
    * `<C-w>p <` - increase width
    * `<C-w>p >` - decrease width

    ### Close Split

    * `<C-w>c` (`:close`) - close split
    * `<C-w>q` (`:q`) - close split and quit file
    * `<C-w>o` (`:only`) - close all other splits

    ## Sources

    * http://codeincomplete.com/posts/2011/2/14/split_windows_and_tabs_in_vim/
    * http://robots.thoughtbot.com/post/48275867281/vim-splits-move-faster-and-more-naturally
    * http://vim.wikia.com/wiki/Using_tab_pages