]> git.rmz.io Git - dotfiles.git/commitdiff
vim: skip preview window when moving between windows
authorSamir Benmendil <samir.benmendil@ultrahaptics.com>
Mon, 24 Oct 2016 08:01:11 +0000 (09:01 +0100)
committerSamir Benmendil <samir.benmendil@ultrahaptics.com>
Mon, 24 Oct 2016 08:01:11 +0000 (09:01 +0100)
I'm not entirely sure about this. It does help a lot for not giving
focus to the ycm doc window. But it also prevents focusing the fugitive
status window. It can still be reached with <leader>gs though.

Maybe this needs a function that checks what the content of the preview
window is and skip conditionally.

vim/vimrc

index c6aee808e02f8389f501dee99b7b13826d64b4d5..ef35da8cc431c37b407c1bc515edaf12f2c92c8d 100644 (file)
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -435,9 +435,9 @@ nnoremap zx zMzxzt
 
 map <F1> :ls<CR>:b<space>
 
-" move between windows
-nnoremap <C-L> <C-W>w
-nnoremap <C-H> <C-W>W
+" move between windows (skip previewwindow)
+nnoremap <silent> <C-L> <C-W>w:if &previewwindow \| wincmd w \| endif<CR>
+nnoremap <silent> <C-H> <C-W>W:if &previewwindow \| wincmd W \| endif<CR>
 
 "xterm mouse with middleclick paste
 nnoremap <MiddleMouse> i<MiddleMouse>