I am aware that I can manually bind individual keys in my .tmux.conf
file, but according to this page I should be able to get vim-like key bindings in tmux simply by adding the following to my .tmux.conf
, saving me having to maintain a list of keybindings:
set-window-option -g mode-keys vi
But this doesn't really seem to work as expected. Sure enough, when I press Ctrl+b [
I am able to navigate through my terminal history using vim keys hjkl
, but when I press Ctrl+b k
it doesn't take me to the above window, for that I still have to press Ctrl+b Up
, same goes for down, left and right.
Why doesn't this work? Do I really have to map these keys manually on top of vi mode to get actual vi mode?
I'm using tmux 1.6
Once vimux is installed, you can access the command prompt from within vim by running :VimuxPromptCommand . You can then immediately start typing your shell command. Pressing enter will run the command in a tmux pane in the current window. If necessary, vimux will create a new pane for the command to run in.
tmux may be controlled from an attached client by using a key combination of a prefix key, 'C-b' (Ctrl-b) by default, followed by a command key. The default command key bindings are: C-b Send the prefix key (C-b) through to the application. C-o Rotate the panes in the current window forwards.
tmux offers a set of vi-like bindings for navigating a buffer in a window. These allow you to not only navigate through the buffer beyond what your screen is currently showing, but also to search all the output generated thus far, and to select and copy text that can be pasted in any other window in the tmux session.
By Vim, I mean literally Vim, the command-line text editor. And by bindings, I mean keyboard commands that do specific things in the editor.
add this to your cnofig:
#switch panels
bind k selectp -U # switch to panel Up
bind j selectp -D # switch to panel Down
bind h selectp -L # switch to panel Left
bind l selectp -R # switch to panel Right
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With