From: Alexander Monakov Date: Mon, 2 Sep 2019 12:30:02 +0000 (+0300) Subject: contrib/vimrc: override formatting options for more files X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2b196fb76e1ff1ea15c3772ad59ee59018682eff;p=gcc.git contrib/vimrc: override formatting options for more files * vim-gcc-dev/syntax/gcc-match.vim: Do not override 'tabstop' here. * vimrc: Set preferred values for 'tabstop', 'softtabstop', 'shiftwidth', 'noexpandtab', 'textwidth', 'formatoptions' for all files, not just C-like files. From-SVN: r275316 --- diff --git a/contrib/ChangeLog b/contrib/ChangeLog index e5429d79a3d..af7b08b327e 100644 --- a/contrib/ChangeLog +++ b/contrib/ChangeLog @@ -1,3 +1,10 @@ +2019-09-02 Alexander Monakov + + * vim-gcc-dev/syntax/gcc-match.vim: Do not override 'tabstop' here. + * vimrc: Set preferred values for 'tabstop', 'softtabstop', + 'shiftwidth', 'noexpandtab', 'textwidth', 'formatoptions' for all + files, not just C-like files. + 2019-09-02 Martin Liska * vim-gcc-dev/syntax/gcc-match.vim: Set tabstop=8. diff --git a/contrib/vim-gcc-dev/syntax/gcc-match.vim b/contrib/vim-gcc-dev/syntax/gcc-match.vim index e46140da044..356b07a15b2 100644 --- a/contrib/vim-gcc-dev/syntax/gcc-match.vim +++ b/contrib/vim-gcc-dev/syntax/gcc-match.vim @@ -68,6 +68,4 @@ hi def link pdComment Comment hi def link pdTodo Todo hi def link pdPreProc PreProc -setlocal tabstop=8 - let b:current_syntax = "gcc-match" diff --git a/contrib/vimrc b/contrib/vimrc index 7c0c5878c63..bbbe1dd449b 100644 --- a/contrib/vimrc +++ b/contrib/vimrc @@ -31,17 +31,17 @@ function! SetStyle() if stridx(l:fname, 'libsanitizer') != -1 return endif + setlocal tabstop=8 + setlocal softtabstop=2 + setlocal shiftwidth=2 + setlocal noexpandtab + setlocal textwidth=80 + setlocal formatoptions-=ro formatoptions+=cqlt let l:ext = fnamemodify(l:fname, ":e") let l:c_exts = ['c', 'h', 'cpp', 'cc', 'C', 'H', 'def', 'java'] if index(l:c_exts, l:ext) != -1 setlocal cindent - setlocal tabstop=8 - setlocal softtabstop=2 - setlocal shiftwidth=2 - setlocal noexpandtab setlocal cinoptions=>4,n-2,{2,^-2,:2,=2,g0,f0,h2,p4,t0,+2,(0,u0,w1,m0 - setlocal textwidth=80 - setlocal formatoptions-=ro formatoptions+=cqlt endif endfunction