]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
vimrc: explicitly set shiftwidth for the C file type 29206/head
authorFrantisek Sumsal <frantisek@sumsal.cz>
Mon, 18 Sep 2023 10:36:11 +0000 (12:36 +0200)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Mon, 18 Sep 2023 11:11:45 +0000 (13:11 +0200)
If you start editing a shell script and then open a buffer with a C
file, the shiftwidth set by the previous autocommand for the sh file
type would not be reset to the original (global) 8ch. Let's fix this by
explicitly setting the shiftwidth in the C file type autocommand as
well.

.vimrc

diff --git a/.vimrc b/.vimrc
index 9a512ec6c8cd0dd206dc4c9e477a436c4550eba8..70d063d9caacc57400e3e87ddaead0428409228a 100644 (file)
--- a/.vimrc
+++ b/.vimrc
@@ -18,4 +18,4 @@ set makeprg=GCC_COLORS=\ make
 set tw=79
 au BufRead,BufNewFile *.xml set tw=109 shiftwidth=2 smarttab
 au FileType sh set tw=109 shiftwidth=4 smarttab
-au FileType c set tw=109
+au FileType c set tw=109 shiftwidth=8