From bc97c06effedd53ec5e18920bdc8dd6a06c74d92 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 16 Aug 2018 12:50:15 +1200 Subject: Reorder .vimrc a bit --- vim/vimrc | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index f4cb5171..e28aa00c 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -66,6 +66,12 @@ silent! set breakindent " Clear default 'comments' value, let the filetype handle it set comments= +" Add completion options +if exists('+completeopt') + set completeopt+=longest " Insert longest common substring + set completeopt+=menuone " Show the menu even if only one match +endif + " Give me a prompt instead of just rejecting risky :write, :saveas set confirm @@ -91,6 +97,12 @@ endif " Don't wait for a key after Escape in insert mode silent! set noesckeys +" Fold based on indent, but only when I ask +if has('folding') + set foldlevelstart=99 + set foldmethod=indent +endif + " Delete comment leaders when joining lines, if supported silent! set formatoptions+=j @@ -99,6 +111,11 @@ if system('grep --version') =~# '^grep (GNU grep)' set grepprg=grep\ -HnRs\ --exclude='.git*' endif +" Don't load GUI menus; set here before GUI starts +if has('gui_running') + set guioptions+=M +endif + " Allow buffers to have changes without being displayed set hidden @@ -143,6 +160,12 @@ set nrformats-=octal set path-=/usr/include " Let the C/C++ filetypes set that set path+=** " Search current directory's whole tree +" Make sessions usable +if exists('+sessionoptions') + set sessionoptions-=localoptions " No buffer options or mappings + set sessionoptions-=options " No global options or mappings +endif + " Don't show startup splash screen (I donated) set shortmess+=I @@ -159,28 +182,6 @@ set timeoutlen=3000 " No terminal mouse, even if we could silent! set ttymouse= -" Wildmenu settings; see also plugin/wildignore.vim -set wildmenu " Use wildmenu -set wildmode=list:longest " Tab press completes and lists -silent! set wildignorecase " Case insensitive, if supported - -" Add completion options -if exists('+completeopt') - set completeopt+=longest " Insert longest common substring - set completeopt+=menuone " Show the menu even if only one match -endif - -" Fold based on indent, but only when I ask -if has('folding') - set foldlevelstart=99 - set foldmethod=indent -endif - -" Don't load GUI menus; set here before GUI starts -if has('gui_running') - set guioptions+=M -endif - " Keep undo files, hopefully in a dedicated directory if has('persistent_undo') set undofile @@ -191,11 +192,10 @@ if has('persistent_undo') endif endif -" Make sessions usable -if exists('+sessionoptions') - set sessionoptions-=localoptions " No buffer options or mappings - set sessionoptions-=options " No global options or mappings -endif +" Wildmenu settings; see also plugin/wildignore.vim +set wildmenu " Use wildmenu +set wildmode=list:longest " Tab press completes and lists +silent! set wildignorecase " Case insensitive, if supported " Let me move beyond buffer text in visual block mode if exists('+virtualedit') -- cgit v1.2.3