1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-09 12:10:05 +08:00

Merge pull request #282 from ccheek21/tmux_docs

Tmux fixes
This commit is contained in:
Wang Shidong 2017-02-23 12:11:48 +08:00 committed by GitHub
commit 06ff5d0925
2 changed files with 26 additions and 14 deletions

View File

@ -4,16 +4,19 @@
" Adds integration between tmux and vim panes. Switch between panes " Adds integration between tmux and vim panes. Switch between panes
" seamlessly. " seamlessly.
" This layer is not added by default. To include it, add " This layer is not added by default. To include it, add
" `SpaceVim#layers#load('tmux')` to your `~/.SpaceVim.d/init.vim` " `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`
" "
" @subsection mappings " @subsection mappings
" > " >
" Key Mode Function " Key Mode Function
" ------------------------------ " ------------------------------
" <C-h> normal Switch to pane in left direction " <C-h> normal Switch to vim/tmux pane in left direction
" <C-j> normal Switch to pane in down direction " <C-j> normal Switch to vim/tmux pane in down direction
" <C-k> normal Switch to pane in up direction " <C-k> normal Switch to vim/tmux pane in up direction
" <C-l> normal Switch to pane in right direction " <C-l> normal Switch to vim/tmux pane in right direction
" < " <
function! SpaceVim#layers#tmux#plugins() abort function! SpaceVim#layers#tmux#plugins() abort
@ -24,8 +27,14 @@ endfunction
function! SpaceVim#layers#tmux#config() abort function! SpaceVim#layers#tmux#config() abort
let g:tmux_navigator_no_mappings = 1 let g:tmux_navigator_no_mappings = 1
nnoremap <silent> <C-h> :TmuxNavigateLeft<cr> augroup spacevim_layer_tmux
nnoremap <silent> <C-j> :TmuxNavigateDown<cr> au!
nnoremap <silent> <C-k> :TmuxNavigateUp<cr> au VimEnter * call s:tmuxMappings()
nnoremap <silent> <C-l> :TmuxNavigateRight<cr> augroup END
func s:tmuxMappings()
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
endfunction endfunction

View File

@ -695,17 +695,20 @@ TMUX *SpaceVim-layer-tmux*
Adds integration between tmux and vim panes. Switch between panes seamlessly. Adds integration between tmux and vim panes. Switch between panes seamlessly.
This layer is not added by default. To include it, add This layer is not added by default. To include it, add
`SpaceVim#layers#load('tmux')` to your `~/.SpaceVim.d/init.vim` `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`
MAPPINGS MAPPINGS
> >
Key Mode Function Key Mode Function
------------------------------ ------------------------------
<C-h> normal Switch to pane in left direction <C-h> normal Switch to vim/tmux pane in left direction
<C-j> normal Switch to pane in down direction <C-j> normal Switch to vim/tmux pane in down direction
<C-k> normal Switch to pane in up direction <C-k> normal Switch to vim/tmux pane in up direction
<C-l> normal Switch to pane in right direction <C-l> normal Switch to vim/tmux pane in right direction
< <
============================================================================== ==============================================================================