From 5315e1dafa08a57b757d02fe65baea65f0550c41 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Fri, 17 Apr 2020 08:55:55 +0200 Subject: [PATCH] Do not modify tab options in vimrc for .py files. * vimrc: We do not want to modify tab options for Python files. --- contrib/ChangeLog | 5 +++++ contrib/vimrc | 14 ++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/contrib/ChangeLog b/contrib/ChangeLog index 7efe9a4956e..43fe1e7a1cb 100644 --- a/contrib/ChangeLog +++ b/contrib/ChangeLog @@ -1,3 +1,8 @@ +2020-04-17 Martin Liska + + * vimrc: We do not want to modify tab options + for Python files. + 2020-04-16 Jakub Jelinek PR bootstrap/92008 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 -- 2.30.2