-
Notifications
You must be signed in to change notification settings - Fork 2
/
vimrc
148 lines (123 loc) · 3.57 KB
/
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
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
set nocompatible " not vi compatible
"--------------
" Load pathogen
"--------------
runtime bundle/vim-pathogen/autoload/pathogen.vim
call pathogen#infect()
call pathogen#helptags()
"------------------
" Syntax and indent
"------------------
syntax on " turn on syntax highlighting
syntax enable
set showmatch " show matching braces when text indicator is over them
" vim can autodetect this based on $TERM (e.g. 'xterm-256color')
" but it can be set to force 256 colors
" set t_Co=256
if &t_Co < 256
colorscheme default
set background=dark
set nocursorline " looks bad in this mode
else
" This option doesn't seem to work for solarized-dark in my setup
" let g:solarized_termcolors=256 "
set background=dark
colorscheme solarized
" customized colors
highlight SignColumn ctermbg=234
highlight StatusLine cterm=bold ctermfg=245 ctermbg=235
highlight StatusLineNC cterm=bold ctermfg=245 ctermbg=235
let g:NeatStatusLine_color_normal='ctermfg=64 ctermbg=235 cterm=bold'
let g:NeatStatusLine_color_insert='ctermfg=136 ctermbg=235 cterm=bold'
let g:NeatStatusLine_color_replace='ctermfg=160 ctermbg=235 cterm=bold'
let g:NeatStatusLine_color_visual='ctermfg=33 ctermbg=235 cterm=bold'
let g:NeatStatusLine_color_position='ctermfg=245 ctermbg=235 cterm=bold'
let g:NeatStatusLine_color_modified='ctermfg=166 ctermbg=235 cterm=bold'
let g:NeatStatusLine_color_line='ctermfg=61 ctermbg=235 cterm=bold'
let g:NeatStatusLine_color_filetype='ctermfg=37 ctermbg=235 cterm=bold'
endif
filetype plugin indent on " enable file type detection
set autoindent
set autowrite
" Basic editing config
set nu " number lines
" Menu completion
set wildmenu
set wildmode=list:longest,full
" Whitespace
set cindent
set expandtab
set shiftwidth=2
set ts=2
set expandtab
" Searching
set hlsearch
set incsearch
set ignorecase
set smartcase
" Disable vim backups
set nobackup
set nowritebackup
" Disable swapfile
set noswapfile
" Split configuration
set splitright
set splitbelow
" makefile
" autocmd FileType make set noexpandtab shiftwidth=8 softtabstop=0
if &term =~ '^screen'
" tmux knows the extended mouse mode
set ttymouse=xterm2
endif
" Disable arrow keys
map <Left> :echo "no! Use h"<cr>
map <Right> :echo "no! Use l"<cr>
map <Up> :echo "no! Use k"<cr>
map <Down> :echo "no! Use j"<cr>
imap <Left> <nop>
imap <Right> <nop>
imap <Up> <nop>
imap <Down> <nop>
" Quicker window movement
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-h> <C-w>h
nnoremap <C-l> <C-w>l
" Add comma as leader
:nmap , \
" Save with leader + w
nnoremap <Leader>w :w<CR>
" Unhighlight search results
map <Leader><space> :nohl<cr>
" format JSON with jq
nnoremap <Leader>j :%!cat % <bar> jq '.'<CR>
" NERDTree configuration
let NERDTreeIgnore=['\~$', 'tmp', '\.git', '\.bundle', '.DS_Store', 'tags', '.swp']
let NERDTreeShowHidden=1
let g:NERDTreeDirArrows=0
map <Leader>n :NERDTreeToggle<CR>
map <Leader>fnt :NERDTreeFind<CR>
" syntastic
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_mode_map = {
\ 'mode': 'passive',
\ 'active_filetypes': [],
\ 'passive_filetypes': []
\}
" CtrlP
let g:ctrlp_map = '<c-p>'
let g:ctrlp_cmd = 'CtrlP'
" vim-hclfmt
let g:terraform_fmt_on_save = 0
let g:hcl_fmt_autosave = 1
let g:tf_fmt_autosave = 1
let g:nomad_fmt_autosave = 1
nnoremap <Leader>s :SyntasticCheck<CR>
nnoremap <Leader>r :SyntasticReset<CR>
nnoremap <Leader>i :SyntasticInfo<CR>
nnoremap <Leader>m :SyntasticToggleMode<CR>
if filereadable(expand('~/.vimrc.local'))
source ~/.vimrc.local
endif