From d30a200c879ab4ad2082720f92fe0d224ea844e7 Mon Sep 17 00:00:00 2001 From: Dmitry Ilvokhin Date: Sat, 18 Jan 2025 18:09:03 +0000 Subject: Handle C files properly in vim --- misc/dotfiles/vimrc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'misc/dotfiles') 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 -- cgit v1.2.3-70-g09d2