diff options
author | Patrick Palka <ppalka@redhat.com> | 2020-07-23 10:38:58 -0400 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2020-07-23 13:34:00 -0400 |
commit | 914966e499dfe0861127447bc72c9071e80a4a9b (patch) | |
tree | 80a4b8941aef4f7a91946cfa865eda101854e28c /contrib/vimrc | |
parent | 084dc63a0200e60e0fbb7c36b412a158d234f5c0 (diff) | |
download | gcc-914966e499dfe0861127447bc72c9071e80a4a9b.zip gcc-914966e499dfe0861127447bc72c9071e80a4a9b.tar.gz gcc-914966e499dfe0861127447bc72c9071e80a4a9b.tar.bz2 |
contrib/vimrc: detect more C-like files
Currently this script doesn't set the indentation style for the standard
library headers under libstdc++/ because they lack a file extension.
But they do have a modeline, so the file type is still set appropriately
by Vim. So by inspecting &filetype, we can also detect these standard
library headers as C-like files.
contrib/ChangeLog:
* vimrc (SetStyle): Also inspect &filetype to determine whether
a file is C-like.
Diffstat (limited to 'contrib/vimrc')
-rw-r--r-- | contrib/vimrc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/vimrc b/contrib/vimrc index c207eea..356d455 100644 --- a/contrib/vimrc +++ b/contrib/vimrc @@ -45,7 +45,7 @@ function! SetStyle() setlocal textwidth=80 endif setlocal formatoptions-=ro formatoptions+=cqlt - if index(l:c_exts, l:ext) != -1 + if index(l:c_exts, l:ext) != -1 || &filetype == "c" || &filetype == "cpp" setlocal cindent setlocal cinoptions=>4,n-2,{2,^-2,:2,=2,g0,f0,h2,p4,t0,+2,(0,u0,w1,m0 endif |