From facaa3e185673dd6c631c5d0ff72c724aa8c7db3 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Thu, 24 Sep 2020 21:59:38 +0200 Subject: [PATCH] nvim: Improve completino menu, add cursor context Improved completion menu by allowing c-p,c-n scrolling through it. Removed automatically resizing buffers, use c-w= if you need it. Added scrolloff, controlling the amount of lines that are always under/above the cursor. This fixes the cursor being at the very bottom of the page, after doing e.g. zb or zt and will allow seeing a bit more information around it at all times. --- nvim/.config/nvim/init.vim | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/nvim/.config/nvim/init.vim b/nvim/.config/nvim/init.vim index 31ef82d..f7002aa 100644 --- a/nvim/.config/nvim/init.vim +++ b/nvim/.config/nvim/init.vim @@ -168,6 +168,29 @@ au BufNewFile,BufRead /dev/shm/pass.?*/?*.txt setlocal noswapfile nobackup nound au BufNewFile,BufRead $TMPDIR/pass.?*/?*.txt setlocal noswapfile nobackup noundofile nowritebackup viminfo= au BufNewFile,BufRead /tmp/pass.?*/?*.txt setlocal noswapfile nobackup noundofile nowritebackup viminfo= +" from https://github.com/tjdevries/config_manager/blob/master/xdg_config/nvim/init.vim +if has('nvim-0.4') + " make completion menu slightly transparent + set pumblend=17 + set wildmode=longest:full + + " Makes floating PopUpMenu for completing stuff on the command line. + " Very similar to completing in insert mode. + set wildoptions+=pum +else + set wildmode=longest,list,full + " Vim Galore recommended mappings + " Make next and previous use smart history + cnoremap + cnoremap +end + +" turn of automatic resizing of individual splits +set noequalalways + +" make sure there's always *some* context below cursor +set scrolloff=5 + " }}} " KEYBINDINGS {{{ " ================================================================================