Navigate seamlessly between vim and tmux [Fix #526]
This commit is contained in:
parent
f6bdf5708e
commit
ce5b38ebb0
@ -208,7 +208,7 @@ of plugins above to learn more.
|
|||||||
#### Tabs, Windows, Splits
|
#### Tabs, Windows, Splits
|
||||||
|
|
||||||
* Use `Cmd-1` thru `Cmd-9` to switch to a specific tab number (like iTerm and Chrome) - and tabs have been set up to show numbers (`Alt` in Linux)
|
* Use `Cmd-1` thru `Cmd-9` to switch to a specific tab number (like iTerm and Chrome) - and tabs have been set up to show numbers (`Alt` in Linux)
|
||||||
* `Ctrl-h,l,j,k` - to move left, right, down, up between splits
|
* `Ctrl-h,l,j,k` - to move left, right, down, up between splits. This also works between vim and tmux splits thanks to `vim-tmux-navigator`.
|
||||||
* `Q` - Intelligent Window Killer. Close window `wincmd c` if there are multiple windows to same buffer, or kill the buffer `bwipeout` if this is the last window into it.
|
* `Q` - Intelligent Window Killer. Close window `wincmd c` if there are multiple windows to same buffer, or kill the buffer `bwipeout` if this is the last window into it.
|
||||||
* `vv` - vertical split (`Ctrl-w,v`)
|
* `vv` - vertical split (`Ctrl-w,v`)
|
||||||
* `ss` - horizontal split (`Ctrl-w,s`)
|
* `ss` - horizontal split (`Ctrl-w,s`)
|
||||||
|
@ -6,3 +6,4 @@
|
|||||||
* CtrlP - ,t to find a file
|
* CtrlP - ,t to find a file
|
||||||
* Visual-star-search - make the * (star) search in visual mode behave like expected: searching for the whole selection instead of just the word under the cursor.
|
* Visual-star-search - make the * (star) search in visual mode behave like expected: searching for the whole selection instead of just the word under the cursor.
|
||||||
* Ag - super fast search by Silver Searcher. hit `K` to grep current word
|
* Ag - super fast search by Silver Searcher. hit `K` to grep current word
|
||||||
|
* vim-tmux-navigator - nagivate between vim and tmux splits in the same way you move between normal vim splits.
|
||||||
|
@ -20,6 +20,15 @@ bind -r J resize-pane -D 5
|
|||||||
bind -r K resize-pane -U 5
|
bind -r K resize-pane -U 5
|
||||||
bind -r L resize-pane -R 5
|
bind -r L resize-pane -R 5
|
||||||
|
|
||||||
|
# Smart pane switching with awareness of vim splits.
|
||||||
|
# Source: https://github.com/christoomey/vim-tmux-navigator
|
||||||
|
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)g?(view|vim?)(diff)?$' && tmux send-keys C-h) || tmux select-pane -L"
|
||||||
|
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)g?(view|vim?)(diff)?$' && tmux send-keys C-j) || tmux select-pane -D"
|
||||||
|
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)g?(view|vim?)(diff)?$' && tmux send-keys C-k) || tmux select-pane -U"
|
||||||
|
bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)g?(view|vim?)(diff)?$' && tmux send-keys C-l) || tmux select-pane -R"
|
||||||
|
# Conflicts with Nerdtree binding. Can possibly add back later under a different alias.
|
||||||
|
#bind -n C-\ run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)g?(view|vim?)(diff)?$' && tmux send-keys 'C-\\') || tmux select-pane -l"
|
||||||
|
|
||||||
# Use vi keybindings for tmux commandline input.
|
# Use vi keybindings for tmux commandline input.
|
||||||
# Note that to get command mode you need to hit ESC twice...
|
# Note that to get command mode you need to hit ESC twice...
|
||||||
set -g status-keys vi
|
set -g status-keys vi
|
||||||
|
@ -9,6 +9,7 @@ Bundle "vim-scripts/matchit.zip.git"
|
|||||||
Bundle "terryma/vim-multiple-cursors"
|
Bundle "terryma/vim-multiple-cursors"
|
||||||
Bundle "Keithbsmiley/investigate.vim"
|
Bundle "Keithbsmiley/investigate.vim"
|
||||||
Bundle "chrisbra/NrrwRgn"
|
Bundle "chrisbra/NrrwRgn"
|
||||||
|
Bundle "christoomey/vim-tmux-navigator"
|
||||||
Bundle "MarcWeber/vim-addon-mw-utils.git"
|
Bundle "MarcWeber/vim-addon-mw-utils.git"
|
||||||
Bundle "bogado/file-line.git"
|
Bundle "bogado/file-line.git"
|
||||||
Bundle "mattn/webapi-vim.git"
|
Bundle "mattn/webapi-vim.git"
|
||||||
|
Loading…
Reference in New Issue
Block a user