-
Notifications
You must be signed in to change notification settings - Fork 0
/
myvimrc
175 lines (145 loc) · 4.23 KB
/
myvimrc
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
"plug 插件列表
call plug#begin()
"下载列编辑插件
"Plug 'terryma/vim-multiple-cursors'
"下载c++11语法高亮
Plug 'octol/vim-cpp-enhanced-highlight'
"下载可视化缩进模块
Plug 'nathanaelkane/vim-indent-guides'
"语法补全插件
"Plug 'Valloric/YouCompleteMe'
Plug 'ycm-core/YouCompleteMe'
"由接口快速生成实现文件
"Plug 'derekwyatt/vim-protodef'
" 接口实现补丁的依赖补丁:此补丁可以快速在.h 和 .cpp文件中切换
Plug 'derekwyatt/vim-fswitch'
"plantuml图像插件
"Plug 'scrooloose/vim-slumlord'
Plug 'aklt/plantuml-syntax'
"vim-tmux窗口移动无缝衔接
Plug 'christoomey/vim-tmux-navigator'
"Doxygen自动注释插件
Plug 'vim-scripts/DoxygenToolkit.vim'
"NerdTree
Plug 'scrooloose/nerdtree'
"cht插件
Plug 'dbeniamine/cheat.sh-vim'
"log 语法插件
Plug 'MTDL9/vim-log-highlighting'
"clangformate neoformat
Plug 'sbdchd/neoformat'
"自动生成ycm文件 <c-y>
Plug 'rdnetto/YCM-Generator', { 'branch': 'stable'}
"命令模式自动中止中文输入法 未生效
"Plug 'lilydjwg/fcitx.vim'
"ack 搜索插件
Plug 'mileszs/ack.vim'
"qml 语法高亮插件
"Plug 'crucerucalin/qml.vim'
" javascript语法高亮
Plug 'pangloss/vim-javascript'
" javascript YCM补全插件
Plug 'marijnh/tern_for_vim'
" 自己配置的tab补全,需要写配置文件
Plug 'SirVer/ultisnips'
" 注释
Plug 'scrooloose/nerdcommenter'
call plug#end()
"PlugInstall PlugUpdate PlugClean
"修改vim的leader键
let mapleader = ';'
let maplocalleader = ','
"PlugInstall 安装插件
"PlugInstall [name ...] [#threads] 安装指定插件
"PlugUpdate [name ...] [#threads] 更新插件
"PlugClean[!] 删除未列出的插件
"配置可视化缩进
"IndentGuidesEnable
"IndentGuidesDisable
"IndentGuidesToggle
"随vim自动启动
let g:indent_guides_enable_on_vim_startup=1
" 色块宽度
let g:indent_guides_guide_size=1
" 快捷键 m 开/关缩进可视化
:nmap <silent> <Leader>m <Plug>IndentGuidesToggle
" 缩进色块为黑色
let g:indent_guides_auto_colors = 0
autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd guibg=black ctermbg=237
autocmd VimEnter,Colorscheme * :hi IndentGuidesEven guibg=black ctermbg=237
"接口实现补丁protodef配置
"成员函数实现和声明顺序一致
let g:disable_protodef_sorting=1
"设置pullproto.pl脚本位置
let g:protodefprotogetter='~/.vim/bundle/protodef/pullproto.pl'
"禁用上下左右方向键
noremap <Up> <Nop>
noremap <Down> <Nop>
noremap <Left> <Nop>
noremap <Right> <Nop>
"自动缩进
"set autoindent
"set cindent
"设置根据不同语言,智能缩进
filetype indent on
"统一缩进为4
set softtabstop=4
set shiftwidth=4
"tab=4
set tabstop=4
"space代替table
set expandtab
"语法高亮
syntax on
"代码折叠 za:打开或关闭折叠 zM:关闭所有折叠 zR:打开所有折叠
set foldmethod=syntax
"启动vim时,关闭折叠代码
set nofoldenable
"设置折叠行的高亮颜色
highlight Folded ctermfg=5 ctermbg=0
"光标不闪烁
set gcr=a:block-blinkon0
"将打开NERDTree打开和隐藏设为 leader+n
map <Leader>n :NERDTreeToggle<cr>
"关闭兼容模式
set nocompatible
"开启文件类型侦测
filetype on
"根据文件类型,加载对应插件
filetype plugin on
"高亮显示搜索结果
set hlsearch
"设置ctrl + s 为保存
map <c-s> :w<CR>
" 行列设置
" 属性设置
"显示行号
set number
"高亮当前行(带下划线)
set cursorline
"高亮当前列
"set cursorcolumn
" 行列色彩设置
" cterm: blod(粗体) underline(下划线) reverse(反色) italic(斜体) none
"当前行配色为粗体
hi CursorLine term=bold cterm=bold guibg=Grey40
"当前行号配色
hi CursorLineNr term=bold cterm=italic ctermfg=green guibg=Grey40
"鼠标相关设置
"启用鼠标:
" n(普通模式)、 "v(可视模式)、i(插入模式)、c(命令行模式)
" h(帮助文档里的以上所有模式)
" a 以上所有模式
set mouse=a
set encoding=utf-8
set termencoding=utf-8
set fileencoding=utf-8
set fileencodings=ucs-bom,utf-8,chinese,cp936
source ~/.vim/vimfile/mybase.vim
source ~/.vim/vimfile/vim-tmux-navigator.vim
source ~/.vim/vimfile/DoxygenToolkit.vim
source ~/.vim/vimfile/YouCompleteMe.vim
source ~/.vim/vimfile/neoformat.vim
source ~/.vim/vimfile/YCM-Generator.vim
source ~/.vim/vimfile/vim-javascript.vim
source ~/.vim/vimfile/nerdcommenter.vim