-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc.bak
117 lines (95 loc) · 3.29 KB
/
.vimrc.bak
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
" 让配置变更立即生效
autocmd BufWritePost $MYVIMRC source $MYVIMRC
"associated .vimrc.bundles
if filereadable(expand("~/.vimrc.bundles"))
source ~/.vimrc.bundles
endif
"2018/7/20修改
let g:jedi#completions_command = "C-n"
set nu
let g:pymode_rope_lookup_project = 0
"config NERDTree
" 在 vim 启动的时候默认开启 NERDTree(autocmd 可以缩写为 au)
" autocmd VimEnter * NERDTree
" 当打开 NERDTree 窗口时,自动显示 Bookmarks
let NERDTreeShowBookmarks=1
nmap <F5> :NERDTreeToggle<cr>
let NERDTreeWinSize=24
syntax enable
"colorscheme
set background=dark
"colorscheme solarized
colorscheme darkblue
set autoindent
"YouCompleteMe
set completeopt=longest,menu "让Vim的补全菜单行为与一般IDE一致
" YCM 补全菜单配色
" 菜单
"highlight Pmenu ctermfg=2 ctermbg=3 guifg=#005f87 guibg=#EEE8D5
" 选中项
highlight PmenuSel ctermfg=2 ctermbg=3 guifg=#AFD700 guibg=#106900
let g:ycm_server_python_interpreter='/usr/bin/python'
let g:ycm_global_ycm_extra_conf='~/.vim/.ycm_extra_conf.py'
" 开启 YCM 标签引擎
let g:ycm_collect_identifiers_from_tags_files=1
" 引入 C++ 标准库tags
set tags+=/data/misc/software/misc./vim/stdcpp.tags
nnoremap <leader>lo :lopen<CR> "open locationlist"
nnoremap <leader>gl :YcmCompleter GoToDeclaration<CR>
nnoremap <leader>gf :YcmCompleter GoToDefinition<CR>
nnoremap <leader>gg :YcmCompleter GoToDefinitionElseDeclaration<CR>
let g:ycm_error_symbol = '>>'
let g:ycm_warning_symbol = '>*'
nmap <F4> :YcmDiags<CR>
nnoremap <F6> :YcmForceCompileAndDiagnostics<CR>
"设置全局配置文件的路径
"开启基于tag的补全,可以在这之后添加需要的标签路径
let g:ycm_collect_identifiers_from_tags_files = 1
"开启语义补全
let g:ycm_seed_identifiers_with_syntax = 1
""在接受补全后不分裂出一个窗口显示接受的项
set completeopt-=preview
"不显示开启vim时检查ycm_extra_conf文件的信息
"let g:ycm_confirm_extra_conf=0
""每次重新生成匹配项,禁止缓存匹配项
let g:ycm_cache_omnifunc=0
"在注释中也可以补全
let g:ycm_complete_in_comments=1
""输入第一个字符就开始补全
let g:ycm_min_num_of_chars_for_completion=1
"不查询ultisnips提供的代码模板补全,如果需要,设置成1即可
"let g:ycm_use_ultisnips_completer=0
"使用ctags生成的tags文件
let g:ycm_collect_identifiers_from_tag_files = 1
"PowerLine
let g:Powerline_colorscheme='solarized256'
let g:PowerLine_symbols='fancy'
" 高亮显示
set cursorline
"set cursorcolumn
set ruler
set hlsearch
" 自适应不同语言的智能缩进
filetype indent on
" 将制表符扩展为空格
" set expandtab
" 设置编辑时制表符占用空格数
" set tabstop=4
" 设置格式化时制表符占用空格数
" set shiftwidth=4
" 让 vim 把连续数量的空格视为一个制表符
" set softtabstop=4
" CTags
autocmd VimEnter * Tagbar
" 设置 tagbar 子窗口的位置出现在主编辑区的左边
let tagbar_right=1
" 设置显示/隐藏标签列表子窗口的快捷键。速记:identifier list by tag
nmap <F8> :TagbarToggle<CR>
" 设置标签子窗口的宽度
let tagbar_width=24
" tagbar 子窗口中不显示冗余帮助信息
let g:tagbar_compact=1
" 禁止光标闪烁
set gcr=a:block-blinkon0
" 设置 gvim 显示字体
"set guifont=YaHei\ Consolas\ Hybrid\ 11.5