summaryrefslogtreecommitdiff
path: root/contrib/vimrc
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2020-04-17 08:55:55 +0200
committerMartin Liska <mliska@suse.cz>2020-04-17 08:55:55 +0200
commit5315e1dafa08a57b757d02fe65baea65f0550c41 (patch)
tree5f4ea61d52229d532eccfeee4758c282cfe04a8b /contrib/vimrc
parentdd75498db79675a1a0b73c25e5f110969ee72d9d (diff)
downloadgcc-5315e1dafa08a57b757d02fe65baea65f0550c41.tar.gz
Do not modify tab options in vimrc for .py files.
* vimrc: We do not want to modify tab options for Python files.
Diffstat (limited to 'contrib/vimrc')
-rw-r--r--contrib/vimrc14
1 files changed, 8 insertions, 6 deletions
diff --git a/contrib/vimrc b/contrib/vimrc
index bbbe1dd449b..fa0208d5beb 100644
--- a/contrib/vimrc
+++ b/contrib/vimrc
@@ -28,17 +28,19 @@
function! SetStyle()
let l:fname = expand("%:p")
+ let l:ext = fnamemodify(l:fname, ":e")
+ let l:c_exts = ['c', 'h', 'cpp', 'cc', 'C', 'H', 'def', 'java']
if stridx(l:fname, 'libsanitizer') != -1
return
endif
- setlocal tabstop=8
- setlocal softtabstop=2
- setlocal shiftwidth=2
- setlocal noexpandtab
+ if l:ext != "py"
+ setlocal tabstop=8
+ setlocal softtabstop=2
+ setlocal shiftwidth=2
+ setlocal noexpandtab
+ endif
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 cinoptions=>4,n-2,{2,^-2,:2,=2,g0,f0,h2,p4,t0,+2,(0,u0,w1,m0