summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorDmitry Ilvokhin <d@ilvokhin.com>2025-01-18 18:09:03 +0000
committerDmitry Ilvokhin <d@ilvokhin.com>2025-01-18 18:09:03 +0000
commitd30a200c879ab4ad2082720f92fe0d224ea844e7 (patch)
treeac1bea926b59b9bddc10b864d4fdeefeba5b5327 /misc
parent6d8233348a4e89a402af6bfcf2083a012de6096b (diff)
downloadinfra-d30a200c879ab4ad2082720f92fe0d224ea844e7.tar.gz
infra-d30a200c879ab4ad2082720f92fe0d224ea844e7.tar.bz2
infra-d30a200c879ab4ad2082720f92fe0d224ea844e7.zip
Handle C files properly in vim
Diffstat (limited to 'misc')
-rw-r--r--misc/dotfiles/vimrc6
1 files changed, 6 insertions, 0 deletions
diff --git a/misc/dotfiles/vimrc b/misc/dotfiles/vimrc
index 2b78b0e..5a31ae8 100644
--- a/misc/dotfiles/vimrc
+++ b/misc/dotfiles/vimrc
@@ -15,6 +15,12 @@ set shiftwidth=4
" Limit text width.
set textwidth=79
+" Do not expand tabs and use eight space indentation for C files.
+autocmd FileType c setlocal noexpandtab
+autocmd FileType c setlocal tabstop=8
+autocmd FileType c setlocal softtabstop=8
+autocmd FileType c setlocal shiftwidth=8
+
" In Makefiles, don't expand tabs to spaces, since we need the actual tabs.
autocmd FileType make setlocal noexpandtab