# 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 * `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` (`:detach`) - detach the currently attached session ### Session Management * `s` - list sessions * `$` - name session ### Close Session * `tmux kill-session [-t name]` (`:kill-session`) ## Windows ### New Window * `c` (`:neww [-n name] [cmd]`) - new window ### Cursor Movement * `[i]` (`:selectw -t [i]`) - go to window `[i]` * `l` - go to last window * `p` - go to previous window * `n` - go to next window ### Window Management * `T` - rename window * `,` - rename window * `w` - list all windows * `f` - find window by name * `&` (`:kill-window`) - kill window * `.` - move window to another session (promt) * `:movew` - move window to next unused number ## Panes ### New Pane * (%) `|` (`:splitw [-v] [-p width] [-t focus] [cmd]`) - split current pane vertically * (") `s` (`:splitw -h [-p width] [-t focus] [cmd]`) - split current pane horizontally ### Cursor Movement * (o) `` (`:selectp -t :.+`) - move cursor to the next pane * `` (`:selectp -U`) - move cursor to the pane above * `` (`:selectp -D`) - move cursor to the pane below * `` (`:selectp -L`) - move cursor to the pane to the left * `` (`: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 * `{` (`:swap-pane -L`) - move current pane to the left * `}` (`:swap-pane -R`) - move current pane to the right * `q` - show pane numbers (type number to move cursor) * `` - 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 * `x` (`:kill-pane`) - kill current pane ## Misc * `t` - show time * `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 * `n` (`:new`) - new horizontal split * `s` (`:split`) - split window horizontaly * `v ` (`:vsplit`) - split window verticaly ### Cursor Movement * `w` - next split * `p` - previous split * `` - move above * `` - move bellow * `` - move left * `` - move right ### Splits Movement * `r` - rotate to the right * `H` - move to the left * `J` - move to the bottom * `K` - move to the top * `L` - move to the right * `T` - (`:tab split`) move split to new tab ### Resize Split * `p +` - increase height * `p -` - decrease height * `p <` - increase width * `p >` - decrease width ### Close Split * `c` (`:close`) - close split * `q` (`:q`) - close split and quit file * `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