-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc-old
More file actions
348 lines (286 loc) · 9.65 KB
/
vimrc-old
File metadata and controls
348 lines (286 loc) · 9.65 KB
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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
version 6.0
if &cp | set nocp | endif
let s:cpo_save=&cpo
set cpo&vim
vmap gx <Plug>NetrwBrowseXVis
nmap gx <Plug>NetrwBrowseX
vnoremap <silent> <Plug>NetrwBrowseXVis :call netrw#BrowseXVis()
nnoremap <silent> <Plug>NetrwBrowseX :call netrw#BrowseX(expand((exists("g:netrw_gx")? g:netrw_gx : '<cfile>')),netrw#CheckIfRemote())
let &cpo=s:cpo_save
unlet s:cpo_save
set backspace=indent,eol,start
set ruler
set suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc,.png,.jpg
" vim: set ft=vim :
syntax on
set cinkeys-=0#
set ttymouse=sgr
set mouse=a
set hlsearch
set smartcase
set autoindent
set smartindent
"set spell
set cryptmethod=blowfish2
set shell=/bin/zsh
set laststatus=2
" Wrap lines don't break words
set wrap linebreak nolist
" Force Vimdiff to wrap
autocmd FilterWritePre * if &diff | setlocal wrap< | endif
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Vundle
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set nocompatible " be iMproved
filetype off " required!
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
"let g:vundle#bundle_dir = '~/.vim/bundle'
" let Vundle manage Vundle. Required!
Plugin 'VundleVim/Vundle.vim'
" My Packages
Plugin 'Shougo/vimproc.vim'
Plugin 'scrooloose/nerdtree'
"Plugin 'Rip-Rip/clang_complete'
"Plugin 'justmao945/vim-clang'
"Plugin 'Valloric/YouCompleteMe'
"Plugin 'scrooloose/syntastic'
"Plugin 'vim-scripts/Conque-Shell'
Plugin 'oplatek/Conque-Shell'
"Plugin 'Shougo/vimshell.vim'
Plugin 'godlygeek/csapprox'
Plugin 'vim-scripts/taglist.vim'
"Plugin 'vim-scripts/Tagma-Buffer-Manager'
Plugin 'bling/vim-bufferline'
"Plugin 'jlanzarotta/bufexplorer'
Plugin 'tpope/vim-fugitive'
Plugin 'vim-scripts/AnsiEsc.vim'
Plugin 'kien/ctrlp.vim'
Plugin 'powerline/powerline', {'rtp': 'powerline/bindings/vim/'}
"Plugin 'bling/vim-airline'
Plugin 'godlygeek/tabular'
Plugin 'vim-scripts/DoxygenToolkit.vim'
Plugin 'jceb/vim-orgmode'
"Plugin 'tpope/vim-speeddating'
"Plugin 'itchyny/calendar.vim'
"Plugin 'calendar.vim--Matsumoto'
Plugin 'vim-scripts/utl.vim'
"Plugin 'farseer90718/vim-taskwarrior'
"Plugin 'derekwyatt/vim-scala'
"Plugin 'xuhdev/vim-latex-live-preview'
Plugin 'shime/vim-livedown'
"Plugin 'alepez/vim-gtest'
"Plugin 'tpope/vim-dispatch'
Plugin 'scrooloose/nerdcommenter'
Plugin 'puppetlabs/puppet-syntax-vim'
"Plugin 'rodjek/vim-puppet'
Plugin 'JuliaEditorSupport/julia-vim'
"Plugin 'ktvoelker/sbt-vim'
"MINE! :D
"Plugin 'mtcs/vim-cgtest'
"Bundle '~/projetos/vim-cgtest-git/.git'
" Color Schemes
Plugin 'flazz/vim-colorschemes'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
set encoding=utf-8
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Tweeks
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Sets how many lines of history VIM has to remember
set history=700
" Set to auto read when a file is changed from the outside
set autoread
" Turn backup off, since most stuff is in SVN, git et.c anyway...
" set nobackup
" set nowb
" set noswapfile
" Return to last edit position when opening files (You want this!)
autocmd BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal! g`\"" | endif
" Remember info about open buffers on close
set viminfo^=%
" Scala + jQuery Syntax
"au BufRead,BufNewFile *.scala set filetype=scala
"au! Syntax scala source ~/.vim/syntax/scala.vim
"au BufRead,BufNewFile jquery.*.js set ft=javascript syntax=jquery
" Arduino
autocmd BufNewFile,BufReadPost *.ino,*.pde set filetype=cpp
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Plugins Config
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" NERDTree
let NERDTreeShowBookmarks = 1
let NERDTreeMouseMode = 3
let NERDTreeAutoCenter=0
let NERDTreeIgnore=['.d$[[file]]', '.o$[[file]]', '.bbl$[[file]]', '.toc$[[file]]', '.aux$[[file]]', '.blg$[[file]]', '.tps$[[file]]', '.tcp$[[file]]']
"autocmd vimenter * NERDTree
autocmd bufenter * if (winnr("$") == 2 && exists("b:NERDTreeType") && (g:TagmaBufMgrloaded == 1) && b:NERDTreeType == "primary") | qa | endif
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | qa | endif
nmap e :NERDTreeToggle<CR> :wincmd l<CR>
" " Powerline
" let g:Powerline_symbols = 'fancy'
" set showtabline=2
" Airline
let g:airline_powerline_fonts=1
let g:powerline_pycmd='py3'
" ConqueTerm
"ca term ConqueTermTab bash
"ca tmake ConqueTermTab make
"ca tsplit ConqueTermSplit bash
"ca tvsplit ConqueTermVSplit bash
" Interpret terminal colors and terminal special encoded characters
"au BufRead * AnsiEsc
" TagmaBufferManager
let g:TagmaBufMgrLastWindow = 1
let g:TagmaBufMgrLastLine = 1
let g:TagmaBufMgrPopUp = 1
let g:TagmaBufMgrMapCArrow = 0
" Bufferline
let g:bufferline_echo = 1
" TagList
let Tlist_Use_SingleClick = 1
let g:Tlist_Use_Right_Window = 1
let g:Tlist_Compact_Format = 1
"autocmd vimenter * TlistOpen
nmap t :TlistToggle<CR>
" " Syntastic
" let g:syntastic_check_on_open = 1
" let g:syntastic_enable_signs = 1
" let g:syntastic_enable_highlighting = 1
" let g:syntastic_auto_loc_list = 0
" "let g:syntastic_warning_symbol=''
" "let g:syntastic_error_symbol=''
" let g:syntastic_cpp_check_header = 1
" let g:syntastic_cpp_compiler_options = ' -std=c++11 -Wall -Wextra -I/usr/include/openmpi -fopenmp -I ../include -I ../src/include -I include '
" "let g:syntastic_cpp_compiler_options = ' -std=c++11 -Wall -Wextra -I/usr/include/openmpi -fopenmp'
" CLang Complete
"let g:clang_user_options='|| exit 0'
"let g:clang_library_path='/usr/lib/llvm-3.4/lib'
" Vim Clang
"let g:clang_include_sysheaders = 1
"let g:clang_c_options = '-std=gnu11'
"let g:clang_cpp_options = '-std=c++11 -stdlib=libc++ -I ../include '
"let g:clang_cpp_options = '-std=c++11 -stdlib=libc++'
" You Complete Me
let g:ycm_warning_symbol = '!!'
"let g:ycm_global_ycm_extra_conf = ''
let g:ycm_confirm_extra_conf = 0
"let g:ycm_path_to_python_interpreter = '/usr/bin/python2'
" Doxigen Plugin
autocmd Filetype c,cpp set comments^=:///
"let g:DoxygenToolkit_briefTag_pre="@Synopsis "
"let g:DoxygenToolkit_paramTag_pre="@param "
"let g:DoxygenToolkit_returnTag="@returns "
let g:DoxygenToolkit_commentType = "C++"
let g:DoxygenToolkit_authorName = "Matheus C. Santos"
" Orgmode
let g:org_agenda_files=['~/org/index.org']
let g:org_todo_keywords=['TODO', 'ACTIVE', 'BLOCKED', '|']
let g:org_heading_highlight_colors = ['Title', 'Special', 'Identifier', 'Statement', 'PreProc', 'Type', 'Special']
" Calendar
let g:calendar_google_calendar = 1
let g:calendar_google_task = 1
" vim-latex-live-preview
let g:livepreview_previewer = 'evince'
" Nerd Commenter
let g:NERDSpaceDelims = 1
" GTest
"let g:gtest#highlight_failing_tests = 1
" CGTest
let g:cgtest_build_dir = "../debug"
" " Markdown Preview
" " should markdown preview get shown automatically upon opening markdown buffer
" let g:livedown_autorun = 0
" " should the browser window pop-up upon previewing
" let g:livedown_open = 1
" " the port on which Livedown server will run
" let g:livedown_port = 1337
" " the browser to use
" let g:livedown_browser = "google-chrome-stable"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Colors!!!
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"colorscheme twilight
"colorscheme railscasts
"colorscheme vividchalk
"colorscheme grb256
"colorscheme ir_black
colorscheme mtcs
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Custom Scripts
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Strip trailing whitespace
function! <SID>StripTrailingWhitespaces()
" Preparation: save last search, and cursor position.
let _s=@/
let l = line(".")
let c = col(".")
" Do the business:
%s/\s\+$//e
" Clean up: restore previous search history, and cursor position
let @/=_s
call cursor(l, c)
endfunction
autocmd BufWritePre * :call <SID>StripTrailingWhitespaces()
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Custom Keybindings
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Leader
" let maplocalleader = ","
imap <silent> <Down> <C-o>gj
imap <silent> <Up> <C-o>gk
nmap <silent> <Down> gj
nmap <silent> <Up> gk
map <silent> <home> g<home>
imap <silent> <home> <C-o>g<home>
map <silent> <End> g<End>
imap <silent> <End> <C-o>g<End>
" Window split keys
map <silent> <S-Up> :wincmd k<CR>
map <silent> <S-Down> :wincmd j<CR>
map <silent> <S-Left> :wincmd h<CR>
map <silent> <S-Right> :wincmd l<CR>
" Compilation
nnoremap <F5> :SyntasticCheck<CR>
nnoremap <F6> :Errors<CR>
"nnoremap <F9> :ConqueTermTab make<CR>
"nnoremap <F9> :VimShellTab<CR>
"vnoremap <F10> :VimShellSendString<CR>
nnoremap <F11> :make<CR>
nnoremap <F12> :make run<CR>
nnoremap <S-F12> :make debug<CR>
" Better Help
ca help<CR> tab help<CR>
map <silent> <F1> :tab help<CR>
" Calendar
map <silent> <F3> :Calendar -view=day -split=vertical -width=27<CR>
nnoremap <S-F3> :Calendar<CR>
" TaskWarrior
"map <F4> :TW<CR>
" Useful mappings for managing tabs
map <silent> <F2> :tabnew<CR>
map <silent> <C-t> :tabnew<CR>
map <silent> <S-PageUp> :bp<CR>
map <silent> <S-PageDown> :bn<CR>
map <silent> <C-PageUp> :tabprev<CR>
map <silent> <C-PageDown> :tabnext<CR>
ca :tN<CR> :tabnew<CR>
ca :tn<CR> :tabnext<CR>
ca :tx<CR> :tabnext<CR>
ca :tp<CR> :tabprev<CR>
ca :to<CR> :tabonly<CR>
ca :tc<CR> :tabclose<CR>
ca :tm<CR> :tabmove<CR>
ca :bq<CR> :bd<CR>
command Sudowrite w !sudo sh -c 'cat > %'
" Spell checking
" Pressing ,ss will toggle and untoggle spell checking
ca :Ss<CR> :setlocal spell!<CR>
" Shortcuts using <leader>
ca :Sn<CR> :]s<CR>
ca :Sp<CR> :[s<CR>
ca :Sa<CR> :zg<CR>
ca :S?<CR> :z=<CR>
" Focus Primary window
autocmd VimEnter * wincmd p