-
Notifications
You must be signed in to change notification settings - Fork 0
/
dot-vimrc
27 lines (27 loc) · 1.29 KB
/
dot-vimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
" I'm using the following config to make my code look the same everywhere.
"set bs=indent,eol,start " allow backspacing over everything
"set autoindent " enable auto-indentation
"set tabstop=2 " no. of spaces for tab in file
"set shiftwidth=2 " no. of spaces for step in autoindent
"set softtabstop=2 " no. of spaces for tab when editing
"set expandtab " expand tabs into spaces
"set smarttab " smart tabulation and backspace
set list
set listchars=eol:⏎,tab:␉·,trail:␠,nbsp:⎵
set tabstop=8 softtabstop=0 expandtab shiftwidth=4 smarttab
set modeline
set modelines=5
" Then I use an additional block to set indentation for exceptions.
if has("autocmd")
augroup styles
autocmd!
" Custom filetypes settings: Python, Shell, Go, JSON, Vagrant
au FileType python,sh set tabstop=4 shiftwidth=4 softtabstop=4
au FileType go set noexpandtab tabstop=8 shiftwidth=8 softtabstop=8
au BufRead,BufNewFile *.json setfiletype javascript
au BufRead,BufNewFile Vagrantfile setfiletype ruby
" add yaml stuffs
au! BufNewFile,BufReadPost *.{yaml,yml} set filetype=yaml
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
augroup END
endif