aboutsummaryrefslogtreecommitdiff
path: root/vimrc
blob: 7d373a9f23f51b24a709a28372675520a976b808 (plain) (blame)
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
28
29
30
31
32
33
34
35
36
37
38
39
40
" make 256color in tmux work
set background=dark

if 1
	augroup vimStartup
		au!
	
		autocmd BufReadPost *
			\ if line("'\"") >= 1 && line("'\"") <= line("$") && &ft !~# 'commit'
			\ |		exe "normal! g`\""
			\ | endif
	augroup END
endif

augroup go_save | au!
	autocmd BufWritePost *.go !goimports -l -w '%:p:h'
	autocmd BufWritePost *.go edit!
	autocmd BufWritePost *.go redraw!
augroup end

augroup rust_save | au!
	autocmd BufWritePost *.rs !cargo fmt
	autocmd BufWritePost *.rs edit!
	autocmd BufWritePost *.rs redraw!
augroup end

autocmd FileType rust setlocal ts=4 sw=4 expandtab
autocmd FileType rust set shiftwidth=4
autocmd FileType rust set softtabstop=4

autocmd FileType yaml setlocal ts=2 sw=2 expandtab
autocmd FileType yaml set shiftwidth=2
autocmd FileType yaml set softtabstop=2

nnoremap <Enter> moO<Esc>`o

set autoindent
set number
set tabstop=4
syntax on