Skip to content

Instantly share code, notes, and snippets.

@Starefossen
Last active October 16, 2025 21:09
Show Gist options
  • Save Starefossen/5955406 to your computer and use it in GitHub Desktop.
Save Starefossen/5955406 to your computer and use it in GitHub Desktop.

Revisions

  1. Starefossen revised this gist Jul 9, 2013. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion tmux-cheats.md
    Original file line number Diff line number Diff line change
    @@ -39,10 +39,13 @@
    * `<C-a>,` - rename window
    * `<C-a>w` - list all windows
    * `<C-a>f` - find window by name
    * `<C-a>&` (`:kill-window`) - kill window
    * `<C-a>.` - move window to another session (promt)
    * `:movew` - move window to next unused number

    ### Close Window

    * `<C-a>&` (`:kill-window`) - kill window

    ## Panes

    ### New Pane
  2. Starefossen revised this gist Jul 9, 2013. 1 changed file with 0 additions and 2 deletions.
    2 changes: 0 additions & 2 deletions tmux-cheats.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,3 @@
    `NB` I have remapped the command prefix to `ctrl` + `a` (in order to mimic gnu screen). I have added some custom key remaps as well, I will try to document them properly when I get the time.

    ## Sessions

    ### New Session
  3. Starefossen revised this gist Jul 9, 2013. 1 changed file with 0 additions and 69 deletions.
    69 changes: 0 additions & 69 deletions vim-cheats.md
    Original file line number Diff line number Diff line change
    @@ -1,69 +0,0 @@
    ## 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
  4. Starefossen revised this gist Jul 9, 2013. 2 changed files with 3 additions and 8 deletions.
    5 changes: 1 addition & 4 deletions tmux-cheats.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,3 @@
    # Tmux

    `NB` I have remapped the command prefix to `ctrl` + `a` (in order to mimic gnu screen). I have added some custom key remaps as well, I will try to document them properly when I get the time.

    ## Sessions
    @@ -90,8 +88,7 @@
    * `<C-a>t` - show time
    * `<C-a>r` - reload config


    # Sources
    ## Sources

    * http://robots.thoughtbot.com/post/2641409235/a-tmux-crash-course
    * https://wiki.archlinux.org/index.php/Tmux
    6 changes: 2 additions & 4 deletions vim-cheats.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,4 @@
    # VIM

    ## Tab
    ## Tabs

    ### New Tab

    @@ -64,7 +62,7 @@
    * `<C-w>q` (`:q`) - close split and quit file
    * `<C-w>o` (`:only`) - close all other splits

    # Sources
    ## 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
  5. Starefossen renamed this gist Jul 9, 2013. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  6. Starefossen revised this gist Jul 9, 2013. 2 changed files with 71 additions and 73 deletions.
    73 changes: 0 additions & 73 deletions tmux-vim-cheats.md
    Original file line number Diff line number Diff line change
    @@ -90,83 +90,10 @@
    * `<C-a>t` - show time
    * `<C-a>r` - reload config

    # VIM

    ## Tab

    ### 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

    ## Tmux

    * http://robots.thoughtbot.com/post/2641409235/a-tmux-crash-course
    * https://wiki.archlinux.org/index.php/Tmux
    * https://gist.github.com/henrik/1967800
    * http://blog.hawkhost.com/2010/06/28/tmux-the-terminal-multiplexer/

    ## Vim

    * 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
    71 changes: 71 additions & 0 deletions vim-cheats.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,71 @@
    # VIM

    ## Tab

    ### 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
  7. Starefossen revised this gist Jul 9, 2013. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions tmux-vim-cheats.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,7 @@
    # Tmux

    `NB` I have remapped the command prefix to `ctrl` + `a` (in order to mimic gnu screen). I have added some custom key remaps as well, I will try to document them properly when I get the time.

    ## Sessions

    ### New Session
  8. Starefossen created this gist Jul 9, 2013.
    170 changes: 170 additions & 0 deletions tmux-vim-cheats.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,170 @@
    # Tmux

    ## Sessions

    ### New Session

    * `tmux new [-s name] [cmd]` (`:new`) - new session

    ### Switch Session

    * `tmux ls` (`:ls`) - list sessions
    * `tmux switch [-t name]` (`:switch`) - switches to an existing session
    * `tmux as [id] [-t name]` (`:attach`) - attaches to an existing session
    * `<C-a>c` (`:detach`) - detach the currently attached session

    ### Session Management

    * `<C-a>s` - list sessions
    * `<C-a>$` - name session

    ### Close Session

    * `tmux kill-session [-t name]` (`:kill-session`)

    ## Windows

    ### New Window

    * `<C-a>c` (`:neww [-n name] [cmd]`) - new window

    ### Cursor Movement

    * `<C-a>[i]` (`:selectw -t [i]`) - go to window `[i]`
    * `<C-a>l` - go to last window
    * `<C-a>p` - go to previous window
    * `<C-a>n` - go to next window

    ### Window Management

    * `<C-a>T` - rename window
    * `<C-a>,` - rename window
    * `<C-a>w` - list all windows
    * `<C-a>f` - find window by name
    * `<C-a>&` (`:kill-window`) - kill window
    * `<C-a>.` - move window to another session (promt)
    * `:movew` - move window to next unused number

    ## Panes

    ### New Pane

    * (%) `<C-a>|` (`:splitw [-v] [-p width] [-t focus] [cmd]`) - split current pane vertically
    * (") `<C-a>s` (`:splitw -h [-p width] [-t focus] [cmd]`) - split current pane horizontally

    ### Cursor Movement

    * (o) `<C-a><Tab>` (`:selectp -t :.+`) - move cursor to the next pane
    * `<C-a><Up>` (`:selectp -U`) - move cursor to the pane above
    * `<C-a><Down>` (`:selectp -D`) - move cursor to the pane below
    * `<C-a><Left>` (`:selectp -L`) - move cursor to the pane to the left
    * `<C-a><Right>` (`:selectp -R`) - move cursor to the pane to the right
    * `:selectp [i]` - move cursor to the pane `[i]`

    ### Panes Management

    * (`:swap-pane -U`) - move current pane up
    * (`:swap-pane -D`) - move current pane down
    * `<C-a>{` (`:swap-pane -L`) - move current pane to the left
    * `<C-a>}` (`:swap-pane -R`) - move current pane to the right
    * `<C-a>q` - show pane numbers (type number to move cursor)
    * `<C-a><Space>` - toggle pane arrangements

    ### Resize Pane

    * `:resize-pane -U [i]` - move horizontal divider up by `[i]` lines
    * `:resize-pane -D [i]` - move horizontal divider down by `[i]` lines
    * `:resize-pane -L [i]` - move vertical divider left by `[i]` columns
    * `:resize-pane -R [i]` - move vertical divider right by `[i]` columns

    `resize-pane [-DLRUZ] [-x width] [-y height] [-t target-pane] [adjustment]`

    ### Close Pane

    * `<C-a>x` (`:kill-pane`) - kill current pane

    ## Misc

    * `<C-a>t` - show time
    * `<C-a>r` - reload config

    # VIM

    ## Tab

    ### 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

    ## Tmux

    * http://robots.thoughtbot.com/post/2641409235/a-tmux-crash-course
    * https://wiki.archlinux.org/index.php/Tmux
    * https://gist.github.com/henrik/1967800
    * http://blog.hawkhost.com/2010/06/28/tmux-the-terminal-multiplexer/

    ## Vim

    * 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