From: Stefan Huber Date: Sat, 21 Mar 2020 14:00:07 +0000 (+0100) Subject: Improve indentation settings X-Git-Url: https://git.sthu.org/?a=commitdiff_plain;h=364f1fe6168e5b7345160870ce9e9081282dc9b6;p=vimconf.git Improve indentation settings - Disable automatic DetectIndent on BufReadPost. - Set more stable preferences for DetectIndent. --- diff --git a/init.vim b/init.vim index e4ed9a1..2821377 100644 --- a/init.vim +++ b/init.vim @@ -48,6 +48,10 @@ let g:enable_plugin_devicons = 1 runtime plugsetup.vim +" Some preferences for indent detection +let g:detectindent_min_indent = 2 +let g:detectindent_preferred_indent = 4 + " Attention: Must be run after plugsetup.vim " Trailing whitespace highlight default link BadWhitespace SpellCap @@ -158,6 +162,8 @@ imap (JavaComplete-Imports-AddMissing) nmap (JavaComplete-Imports-RemoveUnused) imap (JavaComplete-Imports-RemoveUnused) +" Minimum indenting for source code +au FileType java,cpp,c,cs let g:detectindent_min_indent = 4 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Some plugin-specific settings @@ -166,7 +172,7 @@ au FileType markdown call RagtagInit() let g:detectspelllang_langs = {} let g:detectspelllang_langs.aspell =[ 'en_US', 'de_AT'] -au BufReadPost * :DetectIndent +"au BufReadPost * :DetectIndent au BufEnter *.c* let b:fswitchlocs='reg:/lib/include/,rel:.' au BufEnter *.h* let b:fswitchlocs='reg:/include/lib/,rel:.'