-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
185 lines (166 loc) · 3.63 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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
if getcwd() ==? "C:\\Windows\\system32"
chdir ~
endif
let mapleader = ","
execute pathogen#infect()
set nocompatible
set background=light
set cpoptions=aABceFsmq
syntax on
filetype plugin indent on
set encoding=utf-8
set autoindent
set showmode
set showcmd
set autochdir
set backspace=indent,eol,start
set backup
set backupdir=~/.vimtemp/backup
set undodir=~/.vimtemp/undo
set undofile
set undolevels=1000
set undoreload=10000
set clipboard+=unnamed
set directory=~/.vimtemp/tmp
set fileformats=unix,dos,mac
set hidden
set mouse=a
set noerrorbells
set wildmenu
set wildignore=*.dll,*.o,*.obj,*.bak,*.exe,*.jpg,*.gif,*.png
set wildmode=full
set visualbell
set list
set listchars=tab:·\
set tags=tags;
nnoremap j gj
nnoremap k gk
" emacs style command line
cnoremap <C-a> <Home>
cnoremap <C-b> <Left>
cnoremap <C-f> <Right>
cnoremap <C-d> <Delete>
cnoremap <M-b> <S-Left>
cnoremap <M-f> <S-Right>
cnoremap <M-d> <S-right><Delete>
cnoremap <Esc>b <S-Left>
cnoremap <Esc>f <S-Right>
cnoremap <Esc>d <S-right><Delete>
cnoremap <C-g> <C-c>
inoremap <F1> <ESC>
nnoremap <F1> <ESC>
vnoremap <F1> <ESC>
nnoremap ; :
" clear highlight
nmap <leader>q :nohlsearch<CR>
" activate ctrl-p
nmap ; :CtrlPBuffer<CR>
" syntastic
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
" airline
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#fnamemod = ':t'
let html_use_css=1
set ttyfast
set ruler
set incsearch
set hlsearch
set laststatus=2
set lazyredraw
set linespace=0
set nostartofline
set report=0
set scrolloff=10
set showmatch
set sidescrolloff=10
set relativenumber
set undofile
set gdefault
nnoremap <leader><space> :let @/=''<cr>
nnoremap <tab> %
vnoremap <tab> %
set expandtab
set ignorecase
set infercase
set shiftround
set smartcase
set shiftwidth=4
set softtabstop=4
set tabstop=4
set colorcolumn=80
set formatoptions=qrn1
set foldenable
set foldmarker={,}
set foldmethod=marker
set foldlevel=100
set foldopen=block,hor,mark,percent,quickfix,tag
function SimpleFoldText()
return getline(v:foldstart).' '
endfunction
set foldtext=SimpleFoldText()
" For arrows in nerdtree
scriptencoding utf-8
let g:NERDTreeDirArrows=1
" sync cwd
let g:NERDTreeChDirMode=2
let NERDTreeQuitOnOpen=1
nmap <leader>e :NERDTreeToggle<CR>
map <F8> :TagbarToggle<CR>
" Strip trailing whitespace
nnoremap <leader>W :%s/\s\+$//<cr>:let @/=''<CR>
" Select just-pasted text
nnoremap <leader>v V`]
" Exit out of insert mode with jj
inoremap jj <ESC>
let g:zenburn_high_Contrast=1
colorscheme zenburn
if has("gui_running")
set guifont=Consolas:h11
set guioptions=cerL
set columns=120
set textwidth=0
set lines=30
syntax match BadSpace /^\t/
syntax match BadSpace /\s\+$/
highlight BadSpace guibg=chocolate
endif
" YouCompleteMe
let g:go_highlight_functions = 1
let g:go_highlight_methods = 1
let g:go_highlight_structs = 1
let g:go_highlight_operators = 1
let g:go_highlight_build_constraints = 1
let g:go_fmt_command = "goimports"
" TagBar for Go
let g:tagbar_type_go = {
\ 'ctagstype' : 'go',
\ 'kinds' : [
\ 'p:package',
\ 'i:imports:1',
\ 'c:constants',
\ 'v:variables',
\ 't:types',
\ 'n:interfaces',
\ 'w:fields',
\ 'e:embedded',
\ 'm:methods',
\ 'r:constructor',
\ 'f:functions'
\ ],
\ 'sro' : '.',
\ 'kind2scope' : {
\ 't' : 'ctype',
\ 'n' : 'ntype'
\ },
\ 'scope2kind' : {
\ 'ctype' : 't',
\ 'ntype' : 'n'
\ },
\ 'ctagsbin' : 'gotags',
\ 'ctagsargs' : '-sort -silent'
\ }
" quick commands for hex editing using xxd
command HexEdit %!xxd
command HexEnd %!xxd -r