From 897d4b1f57f6847135ec1b138681b93adeefee1b Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 14 May 2019 11:51:42 +1200 Subject: Remove some overzealous conditions from vimrc Let's try not to solve problems we aren't actually having. --- vim/vimrc | 68 ++++++++++++++++++++++++--------------------------------------- 1 file changed, 26 insertions(+), 42 deletions(-) (limited to 'vim/vimrc') diff --git a/vim/vimrc b/vim/vimrc index 2276ffb4..dbdda4e3 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -14,33 +14,23 @@ if !exists('$MYVIMRUNTIME') endif " Load filetype settings, plugins, and maps -if has('autocmd') - let maplocalleader = ',' - filetype plugin indent on -endif - -" Options dependent on the syntax feature -if has('syntax') - - " Use syntax highlighting - if !exists('syntax_on') - syntax enable - endif - - " Try to use sahara colorscheme with 'cursorline' set - try - colorscheme sahara - if exists('+cursorline') - set cursorline - endif - - " Otherwise, use the default colorscheme with a dark background - catch - set background=dark - endtry +let maplocalleader = ',' +filetype plugin indent on +" Use syntax highlighting +if !exists('syntax_on') + syntax enable endif +" Try to use sahara colorscheme with 'cursorline' set; otherwise, use the +" default colorscheme with a dark background +try + colorscheme sahara + set cursorline +catch + set background=dark +endtry + " The all-important default indent settings; filetypes to tweak set autoindent " Use indent of previous line on new lines set expandtab " Use spaces instead of tabs @@ -62,7 +52,7 @@ else set backupdir^=$MYVIMRUNTIME/cache/backup endif -" Add some paths not to back up +" Add some *nix paths not to back up if has('unix') set backupskip^=/dev/shm/* " Shared memory RAM disk set backupskip^=/usr/tmp/* " Hardcoded path for `sudo -e` @@ -79,10 +69,8 @@ set comments= set commentstring= " 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 +set completeopt+=longest " Insert longest common substring +set completeopt+=menuone " Show the menu even if only one match " Give me a prompt instead of just rejecting risky :write, :saveas set confirm @@ -96,7 +84,9 @@ set cpoptions+=J set directory^=$MYVIMRUNTIME/cache/swap// " Use UTF-8 if we can and env LANG didn't tell us not to -if has('multi_byte') && !exists('$LANG') && &encoding ==# 'latin1' +if has('multi_byte') + \ && !exists('$LANG') + \ && &encoding ==# 'latin1' set encoding=utf-8 endif @@ -107,10 +97,8 @@ if exists('+esckeys') endif " Fold based on indent, but only when I ask -if has('folding') - set foldlevelstart=99 - set foldmethod=indent -endif +set foldlevelstart=99 +set foldmethod=indent " Delete comment leaders when joining lines, if supported if v:version > 703 @@ -181,10 +169,8 @@ if &ruler endif " Make sessions usable -if exists('+sessionoptions') - set sessionoptions-=localoptions " No buffer options or mappings - set sessionoptions-=options " No global options or mappings -endif +set sessionoptions-=localoptions " No buffer options or mappings +set sessionoptions-=options " No global options or mappings " Don't show startup splash screen (I donated) set shortmess+=I @@ -198,7 +184,7 @@ set splitright " Right of the current window, not left " No terminal mouse, even if we could " The manual says to set 't_RV', but I don't like that -if exists('+ttymouse') && &ttymouse !=# '' +if &ttymouse !=# '' set ttymouse= endif @@ -217,9 +203,7 @@ if exists('+wildignorecase') endif " Let me move beyond buffer text in visual block mode -if exists('+virtualedit') - set virtualedit+=block -endif +set virtualedit+=block " Never beep at me set visualbell t_vb= -- cgit v1.2.3