Fix windows switching mappings when not in tmux

This commit is contained in:
Kenneth Benzie 2023-01-09 23:19:47 +00:00
parent 8f578862ef
commit 877d90dd90

View File

@ -64,7 +64,12 @@ nnoremap k gk
nnoremap <leader>w :w!<CR>
" Switch panes in a tmux aware way
if !has('win32')
if !tmux#inSession() || has('win32')
nnoremap <silent> <C-h> <C-w>h
nnoremap <silent> <C-j> <C-w>j
nnoremap <silent> <C-k> <C-w>k
nnoremap <silent> <C-l> <C-w>l
else
nnoremap <silent> <C-h> :TmuxNavigateLeft<CR>
nnoremap <silent> <C-j> :TmuxNavigateDown<CR>
nnoremap <silent> <C-k> :TmuxNavigateUp<CR>
@ -84,11 +89,6 @@ if !has('win32')
tnoremap <silent> <C-w>k <C-w>N:TmuxNavigateUp<CR>
tnoremap <silent> <C-w>l <C-w>N:TmuxNavigateRight<CR>
endif
else
nnoremap <silent> <C-h> <C-w>h
nnoremap <silent> <C-j> <C-w>j
nnoremap <silent> <C-k> <C-w>k
nnoremap <silent> <C-l> <C-w>l
endif
" Quick tabs