aboutsummaryrefslogtreecommitdiff
path: root/vimrc
diff options
context:
space:
mode:
authorSergey Nazaryev <sergey@nazaryev.ru>2016-12-19 16:03:15 +0000
committerSergey Nazaryev <sergey@nazaryev.ru>2016-12-19 16:03:15 +0000
commitd6ac611202f9a579293f53222fadc0840f8a69f0 (patch)
treebcca9a62efd2be033a026b7ecf1e3e36d247ff5b /vimrc
parentc08548201660447a70c39ef8bfed61c2d0981a52 (diff)
downloaddotfiles-d6ac611202f9a579293f53222fadc0840f8a69f0.zip
dotfiles-d6ac611202f9a579293f53222fadc0840f8a69f0.tar.gz
dotfiles-d6ac611202f9a579293f53222fadc0840f8a69f0.tar.bz2
Correct tab widths for *.c, *.dts and Makefile
Diffstat (limited to 'vimrc')
-rw-r--r--vimrc9
1 files changed, 4 insertions, 5 deletions
diff --git a/vimrc b/vimrc
index 6ea641a..6f6814d 100644
--- a/vimrc
+++ b/vimrc
@@ -43,11 +43,6 @@ set lazyredraw " no lags
set ttyfast " no lags
"set nocompatible
-" Settings for specific file types
-autocmd FileType make set noexpandtab shiftwidth=8 softtabstop=0
-autocmd FileType c set noexpandtab shiftwidth=4 softtabstop=0
-autocmd FileType dts set noexpandtab shiftwidth=2 softtabstop=0
-
" Style settings
syntax on " turn on syntax highlight
colorscheme elflord
@@ -75,6 +70,10 @@ function! StripTrailingWhitespace()
endfunction
if has("autocmd")
+ " settings for specific file types
+ autocmd! FileType make setlocal noexpandtab tabstop=8 shiftwidth=8 softtabstop=8 textwidth=80
+ autocmd! FileType c setlocal noexpandtab tabstop=8 shiftwidth=8 softtabstop=8 textwidth=80
+ autocmd! FileType dts setlocal noexpandtab tabstop=8 shiftwidth=8 softtabstop=8 textwidth=80
" jump to the last position when reopening a file
autocmd! BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif