-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc_basic_options.vim
More file actions
124 lines (106 loc) · 3.54 KB
/
Copy pathvimrc_basic_options.vim
File metadata and controls
124 lines (106 loc) · 3.54 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
" vim:fdm=marker
" color scheme, for peaksea {{{
if !has("gui_running")
set t_Co=256
endif
colorscheme peaksea
" }}}
" YouCompleteMe {{{
" configration for ycm
" YouCompleteMe 功能
" 补全功能在注释中同样有效
let g:ycm_complete_in_comments=1
" 允许 vim 加载 .ycm_extra_conf.py 文件,不再提示
let g:ycm_confirm_extra_conf=0
" 开启 YCM 基于标签引擎
let g:ycm_collect_identifiers_from_tags_files=1
" 补全内容不以分割子窗口形式出现,只显示补全列表
"set completeopt-=preview
" 从第一个键入字符就开始罗列匹配项
let g:ycm_min_num_of_chars_for_completion=1
" 禁止缓存匹配项,每次都重新生成匹配项
let g:ycm_cache_omnifunc=0
" 语法关键字补全
let g:ycm_seed_identifiers_with_syntax=1
" 修改对C函数的补全快捷键,默认是CTRL + space,修改为ALT + ;
let g:ycm_key_invoke_completion = '<M-;>'
" 设置转到定义处的快捷键为ALT + G,这个功能非常赞
nmap <M-g> :YcmCompleter GoToDefinitionElseDeclaration <C-R>=expand("<cword>")<CR><CR>
let g:ycm_filetype_blacklist={'unite': 1}
function! UltiSnipsCallUnite()
Unite -start-insert -immediately -no-empty ultisnips
endfunction
nnoremap <silent> <leader>sn :call UltiSnipsCallUnite()<CR>
inoremap <silent> <S-F11> <ESC>:call UltiSnipsCallUnite()<CR>
"let g:UltiSnipsExpandTrigger="<c-s>"
" }}}
" syntastic options {{{
let g:syntastic_enable_highlighting = 1
let g:syntastic_mode_map = { 'mode': 'passive',
\ 'active_filetypes': ['ruby', 'php'],
\ 'passive_filetypes': ['puppet'] }
nnoremap <leader>chk :SyntasticCheck<CR>
" }}}
" showmarks options {{{
let g:showmarks_enable = 0
let g:showmarks_include = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
let g:showmarks_ignore_type = 'hqm'
" m{mark} setmark; '{mark} jump to mark
" <leader>mt - toggle showmark
" }}}
" options for different color tags {{{
nmap <silent> <Leader>hl <plug>MarkSet
nmap <silent> <c-l><c-l> <plug>MarkSet
vmap <silent> <Leader>hl <plug>MarkSet
nmap <silent> <Leader>hc <plug>MarkClear
nmap <silent> <c-s-l> <plug>MarkClear
vmap <silent> <Leader>hc <plug>MarkClear
nmap <silent> <Leader>hr <plug>MarkRegex
vmap <silent> <Leader>hr <plug>MarkRegex
nmap <silent> <c-l><c-r> <plug>MarkRegex
" }}}
" Tabularize options {{{
nmap <silent> <leader>a= :Tabularize /=<CR>
" }}}
" howmuch options {{{
" The scale of the result
let g:HowMuch_scale = 2
" the engine order for auto-calculation
let g:HowMuch_auto_engines = ['bc', 'vim', 'py']
" }}}
" gundo F2 mapping {{{
noremap <F2> :GundoToggle<CR>
" }}}
" for vim session {{{
let g:session_autoload = 'no'
" periodic in minutes
"let g:session_autosave_periodic = 5
" }}}
" tagbar {{{
"let g:tagbar_autoclose = 1
let g:tagbar_ctags_bin = '$VIM/settings/vimfiles/ctags.exe'
noremap <F3> :Tagbar<CR>
" }}}
"
" unite.vim {{{
" mainly for key bindings
nnoremap <leader>u :<C-u>Unite<CR>
call unite#filters#matcher_default#use(['matcher_fuzzy'])
nnoremap <c-p> :<C-u>Unite -start-insert file_rec/async<CR>
" replace vinegar with unite
nmap - :<C-u>Unite file<CR>
" replace bufexplorer with unite
nmap <silent> <Leader>be :Unite -quick-match buffer<CR>
" replace ack or grep(content search) using unite
nmap <silent> <Leader>ss :<C-u>Unite grep:.<CR>
let g:unite_source_history_yank_enable = 1
nnoremap <leader>y :<C-u>Unite history/yank<CR>
" }}}
"
" unite.vim {{{
let g:vimfiler_as_default_explorer = 1
" !t : open vimifiler explorer
nnoremap <silent> <A-t> <ESC>:VimFilerExplorer<CR>
"nmap - :VimFiler<CR>
" }}}
"