From 364f1fe6168e5b7345160870ce9e9081282dc9b6 Mon Sep 17 00:00:00 2001 From: Stefan Huber Date: Sat, 21 Mar 2020 15:00:07 +0100 Subject: [PATCH] Improve indentation settings - Disable automatic DetectIndent on BufReadPost. - Set more stable preferences for DetectIndent. --- init.vim | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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:.' -- 2.39.5