-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc.vim
56 lines (43 loc) · 1.45 KB
/
vimrc.vim
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
set modeline
syntax on
set smartindent
filetype indent on
set tabstop=4
set shiftwidth=4
set expandtab
set scrolloff=3
set incsearch
set wildmenu
set mouse=a
set background=light
set cursorline
set number
set t_Co=256
set t_ut=""
colorscheme solarized
if &diff
colorscheme pablo
end
set wildignore=*.o,*.pyc,*~,.swp*
autocmd FileType make,go set noexpandtab shiftwidth=4 softtabstop=0
autocmd FileType c,cpp,h,hpp,java,scala set expandtab shiftwidth=4 tabstop=4
autocmd FileType python set expandtab shiftwidth=3 tabstop=3
autocmd FileType c,cpp,h,hpp,java,scala,js,go let b:comment_leader = '//'
autocmd FileType python let b:comment_leader = '#'
autocmd FileType tex let b:comment_leader = '%'
autocmd FileType tex let g:tex_flavor='latex'
autocmd FileType tex set spell
noremap <silent> ,cc :<C-B>silent <C-E>s/^/<C-R>=escape(b:comment_leader, '\/')<CR>/<CR>:nohlsearch<CR>
noremap <silent> ,cu :<C-B>silent <C-E>s/^\V<C-R>=escape(b:comment_leader, '\/')<CR>//e<CR>:nohlsearch<CR>
":json runs :%!python -m json.tool
command Json :%!python -m json.tool
let g:tmux_navigator_no_mappings = 1
nnoremap <silent> <c-h> :TmuxNavigateLeft<cr>
nnoremap <silent> <c-j> :TmuxNavigateDown<cr>
nnoremap <silent> <c-k> :TmuxNavigateUp<cr>
nnoremap <silent> <c-l> :TmuxNavigateRight<cr>
nnoremap <silent> <c-\> :TmuxNavigatePrevious<cr>
set hlsearch
noremap <F12> <Esc>:syntax sync fromstart<CR>
"When saving golang files, run gofmt
au BufWritePost *.go !gofmt -w %