-
Notifications
You must be signed in to change notification settings - Fork 22
tmux
The standard prefix is bound from ctrl+b to ctrl+a because
- it can be pressed easily by one hand,
- ctrl+a is already common among enthusiats on the internet.
- ctrl a tmux PREFIX
- PREFIX w list windows
- PREFIX s list all tmux sessions and theirs windows
- ctrl t create new window
- shift left switch to previous window (also alt i, handy for i3 users)
- shift right switch to next window (also alt u, handy for i3 users)
- ctrl 9 horizontal split
- ctrl 0 vertical split
- alt left/down/right/up move over tmux panes (for dummies, arrow keys ;-))
- ctrl h/j/k/l move over tmux panes (and vim splits too)
- PREFIX ctrl h/j/k/l resize panes
- PREFIX k kill current tmux session with all its processes (also :qa in shell)
- PREFIX space switch panel configuration
- F2 go to vim edit mode
- PREFIX p paste yanked text (from vim edit mode)
- PREFIX z enlarge focused pane to the whole screen (or back)
All (hopefully) of the default bindings still work, so please, check all bindings by PREFIX ? or Google them.
If you wish to use your tmux config besides mine, create a file ~/.my.tmux.conf, it will be sourced automatically if it exists.
Running Vim inside TMUX has some serious advantages. First, TMUX allows copying any text in the terminal using its vi-mode (see TMUX shortcuts bellow). With a simple hack, the copied text is inserted into the system clipboard. The same can be done with Vim, so basically, we have a clipboard shared between the system, Vim, and TMUX, which is accessible and fillable without using a mouse.
Another notable feature is enabled by the plugin christoomey/vim-tmux-navigator. It allows to seamlessly navigate through TMUX and Vim splits (panes) with a single set of key bindings. In my setup, those are crtl h/j/k/l for left/down/right/up movement.
Tmuxinator is a handy tool for automating tmux sessions.