-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmyvimrc
More file actions
697 lines (570 loc) · 18.2 KB
/
myvimrc
File metadata and controls
697 lines (570 loc) · 18.2 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
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
"inspired by pracital vim, learn vimscript the hard way and Amir Salihefendic(https://github.com/amix/vimrc)
" Sections:
" -> General
" -> VIM user interface
" -> Colors and Fonts
" -> Files and backups
" -> Text, tab and indent related
" -> Visual mode related
" -> Moving around, tabs and buffers
" -> Status line
" -> Editing mappings
" -> vimgrep searching and cope displaying
" -> Spell checking
" -> Helper functions
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => General
" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"Sets how many lines of history VIM has to remember
set history=5000
"map , 为leader key
let mapleader=","
let g:mapleader = ","
" Vim load indentation rules and plugins according to the detected filetype.
if has("autocmd")
filetype plugin indent on
endif
set nocompatible
""""""""""""""""""""""""""""""""""""
" Vim user interface
"""""""""""""""""""""""""""
" set 7 line to the cursor, so when you curson is up the bottom line 7 lines vim will auto scroll
set so=7
" Ignore compiled files, :h wildignore
set wildignore=*.o,*~,*.pyc
set wildignore+=.git\*,.hg\*,.svn\*
" The following are commented out as they cause vim to behave a lot
" differently from regular Vi. They are highly recommended though.
set showcmd "Show (partial) command in status line.
set ignorecase "Do case insensitive matching
set smartcase "Do smart case matching
set number
set relativenumber " see https://blog.petrzemek.net/2016/04/06/things-about-vim-i-wish-i-knew-earlier/
" a buffer is hidden when is abandoned
set hid
" No annoying sound on errors
set noerrorbells
set novisualbell
"visual bell
" set t_vb=
"?
set tm=500
set ruler
"搜索设置
set hlsearch
"随输入增量搜索
set incsearch
" Add a bit extra margin to the left
" set foldcolumn=1
""?
if has('multi_byte') && v:version > 601
if v:lang =~? '^\(zh\)\|\(ja\)\|\(ko\)'
set ambiwidth=double
endif
endif
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Colors and Fonts
" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" " Enable syntax highlighting
syntax enable
try
" colorscheme desert
catch
endtry
"solarized
" if has('gui_running')
" set background=light
" else
" endif
" set background=dark
" colorscheme solarized
" molokai color scheme
set background=dark
let g:molokai_original = 1
colorscheme molokai
" colorscheme dracula
"""""""" peaksea
" if ! has("gui_running")
" set t_Co=256
" endif
" " feel free to choose :set background=light for a different style
" set background=dark
" colors peaksea
" """"""""""""""""
" autocmd FileType clojure colors peaksea
" autocmd FileType clojure set background=dark
" Set utf8 as standard encoding and en_US as the standard language
set encoding=utf8
" " Use Unix as the standard file type
set ffs=unix,dos,mac
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Files, backups and undo
" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" " Turn backup off, since most stuff is in SVN, git et.c anyway...
set nobackup
set nowb
set noswapfile
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Text, tab and indent related
" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Use spaces instead of tabs
set expandtab "tab to spaces if want to insert tab use Ctrl-V<C-I> key sequence.
" Be smart when using tabs ;)
set smarttab
set tabstop=2
"行间交错为2字节
set shiftwidth=2
if has('moues')
set mouse=a
endif
set selection=exclusive
set selectmode=mouse,key
set wrap
set linebreak
set tw=500
"智能对齐
set smartindent
"在输入括号时光标会短暂的跳到与之匹配的括号处 不影响输入
set showmatch
"自动对齐
set autoindent
""""""""""""""""""""""""""""""
" => Visual mode related
" """"""""""""""""""""""""""""""
" " Visual mode pressing * or # searches for the current selection
" " Super useful! From an idea by Michael Naumann
vnoremap <silent> * :call VisualSelection('f', '')<CR>
vnoremap <silent> # :call VisualSelection('b', '')<CR>
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Moving around, tabs, windows and buffers
" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Treat long lines as break lines (useful when moving around in them) key mapping to erase browing long lines
noremap j gj
noremap k gk
noremap <Down> gj
noremap <Up> gk
""""""""
"use with relative number
"see https://blog.petrzemek.net/2016/04/06/things-about-vim-i-wish-i-knew-earlier/
""""""""
noremap <silent> <expr> j (v:count == 0 ? 'gj' : 'j')
noremap <silent> <expr> k (v:count == 0 ? 'gk' : 'k')
imap <silent> <C-J> <C-O>j
imap <silent> <C-k> <C-O>k
imap <silent> <C-h> <C-O>h
imap <silent> <C-l> <C-O>l
"
" " Smart way to move between windows. cool!
map <C-j> <C-W>j
map <C-k> <C-W>k
map <C-h> <C-W>h
map <C-l> <C-W>l
" close window
noremap ,c :close<cr>
""""""""""""""""""""""""""""""""""""""""
"" buffers
"""""""""""""""""""""""""""""""""""""""""
set hidden "in order to switch between buffers with unsaved change
noremap <s-tab> :bp<cr>
noremap <tab> :bn<cr>
noremap ,bd :bd<cr>
" Vim jump to the last position when reopening a file
if has("autocmd")
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
endif
" Remember info about open buffers on close
" set viminfo^=%
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Editing mappings
" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"---------------键盘映射------------------"
" Remap VIM 0 to first non-blank character
" noremap 0 ^
nmap <silent> <F2> :noh<CR>
imap <silent> <F2> <esc> :noh<CR>
" paste model
set pastetoggle=<f4>
" nnoremap ,l :set number! <CR>
" Move a line of text using ALT+[jk] or Comamnd+[jk] on mac
" not work on mac ??
nmap <M-j> mz:m+<cr>`z
nmap <M-k> mz:m-2<cr>`z
vmap <M-j> :m'>+<cr>`<my`>mzgv`yo`z
vmap <M-k> :m'<-2<cr>`>my`<mzgv`yo`z
if has("mac") || has("macunix")
nmap <D-j> <M-j>
nmap <D-k> <M-k>
vmap <D-j> <M-j>
vmap <D-k> <M-k>
endif
"delete all space in the start of lines"
function! RemoveTrailingSpace()
if $VIM_HATE_SPACE_ERRORS != '0'
normal m`
silent! :%s/\s\+$//ge
normal ``
endif
endfunction
function! ReplaceQuote()
normal m`
silent! :%s/“/"/ge
silent! :%s/”/"/ge
silent! :%s/‘/'/ge
silent! :%s/’/'/ge
normal ``
endfunction
" replace table by space
function! ReplaceTableWithSpaceAndRemoveTrailingSpace()
normal m`
silent! :%s /\t/ /g
silent! :%s/\s\+$//e
normal ``
endfunction
nnoremap <silent> <leader><space> :call ReplaceTableWithSpaceAndRemoveTrailingSpace()<CR>
" Delete trailing white space on save, useful for Python and CoffeeScript ;)
" autocmd BufWrite * :call RemoveTrailingSpace()
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Ack searching and cope displaying
" " requires ack.vim - it's much better than vimgrep/grep
" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
nnoremap ,g :Ag <cword><CR>
"""""""""""""""""""
" => serach word in dash
"""""""""""""""""
nnoremap ,d :Dash <cword><CR>
" When you press gv you Ack after the selected text
vnoremap <silent> gv :call VisualSelection('gv', '')<CR>
" When you press <leader>r you can search and replace the selected text
vnoremap <silent> <leader>r :call VisualSelection('replace', '')<CR>
" Do :help cope if you are unsure what cope is. It's super useful!
"
" When you search with Ack, display your results in cope by doing:
" <leader>cc
"
" To go to the next search result do:
" <leader>n
"
" To go to the previous search results do:
" <leader>p
"
map <leader>cc :cope<cr>
map <leader>co ggVGy:tabnew<cr>:set syntax=qf<cr>pgg
map <leader>n :cn<cr>
map <leader>p :cp<cr>
" Allows you to easily replace the current word and all its occurrences.
nnoremap <Leader>rc :%s/\<<C-r><C-w>\>/
vnoremap <Leader>rc y:%s/<C-r>"/
" Allows you to easily change the current word and all occurrences to something
" else. The difference between this and the previous mapping is that the mapping
" below pre-fills the current word for you to change.
" nnoremap <Leader>rc :%s/\<<C-r><C-w>\>/<C-r><C-w>
" vnoremap <Leader>rc y:%s/<C-r>"/<C-r>
"允许backspace和光标跨越行边界
set whichwrap+=<,>,h,l
" set fileencodings = utf-8, gbk
set ambiwidth=double
"自动纠错“
iab szie size
iab slef self
iab prinft printf
iab infreface interface
iab retrun return
iab StdOUnt StdOut
iab StdOunt StdOut
iab incldue include
iab inlcude include
iab destory destroy
" Highlight space errors in C/C++ source files (Vim tip #935)
if $VIM_HATE_SPACE_ERRORS != '0'
let c_space_errors=1
endif
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""
" Backspace to delete 4 space if have
"""""""""""""""""""""""""""'
set softtabstop=2
"""""""""""""""""""
" set statusline to show the decode infomation
" see h statusline
" origin
set statusline=%<%f\ %h%m%r%=%k[%{(&fenc==\"\")?&enc:&fenc}%{(&bomb?\",BOM\":\"\")}]\ %-14.(%l,%c%V%)\ %P
" add tag name
" set statusline=%<%f\ %h%m%r%([%{Tlist_Get_Tagname_By_Line()}]%)%=\ %k[%{(&fenc==\"\")?&enc:&fenc}%{(&bomb?\",BOM\":\"\")}]\ %-14.(%l,%c%V%)\ %P
" show tag name
" set statusline=%<%f%=%([%{Tlist_Get_Tagname_By_Line()}]%)
"""""""""""""""
" help path
" set path+=/home/klc/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0
"""""""""""""set - not a a componment, the original value not include -,
" that i can search i-ma-hello, most in css
autocmd FileType css setlocal iskeyword=@,48-57,_,192-255,-,$
autocmd FileType scss setlocal iskeyword=@,48-57,_,192-255,-,$
autocmd FileType less setlocal iskeyword=@,48-57,_,192-255,-,$
autocmd FileType html setlocal iskeyword=@,48-57,_,192-255,-,$
autocmd FileType slim setlocal iskeyword=@,48-57,_,192-255,-,$
autocmd FileType haml setlocal iskeyword=@,48-57,_,192-255,-,$
autocmd FileType javascript setlocal iskeyword=@,48-57,_,192-255,-,$
autocmd FileType lisp setlocal iskeyword=33,36,38,42,43,45,47-58,60-62,63,64-90,97-122,_
"""""""""""" recongnize new file type
au BufNewFile,BufRead *.less set filetype=less
" setlocal means only to this file
noremap ,ss : setlocal spell!<cr>
noremap ,ig: setlocal ignorecase!<cr>
" also have <c-c> <c-[>, 把capslock 改为ctrl 也可接受。
inoremap jk <ESC>
vnoremap jk <ESC>
snoremap jk <ESC>
"""""" taglist
"key mapping for the taglist.vim plugin
" nnoremap <F8> :Tlist<CR>
" inoremap <F8> <C-O>:Tlist<CR>
" for show tag name in status line
" let Tlist_Process_File_Always = 1
"""""" tagbar
nmap <F8> :TagbarToggle<CR>
inoremap <F8> <C-O>:TagbarToggle<CR>
let g:tagbar_left=1
let g:tagbar_autoclose = 0
let g:tagbar_autofocus = 1
let g:tagbar_compact = 1
let g:tagbar_show_visibility = 1
let g:tagbar_show_linenumbers = 1
let g:tagbar_autoshowtag = 1
let g:tagbar_previewwin_pos = ''
let g:tagbar_autopreview = 0
" NerdTree
nnoremap <F9> :NERDTreeToggle<CR>
inoremap <F9> <C-O>:NERDTreeToggle<CR>
let g:NERDTreeWinSize = 20
",w to save
nnoremap ,w :w<CR>
",e open .vimrc file
nnoremap <leader>rr :source $MYVIMRC<cr>
" When vimrc is edited, reload it
autocmd! bufwritepost vimrc source ~/.vimrc
""""""""""""""""""""
" visual mode copy to the + register
" the + * register is relative to the X's clipboard (only for x11)
""""""""""""""""""""""
vnoremap <C-X> "+y
"pahogen init
execute pathogen#infect()
"""""""""""""""""""""""""""""""
"
" tcomment
"
""""""""""""""""""""""""""""""""
"use ctrl-c to comment and uncomment
map <C-c> gcc<esc>
""""""""""""""""""""""""""
" ctrlp
""""""""""""""""""""""""""
let g:ctrlp_map = ',,'
let g:ctrlp_open_multiple_files = 'v'
set wildignore+=*/tmp/*,*.so,*.swp,*.zip
let g:ctrlp_custom_ignore = {
\ 'dir': '\v[\/]\.(git)|vendor|node_modules|bower_components|deps|_build$',
\ 'file': '\v\.(log|jpg|png|jpeg|tags)$',
\ }
""""""""""""""""""""
""easytags
""""""""""""""""""""""
let g:easytags_async=1
let g:easytags_dynamic_files = 1 "only write to current ./tags
""""""""""""""""""""""""""""""""""""""""
"" auto-save
"""""""""""""""""""""""""""""""""""""""""
let g:auto_save = 1
" set updatetime=1000 "
" let g:auto_save_no_updatetime = 1
let g:auto_save_in_insert_mode = 0 " do not save while in insert mode
" let g:auto_save_postsave_hook = 'UpdateTags'
" now if you have spaces at end of lines, you get notified
set list
" autocmd FileType go setlocal list!
" set listchars=tab:▸\ ,eol:c,trail:+
set listchars=tab:▸\ ,trail:+
autocmd FileType c set list!
" set listchars=trail:+
" slime of lisp
" let g:slime_target = \"tmux"
" let g:slimv_swank_cmd = '! xterm -e sbcl --load ~/.vim/slime/start-swank.lisp &'
"
" let g:slimv_swank_cmd = '!osascript -e \"tell application \"Terminal\" to do script \"sbcl --load ~/.vim/bundle/slimv/slime/start-swank.lisp\""'
" let g:slimv_swank_clojure = '! xterm -e lein swank &'
let g:paredit_mode=0
let g:lisp_rainbow=1
autocmd FileType lisp setlocal iskeyword=33,36,38,42,43,45,47-58,60-62,63,64-90,97-122,_,-
" autocmd FileType ruby setlocal iskeyword=33,36,38,42,43,45,47-58,60-62,63,64-90,97-122,_
"git commit message
autocmd Filetype gitcommit setlocal spell textwidth=72
"go
" let g:go_disable_autoinstall = 1
" autocmd FileType go setlocal expandtab shiftwidth=2 tabstop=2
" let g:go_snippet_engine = "neosnippet"
" let g:NERDTreeDirArrows=0
"markdown
let g:vim_markdown_folding_disabled=1
"added by mac and should add to .vimrc in git rep
cnoremap <C-p> <Up>
cnoremap <C-n> <Down>
" map \ 为 ,, this for 方向查抄功能(用;查找下一个,\则返回上个查找"map
noremap \ ,
noremap <leader>f :quit<CR>
noremap <Space> :
"disable Ctrl-A add count to number, for I always careless press it
noremap <C-A> <Nop>
" ," 加上双引号 vim-surround 用法: ysiw"
nnoremap <leader>" :normal ysiw"<cr>
""""""""complete""""""
" :help 'complete' for detail(have single quote)
" default complete=.,w,b,u,t
" t for tags
" youcompleme and snipmate confit about tab
" not use youcompleme me in rails
" let g:ycm_key_list_select_completion = ['<c-n>', '<Down>']
" let g:ycm_key_list_previous_completion = ['<c-p>', '<Up>']
"
" :h SnipMate-mappings for other
" imap <C-J> <Plug>snipMateNextOrTrigger
" smap <C-J> <Plug>snipMateNextOrTrigger
"
" imap ss <esc>a<Plug>snipMateNextOrTrigger
" smap ss <Plug>snipMateNextOrTrigger
smap <Tab> <Plug>snipMateNextOrTrigger
imap <Tab> <Plug>snipMateNextOrTrigger
" persisiten undo
" if .undo exist then persisiten undo
set undodir=~/.vim/.undo "you may should muany create the .undo directory
set undofile
set undolevels=1000
set undoreload=10000
" save with root permission
" cmap w!! %!sudo tee > /dev/null %
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Helper functions
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
function! CmdLine(str)
exe "menu Foo.Bar :" . a:str
emenu Foo.Bar
unmenu Foo
endfunction
function! VisualSelection(direction, extra_filter) range
let l:saved_reg = @"
execute "normal! vgvy"
let l:pattern = escape(@", '\\/.*$^~[]')
let l:pattern = substitute(l:pattern, "\n$", "", "")
if a:direction == 'b'
execute "normal ?" . l:pattern . "^M"
elseif a:direction == 'gv'
call CmdLine("Ack \"" . l:pattern . "\" " )
elseif a:direction == 'replace'
call CmdLine("%s" . '/'. l:pattern . '/')
elseif a:direction == 'f'
execute "normal /" . l:pattern . "^M"
endif
let @/ = l:pattern
let @" = l:saved_reg
endfunction
" Returns true if paste mode is enabled
function! HasPaste()
if &paste
return 'PASTE MODE '
en
return ''
endfunction
" Don't close window, when deleting a buffer
command! Bclose call <SID>BufcloseCloseIt()
function! <SID>BufcloseCloseIt()
let l:currentBufNum = bufnr("%")
let l:alternateBufNum = bufnr("#")
if buflisted(l:alternateBufNum)
buffer #
else
bnext
endif
if bufnr("%") == l:currentBufNum
new
endif
if buflisted(l:currentBufNum)
execute("bdelete! ".l:currentBufNum)
endif
endfunction
" Exercises
" read source code
" r
" set foldmethod=syntax
"
" set background=dark
" colorscheme solarized
" if executable('ag')
" let g:ackprg = 'ag --vimgrep'
" endif
"solarized
" if has('gui_running')
" set background=light
" else
" set background=dark
" endif
" colorscheme solarized
"""""
"syntastic
"""""
" let g:syntastic_ruby_exec = 'which ruby'
let g:syntastic_always_populate_loc_list = 0
let g:syntastic_auto_loc_list = 0
let g:syntastic_check_on_open = 0
let g:syntastic_check_on_wq = 0
" for rails test
" puts the caller
nnoremap <leader>wtf oputs "#" * 90<c-m>puts caller<c-m>puts "#" * 90<esc>
"""""""
"test
"test-vim
"""""""
let test#strategy = "vimux"
let g:VimuxRunnerType = "window"
let VimuxUseNearest = 1
nmap <silent> <leader>t :TestNearest<CR>
" nmap <silent> <leader>T :TestFile<CR>
" nmap <silent> <leader>a :TestSuite<CR>
" nmap <silent> <leader>l :TestLast<CR>
" nmap <silent> <leader>g :TestVisit<CR>
nnoremap <leader>ta :TestSuite<cr>
nnoremap <leader>tf :TestFile<cr>
nnoremap <leader>tn :TestNearest<cr>
nnoremap <leader>tt :TestLast<cr>
""""""""""""""""""""""""""""""""
" hightlight current line number
""""""""""""""""""""""""""""""""
"hight current line
" hi CursorLine cterm=NONE ctermbg=darkred ctermfg=white guibg=darkred guifg=white
" hi CursorColumn cterm=NONE ctermbg=darkred ctermfg=white guibg=darkred guifg=white
" nnoremap <Leader>l :set cursorline! cursorcolumn!<CR>
nnoremap <Leader>l :set cursorline!<CR>
"Clear the highlighting of CursorLine: just hi clear CursorLine after any :colorscheme and set background= call.
hi clear CursorLine
augroup CLClear
autocmd! ColorScheme * hi clear CursorLine
augroup END
" Set the highlighting of CursorLineNR if it is not set in your colorscheme:
hi CursorLineNR cterm=bold
augroup CLNRSet
autocmd! ColorScheme * hi CursorLineNR cterm=bold
augroup END
set cursorline
" fix meta-keys which generate <Esc>a .. <Esc>z
let c='a'
while c <= 'z'
exec "set <M-".toupper(c).">=\e".c
exec "imap \e".c." <M-".toupper(c).">"
let c = nr2char(1+char2nr(c))
endw
let g:AutoPairsShortcutFastWrap = "Å"
" set different indent level for other languages
autocmd FileType c setlocal shiftwidth=4 tabstop=4
autocmd FileType cpp setlocal shiftwidth=4 tabstop=4
" autocmd FileType go setlocal shiftwidth=4 tabstop=4
" autocmd FileType go setlocal list!
" autocmd FileType go setlocal expandtab!
set runtimepath^=~/.vim/bundle/ag