-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
196 lines (164 loc) · 3.96 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
186
187
188
189
190
191
192
193
194
195
196
" Gobal terminal settings
set encoding=utf-8
set t_Co=256
" General settings
set number
set cb=autoselect
set nocompatible
set background=dark
set autoindent
set sw=4
set ts=4
set expandtab
set backspace=indent,eol,start
set whichwrap=b,s,l,h,<,>,[,]
set icon
set title
set showbreak=\\
set noeol
set et
set hlsearch
set keywordprg=man\ -k
set formatprg=fmt
set hidden
set switchbuf=useopen
set showmatch
set matchtime=1
set showcmd
set lazyredraw
set viminfo='20,<50,/50 " Should appear after 'set nocompatible'
set history=50
set ruler
set suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc
set cpoptions=aABceFs
set smartcase
set incsearch
set autowrite
set scrolloff=3
set nosmartindent
set report=0
set wildmenu
filetype on
filetype off
if has("mouse")
set mouse=a
set mousemodel=extend
set mousefocus
set mousehide
endif
if has("syntax")
syntax on
endif
if has("autocmd")
" automatically delete trailing DOS-returns and trailing whitespaces
autocmd BufWritePre *.c,*.go,*.h,*.y,*.yy,*.l,*.ll,*.C,*.cpp,*.hh,*.cc,*.hxx,*.cxx,*.hpp,*.java,*.rb,*.py,*.m4,*.pl,*.pm silent! %s/[\r \t]\+$//
endif
" Key mapping
" imap <C-SPACE> <C-P>
let mapleader = ","
" Paste
map <S-Insert> <MiddleMouse>
map! <S-Insert> <MiddleMouse>
" Change buffer
" map <C-N> :bn<CR>
map <C-B> :bp<CR>
" Hide coloration of found words
nmap <silent> ,/ :nohlsearch<CR>
imap <C-TAB> <C-V><C-TAB>
" Paste toggle
" set pastetoggle=<C-P>
" noremap <C-P> :set invpaste<CR>
nmap _Y :!echo ""> ~/.vi_tmp<CR><CR>:w! ~/.vi_tmp<CR>
vmap _Y :w! ~/.vi_tmp<CR>
nmap _P :r ~/.vi_tmp<CR>
" Vundle
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'Lokaltog/powerline', {'rtp': 'powerline/bindings/vim/'}
Plugin 'easymotion/vim-easymotion'
Plugin 'scrooloose/nerdtree'
Plugin 'tristen/vim-sparkup'
Plugin 'corntrace/bufexplorer'
Plugin 'Valloric/YouCompleteMe'
Bundle 'tpope/vim-surround'
" Go Plugins
Plugin 'fatih/vim-go'
Plugin 'jstemmer/gotags'
Plugin 'majutsushi/tagbar'
" Python Plugins
Plugin 'nvie/vim-flake8'
Plugin 'vim-scripts/python.vim'
Plugin 'vim-scripts/indentpython.vim'
" Color Plugins
Plugin 'morhetz/gruvbox'
Plugin 'haensl/mustang-vim'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" Powerline
set laststatus=2
" NERDtree
let NERDTreeIgnore=['\.pyc$', '\~$'] "ignore files in NERDTree
map <leader>t :NERDTreeToggle<CR>
" Command-T
map <leader>f :CommandT<CR>
" Mapping window splits nav shortcuts
nnoremap <C-h> <C-w>h
nnoremap <C-l> <C-w>l
nnoremap <C-k> <C-w>k
nnoremap <C-j> <C-w>j
map <C-x> :close<CR>
" These should be moved to ftplugin python.vim
" Flake8
let g:flake8_error_marker='EE'
let g:flake8_max_line_length=99
let g:flake8_show_in_gutter=1
let g:flake8_show_in_file=1
let g:flake8_show_quickfix=0
let g:flake8_pyflake_marker=1
autocmd FileType python map <buffer> <C-n> :call Flake8()<CR>
autocmd BufWritePost *.py call Flake8()
" Go settings
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"
" YouCompleteMe YCM
" let g:ycm_auto_trigger = 0
" let g:ycm_key_invoke_completion = '<C-Space>'
" Colors
colorscheme mustang
" tagbar
nmap <F8> :TagbarToggle<CR>
" gotags
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'
\ }