2017-02-19 06:50:45 +08:00
|
|
|
""
|
|
|
|
" @section tmux, layer-tmux
|
|
|
|
" @parentsection layers
|
|
|
|
" Adds integration between tmux and vim panes. Switch between panes
|
|
|
|
" seamlessly.
|
2017-02-19 06:54:18 +08:00
|
|
|
" This layer is not added by default. To include it, add
|
2017-02-22 05:28:52 +08:00
|
|
|
" `SpaceVim#layers#load('tmux')` to your `~/.SpaceVim.d/init.vim`.
|
|
|
|
" This layer currently overwrites some SpaceVim keybinds including multiple
|
|
|
|
" cursors. If you are having issues with <C-h> in a neovim buffer, see
|
|
|
|
" `https://github.com/neovim/neovim/issues/2048#issuecomment-78045837`
|
2017-02-19 06:50:45 +08:00
|
|
|
"
|
|
|
|
" @subsection mappings
|
2017-02-19 06:54:18 +08:00
|
|
|
" >
|
|
|
|
" Key Mode Function
|
|
|
|
" ------------------------------
|
2017-02-22 05:28:52 +08:00
|
|
|
" <C-h> normal Switch to vim/tmux pane in left direction
|
|
|
|
" <C-j> normal Switch to vim/tmux pane in down direction
|
|
|
|
" <C-k> normal Switch to vim/tmux pane in up direction
|
|
|
|
" <C-l> normal Switch to vim/tmux pane in right direction
|
2017-02-19 06:54:18 +08:00
|
|
|
" <
|
2017-02-19 06:50:45 +08:00
|
|
|
|
|
|
|
function! SpaceVim#layers#tmux#plugins() abort
|
|
|
|
let plugins = []
|
2017-07-20 07:16:29 +08:00
|
|
|
call add(plugins,['christoomey/vim-tmux-navigator', {'merged' : 0}])
|
2017-02-19 06:50:45 +08:00
|
|
|
return plugins
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
function! SpaceVim#layers#tmux#config() abort
|
|
|
|
let g:tmux_navigator_no_mappings = 1
|
2017-02-23 09:49:09 +08:00
|
|
|
augroup spacevim_layer_tmux
|
2017-02-22 05:28:52 +08:00
|
|
|
au!
|
2017-02-23 09:49:09 +08:00
|
|
|
au VimEnter * call s:tmuxMappings()
|
2017-02-22 05:28:52 +08:00
|
|
|
augroup END
|
2017-02-23 09:49:09 +08:00
|
|
|
func s:tmuxMappings()
|
2017-02-22 05:28:52 +08:00
|
|
|
nnoremap <silent> <C-h> :TmuxNavigateLeft<cr>
|
|
|
|
nnoremap <silent> <C-j> :TmuxNavigateDown<cr>
|
|
|
|
nnoremap <silent> <C-k> :TmuxNavigateUp<cr>
|
|
|
|
nnoremap <silent> <C-l> :TmuxNavigateRight<cr>
|
|
|
|
endf
|
2017-02-19 06:50:45 +08:00
|
|
|
endfunction
|