-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_vimrc
698 lines (614 loc) · 24.2 KB
/
_vimrc
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
698
"基本设置开始--------------------------------------------------------------
scriptencoding utf-8
"----------------- 作者: fedkey
"----------------- 邮箱: [email protected]
" ----------------- 博客: http://yangshengliang.com
"系统依赖
"linux-debian fedora ubuntu
"sudo yum install ctags cscope
"sudo yum install build-essential cmake python-dev #编译YCM自动补全插件依赖
"sudo yum install silversearcher-ag
"软件安装
"python2.7 windows自行安装,linux自带
"java [http://www.java.com]
"npm sudo yum install npm
"clang sudo yum install clang
"cmake sudo yum install cmake
"python-dev sudo yum install python-dev
"gvim sudo yum install vim-gtk
" Ctrl + ] --转到函数定义
" Ctrl + T --返回调用函数
" Tab键 --插入模式下的全功能语法结构补全
" za --打开或关闭当前折叠
" zM --关闭所有折叠
" zR --打开所有折叠
"使用Python语法检测
"sudo pip install pyflakes
"sudo pip install pylint
"sudo pip install pep8
"==========vim技巧==================================================================================
"======= =======
"== | 一:文字周边加特殊符号 ==
"== | 1.文本单词中添加符号,如:wwflwlf/fwfwekfek kfwkeowofeow想在wwflwlf/fwfwekfek前后加一个双引号 ==
"== | 操作,光标定位到wwf处:vt空格 S" 以此类推,可以快速添加其他的符号 ==
"== | 2.进入vim,按两次c-o 即可载入上次关闭vim时编辑的文件 ==
"== | 3.代码重构 ==
"== | 对多个文件进行统一替换 ==
"== | :args *.txt ==
"== | :argdo %s/\(foo([^)]*\))/\1, NULL)/g | update ==
"======= =======
"===================================================================================================
"快捷键定制,双键取自emacs按键方式
"双键示例 nmap模式
" nmap <C-x><C-s> :w!<CR>
" 插入模式
" imap <C-x><C-s> <ESC> :w!<cr>
" 普通,不递归映射模式 ,
" nnoremap ,w :w!<cr>
"保存
nmap <C-x><C-s> :w!<CR>
imap <C-x><C-s> <ESC>:w!<CR>
" 文件另存为
nmap <C-x><C-w> :browse confirm saveas<CR>
imap <C-x><C-w> <ESC>:browse confirm saveas<CR>
" 保存并退出文件
nmap <C-x><C-c> :wqa!<CR>
imap <C-x><C-c> <ESC>:wqa!<CR>
" 不保存退出文件
nmap <C-x><C-q> :qa!<CR>
imap <C-x><C-q> <ESC>:qa!<CR>
" 打开文件
nmap <C-x><C-f> :browse confirm e<CR>
imap <C-x><C-f> <ESC>:browse confirm e<CR>
" 打开文件
nmap <C-x><C-f> :browse confirm e<CR>
imap <C-x><C-f> <ESC>:browse confirm e<CR>
" 建立tag文件
nmap <C-x><C-n> :!ctags -R .<CR>
imap <C-x><C-n> <ESC>:!ctags -R .<CR>
" 插入模式下的快捷按键
map! <M-j> <Down>
map! <M-k> <Up>
map! <M-h> <left>
map! <M-l> <Right>
" 修改 _vimrc 后自动生效
autocmd! bufwritepost _vimrc source %
filetype plugin indent on
"===========《判断是什么样的系统》============================
"选择操作系统(os){{{
function! OSX()
return has('macunix')
endfunction
function! LINUX()
return has('unix') && !has('macunix') && !has('win32unix')
endfunction
function! WINDOWS()
return (has('win16') || has('win32') || has('win64'))
endfunction
"}}}
if WINDOWS()
set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin
set diffexpr=MyDiff()
function MyDiff()
let opt = '-a --binary '
if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
let arg1 = v:fname_in
if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
let arg2 = v:fname_new
if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
let arg3 = v:fname_out
if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
if $VIMRUNTIME =~ ' '
if &sh =~ '\<cmd'
if empty(&shellxquote)
let l:shxq_sav = ''
set shellxquote&
endif
let cmd = '"' . $VIMRUNTIME . '\diff"'
else
let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'
endif
else
let cmd = $VIMRUNTIME . '\diff'
endif
silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3
if exists('l:shxq_sav')
let &shellxquote=l:shxq_sav
endif
endfunction
endif
"视图
set completeopt=menuone "关闭函数preview预览窗口
set completeopt=longest,menu "打开函数preview预览窗口
set previewwindow " 标识预览窗口,开启后 python会报错
filetype plugin indent on
syntax on
"map
let mapleader = "-"
let g:mapleader = "-"
" 快速保存
nmap <leader>w :w!<cr>
"=========================语言与编码===========================
set helplang=cn "中文帮助
set fileencoding=utf-8
set fileencodings=utf-8,ucs-bom,gbk,gb2312,cp936
set ffs=unix,dos,mac "使用UNIX的标准文件类型
set imcmdline
"=================《公共配置》=================================
set nocompatible "不使用vi模式"
set linespace=0 "字符间插入的像素行数目
set nu
set showmode "Show current mode down the bottom
set gcr=a:blinkon0 "Disable cursor blink
if has('mouse')
set mouse=a
endif
if LINUX()
set clipboard=unnamedplus "复制文件
elseif WINDOWS()
set clipboard+=unnamed "共享粘贴板
endif
set showcmd " 输入的命令显示出来
nnoremap <C-F2> :vert diffsplit "比较文件
set autoread " 设置当文件被改动时自动载入
set magic " 设置魔术
set hid
set history=1000
" 快速保存
nmap <leader>w :w!<cr>
" Turn on the WiLd menu
set wildmenu
" Ignore compiled files
set wildignore=*.o,*~,*.pyc
" 打开文件时,按照 viminfo 保存的上次关闭时的光标位置重新设置光标
"au BufReadPost * if line("'\"") > 0|if line("'\"") <= line("$")|exe("norm '\"")|else|exe "norm $"|endif|endif
"================《缩进设置》===================================
set ts=2 "tab 用空格表示,对python编程尤其重要,因为python是以缩进来局限代码块的
set shiftwidth=4 "缩进为4个空格
set autoindent "每行的缩进值与上一行相等
set smartindent
set expandtab "将Tab自动转化成空格 [需要输入真正的Tab键时,使用 Ctrl+V + Tab]
%retab!
set smarttab
set foldmethod=indent "折叠方式是使用语法折叠
set foldlevel=100 "折叠的层次是100,也就是打开所有的折叠
"=================《外观设置》===============================
if WINDOWS()
au GUIEnter * simalt ~x "窗口全屏
set columns=80
elseif LINUX()
autocmd GUIEnter * winsize 167 41
endif
"==============《配色》==============
" Set extra options when running in GUI mode
if has("gui_running")
"set guioptions-=T
"set guioptions-=e
set t_Co=256
set guitablabel=%M\ %t
endif
set cursorline "高亮所在行
"set cursorcolumn "高亮当前列
set guioptions-=T "隐藏工具栏
"set guioptions-=m "隐藏菜单
"打开原生菜单
set wildmenu
set cmdheight=1 "命令行(在状态行下)的高度,默认为1
set showmatch "高亮显示[] {} ()配对
"--------------------高级技巧---------------------------------
"指定文件类型去除行末空格
"autocmd FileType c,cpp,java,php autocmd BufWritePre <buffer> :%s/\s\+$//e
"================《搜索设置》========================================
set incsearch "当输入的时候,跳到你搜索的关键字那去
set hlsearch "高亮被搜索的关键字
set ignorecase "搜索模式里忽略大小写
set smartcase " 如果搜索模式包含大写字符,不使用 'ignorecase' 选项。只有在输入搜索模式并且打开 'ignorecase' 选项时才会使用。
"=================《字体》================================
set guifont=Courier\ 11
" ==============《根据后缀名指定文件类型》================
au BufRead,BufNewFile *.h setlocal ft=c
au BufRead,BufNewFile *.i setlocal ft=c
au BufRead,BufNewFile *.m setlocal ft=objc
au BufRead,BufNewFile *.di setlocal ft=d
au BufRead,BufNewFile *.ss setlocal ft=scheme
au BufRead,BufNewFile *.cl setlocal ft=lisp
au BufRead,BufNewFile *.phpt setlocal ft=php
au BufRead,BufNewFile *.inc setlocal ft=php
au BufRead,BufNewFile *.sql setlocal ft=mysql
au BufRead,BufNewFile *.tpl setlocal ft=smarty
au BufRead,BufNewFile *.txt setlocal ft=txt
au BufRead,BufNewFile *.log setlocal ft=conf
au BufRead,BufNewFile hosts setlocal ft=conf
au BufRead,BufNewFile *.conf setlocal ft=nginx
au BufRead,BufNewFile http*.conf setlocal ft=apache
au BufRead,BufNewFile php-fpm*.conf setlocal ft=dosini
au BufRead,BufNewFile *.ini setlocal ft=dosini
"鼠标样式
set so=7
"------------声音---------------
set vb t_vb= "去除报警音
set noerrorbells
set novisualbell
set tm=500
"====文件============
set clipboard+=unnamed " 共享剪贴板
set showtabline=2 "以标签形式打开文件
autocmd BufNewFile * normal G "新建文件后 自动定位到文件末尾
"关闭临时文件和备份
set nobackup "禁止生成临时文件
set nowb
setlocal noswapfile "不要生成swap文件
set wrap "自动折行
set textwidth=79
set cul "高亮光标所在位置
set ruler " 显示标尺
"==控制退格键======="
set backspace=indent,eol,start
set whichwrap+=<,>,h,l
" 基本设置结束---------------------------------------------------------------
" => "文件类型设置开始
"""""""""""""""""""""""""""""""
au FileType javascript call JavaScriptFold()
au FileType javascript setl fen
au FileType javascript setl nocindent
au FileType javascript imap <c-t> $log();<esc>hi
au FileType javascript imap <c-a> alert();<esc>hi
au FileType javascript inoremap <buffer> $r return
au FileType javascript inoremap <buffer> $f //--- PH<esc>FP2xi
function! JavaScriptFold()
setl foldmethod=syntax
setl foldlevelstart=1
syn region foldBraces start=/{/ end=/}/ transparent fold keepend extend
function! FoldText()
return substitute(getline(v:foldstart), '{.*', '{...}', '')
endfunction
setl foldtext=FoldText()
endfunction
" => CoffeeScript section
"""""""""""""""""""""""""""""""
function! CoffeeScriptFold()
setl foldmethod=indent
setl foldlevelstart=1
endfunction
au FileType coffee call CoffeeScriptFold()
au FileType gitcommit call setpos('.', [0, 1, 1, 0])
"文件类型设置结束--------------------------------------
" 插件开始----------------------------------------------------------
"安装Vundle.vim管理插件,必须先安装git
filetype off
if WINDOWS() "安装:git clone https://github.com/VundleVim/Vundle.vim.git $VIM/vimfiles/bundle/Vundle.vim
set runtimepath+=$VIM/vimfiles/bundle/Vundle.vim/ " 此处规定Vundle.vim的路径
call vundle#begin(expand('$VIM/vimfiles/bundle/')) "插件安装位置
elseif LINUX() "安装:git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
set runtimepath+=~/.vim/bundle/Vundle.vim/ " 此处规定Vundle.vim的路径
call vundle#begin(expand('~/.vim/bundle/')) "插件安装位置
endif
"Plugin start
Plugin 'VundleVim/Vundle.vim' "必须启用
Plugin 'taglist.vim' "Tlist 函数列表
Plugin 'vim-scripts/cscope.vim'
let g:Tlist_Use_Right_Window = 1 "位置右栏
let Tlist_Show_One_File=1
"如果taglist窗口是最后一个窗口,则退出vim"
let Tlist_Exit_OnlyWindow = 1
"显示taglist菜单
let Tlist_Show_Menu=1
"let Tlist_Auto_Open=1 "打开vim时启动
Plugin 'wesleyche/SrcExpl' "窗口文件着色
set tags=tags; " ';' 不能没有
"文件,项目查找,搜索
Plugin 'Shougo/unite.vim' "浏览、查找文件
Plugin 'mileszs/ack.vim'
nnoremap <Leader>a :Ack!<Space>
Plugin 'wincent/command-t'
if LINUX()
Plugin 'rking/ag.vim' "代码搜索,提供上下文搜索
let g:ag_prg="<custom-ag-path-goes-here> --vimgrep"
let g:ag_working_path_mode="r"
endif
Plugin 'ctrlpvim/ctrlp.vim' "ctrl p查找
set wildignore+=*/tmp/*,*.so,*.swp,*.zip " MacOSX/Linux
set wildignore+=*\\tmp\\*,*.swp,*.zip,*.exe " Windows
"界面
Plugin 'junegunn/vim-github-dashboard.git'
Plugin 'myusuf3/numbers.vim'
let g:numbers_exclude = ['tagbar', 'gundo', 'minibufexpl', 'nerdtree']
nnoremap <F8> :NumbersToggle<CR>
nnoremap <F4> :NumbersOnOff<CR>
Plugin 'vim-scripts/bufexplorer.zip'
" ----- man pages, tmux -----------------------------------------------
Plugin 'jez/vim-superman'
Plugin 'christoomey/vim-tmux-navigator'
Plugin 'donnemartin/dev-setup'
Plugin 'bling/vim-bufferline'
Plugin 'corntrace/bufexplorer'
"QuickFix窗口
nmap <F6> :cn<cr> "// 切换到下一个结果
nmap <F7> :cp<cr> "// 切换到上一个结果
Plugin 'scrooloose/nerdtree' "树形目录
let NERDTreeShowHidden=0 "不显示隐藏文件
let g:NERDTreeWinSize=23
"排序"
let NERDTreeSortOrder=['//$','/.cpp$','/.c$', '/.h$', '/.py$', '/.lua$', '*']
"高亮NERDTrre窗口的当前行"
let NERDTreeHighlightCursorline=1
set autochdir
Plugin 'fholgado/minibufexpl.vim'
let g:miniBufExplMapWindowNavVim = 1
let g:miniBufExplMapWindowNavArrows = 1
let g:miniBufExplMapCTabSwitchBufs = 1
let g:miniBufExplModSelTarget = 1
let g:miniBufExplMoreThanOne=0
Plugin 'vim-scripts/winmanager'
"设置winmanager的宽度,默认为25
let g:winManagerWidth = 25
let g:NERDTree_title="[NERDTree]"
let g:winManagerWindowLayout="NERDTree|TagList"
nmap wm :WMToggle<CR>
"这个版本的Winmanager好像有个小bug,你在打开Winmanager界面时,
"会同时打开一个空的文件。这会影响后续使用。
"在~/.vim/plugin目录下的winmanager.vim文件中找到以下函数定义并在第5行下添加第6行的内容:
"
"[plain] view plain copy
"
" function! <SID>ToggleWindowsManager()
" if IsWinManagerVisible()
" call s:CloseWindowsManager()
" else
" call s:StartWindowsManager()
" exe 'q'
" end
" endfunction
"========================================<IDE>========================
Plugin 'kshenoy/vim-signature'
Plugin 'airblade/vim-gitgutter'
Plugin 'vim-scripts/YankRing.vim'
"主题
colorscheme default
set background=light
Plugin 'scrooloose/syntastic' "语法检查
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_php_checkers = ['php', 'phpcs', 'phpmd']
let g:syntastic_python_checkers = ['pylint']
let g:syntastic_tex_checkers = ['lacheck', 'text/language_check']
let g:syntastic_aggregate_errors = 1
let g:syntastic_enable_perl_checker = 1
Plugin 'tpope/vim-repeat'
Plugin 'rhysd/conflict-marker.vim'
Plugin 'tacahiroy/ctrlp-funky'
Plugin 'vim-scripts/sessionman.vim'
Plugin 'Raimondi/delimitMate' "补全括号和引号
Plugin 'majutsushi/tagbar' "tagbar
let g:tagbar_sort = 0 "关闭排序[也就是按标签本身在文件中的位置排序]
let g:tagbar_show_linenumbers = -1 "显示行号
let g:tagbar_width=30
let g:tagbar_left = 1
"代码块
Plugin 'Shougo/neosnippet-snippets'
Plugin 'Shougo/neocomplete.vim' "补全
" Plugin key-mappings.
imap <C-k> <Plug>(neosnippet_expand_or_jump)
smap <C-k> <Plug>(neosnippet_expand_or_jump)
xmap <C-k> <Plug>(neosnippet_expand_target)
" SuperTab like snippets behavior.
"imap <expr><TAB>
" \ pumvisible() ? "\<C-n>" :
" \ neosnippet#expandable_or_jumpable() ?
" \ "\<Plug>(neosnippet_expand_or_jump)" : "\<TAB>"
smap <expr><TAB> neosnippet#expandable_or_jumpable() ?
\ "\<Plug>(neosnippet_expand_or_jump)" : "\<TAB>"
" For conceal markers.
if has('conceal')
set conceallevel=2 concealcursor=niv
endif
let g:neosnippet#enable_snipmate_compatibility = 1
if LINUX()
let g:neosnippet#snippets_directory='~/.vim/bundle/neosnippet-snippets/neosnippets'
elseif WINDOWS()
let g:neosnippet#snippets_directory='$VIM/$VIMFILES/bundle/neosnippet-snippets/neosnippets'
endif
Plugin 'Shougo/neosnippet.vim'
Plugin 'xolox/vim-session' "session
let g:loaded_session = 1
"快速文件切换插件a.vim
Plugin 'vim-scripts/a.vim'
" 撤销
Plugin 'mbbill/undotree' "撤销树
Plugin 'sjl/gundo.vim' "查看撤销树,类似版本控制系统,可恢复到某一阶段
nnoremap <F7> :GundoToggle<CR>
" 开启自动预览 [随着光标在标签上的移动,顶部会出现一个实时的预览窗口]
let g:tagbar_autopreview = 1
"状态栏
Plugin 'vim-airline/vim-airline' "状态栏横条美化
Plugin 'Lokaltog/vim-powerline'
Plugin 'itchyny/lightline.vim'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'edkolev/tmuxline.vim'
Plugin 'powerline/fonts'
Plugin 'easymotion/vim-easymotion'
Plugin 'nathanaelkane/vim-indent-guides'
set laststatus=2 "总是显示状态栏
Plugin 'pbrisbin/vim-mkdir' "新建文件时,自动创建不存在的目录
"编辑
Plugin 'xolox/vim-misc'
Plugin 'terryma/vim-multiple-cursors' "多光标编辑
" 默认设置
let g:multi_cursor_next_key='<C-n>'
let g:multi_cursor_prev_key='<C-p>'
let g:multi_cursor_skip_key='<C-x>'
let g:multi_cursor_quit_key='<Esc>'
"终端 shell
Plugin 'Shougo/vimshell.vim'
"---------------------------------
Plugin 'Yggdroot/indentLine'
let g:indentLine_color_term = 239
let g:indentLine_color_gui = '#3366ff'
let g:indentLine_char = '|'
Plugin 'danro/rename.vim' "重命名插件
Plugin 'jiangmiao/auto-pairs' "自动插入和格式化方括号和圆括号
Plugin 'vim-scripts/matchit.zip' "\ %匹配成对的标签,跳转
"代码块
Plugin 'msanders/snipmate.vim' "spipmate代码片段
"添加环绕
Plugin 'tpope/vim-surround' "快速给词加环绕符号,例如引号
Plugin 'godlygeek/tabular' " Tabular: 自动对齐。
Plugin 'shemerey/vim-project' "项目管理
Plugin 'ervandew/supertab' "按<tab>可实现代码提示
"使用tab可补全,使用supertab不占用<tab>键
let g:SuperTabRetainCompletionType = 2
let g:SuperTabDefaultCompletionType = "<C-X><C-O>"
"快速注释
Plugin 'scrooloose/nerdcommenter'
"go语言
Plugin 'fatih/vim-go'
au FileType go nmap <leader>r <Plug>(go-run)
au FileType go nmap <leader>b <Plug>(go-build)
au FileType go nmap <leader>t <Plug>(go-test)
au FileType go nmap <leader>c <Plug>(go-coverage)
let g:go_highlight_functions = 1
let g:go_highlight_methods = 1
let g:go_highlight_structs = 1
let g:go_highlight_interfaces = 1
let g:go_highlight_operators = 1
let g:go_highlight_build_constraints = 1
let g:go_fmt_fail_silently = 1
let g:go_fmt_command = "goimports"
"go 检查
let g:syntastic_go_checkers = ['golint', 'govet', 'errcheck']
let g:syntastic_mode_map = { 'mode': 'active', 'passive_filetypes': ['go'] }
"==================PHP IDE================
Plugin 'ilei/phpcheck-vim' "php代码检查
" 设置插件自动运行,即写入文件后触发 PHP 代码检查
let g:php_check_autorun = 1
" 设置 <F6> 为代码检查映射键
"noremap <F6> :call CallPhpCheckSyntax()<CR>
"inoremap <F6> <ESC>:call CallPhpCheckSyntax()<CR>
Plugin 'shawncplus/phpcomplete.vim'
Plugin 'm2mdas/phpcomplete-extended'
autocmd FileType php setlocal omnifunc=phpcomplete_extended#CompletePHP
let g:SuperTabDefaultCompletionType = "<c-x><c-o>"
Plugin 'Shougo/vimproc.vim'
"==================python IDE============
"--语法检查
Plugin 'yssource/python.vim'
Plugin 'python_match.vim'
Plugin 'pythoncomplete'
Plugin 'davidhalter/jedi-vim'
"Haskell
Plugin 'travitch/hasksyn'
Plugin 'dag/vim2hs'
Plugin 'Twinside/vim-haskellConceal'
Plugin 'Twinside/vim-haskellFold'
Plugin 'lukerandall/haskellmode-vim'
Plugin 'eagletmt/neco-ghc'
Plugin 'eagletmt/ghcmod-vim'
Plugin 'adinapoli/cumino'
Bundle 'bitc/vim-hdevtools'
"--------------------《web ide》--------------------------------------
Plugin 'mattn/webapi-vim'
Plugin 'gregsexton/MatchTag', {'autoload':{'filetypes':['html','xml']}}
Plugin 'mattn/emmet-vim' "emmet 速写
let g:user_emmet_install_global = 0
autocmd FileType html,css,php EmmetInstall "只在html和css,php中启用
let g:user_zen_mode='a'
let g:user_emmet_expandabbr_key='<C-E>' "更改默认按键
let g:user_emmet_complete_tag=0
let g:user_emmet_next_key='<c-n>'
let g:user_emmet_prev_key='<c-p>'
Plugin 'docunext/closetag.vim' "关闭标签
Plugin 'gruntjs/grunt-contrib-watch' "快速预览,无需要刷新页面
"Plugin 'ap/vim-css-color'
Plugin 'evanmiller/nginx-vim-syntax' "nginx
Plugin 'othree/html5.vim'
let g:html5_rdfa_attributes_complete = 1
let g:html5_microdata_attributes_complete = 1
let g:html5_aria_attributes_complete = 1
"javascript
Plugin 'elzr/vim-json'
Plugin 'groenewege/vim-less'
Plugin 'pangloss/vim-javascript'
let g:javascript_plugin_jsdoc = 1
let g:javascript_plugin_ngdoc = 1
let g:javascript_plugin_flow = 1
set foldmethod=syntax
let g:javascript_conceal_function = "ƒ"
let g:javascript_conceal_null = "ø"
let g:javascript_conceal_this = "@"
let g:javascript_conceal_return = "⇚"
let g:javascript_conceal_undefined = "¿"
let g:javascript_conceal_NaN = "ℕ"
let g:javascript_conceal_prototype = "¶"
let g:javascript_conceal_static = "•"
let g:javascript_conceal_super = "Ω"
let g:javascript_conceal_arrow_function = "⇒"
let g:javascript_conceal_noarg_arrow_function = "🞅"
let g:javascript_conceal_underscore_arrow_function = "🞅"
set conceallevel=1
Plugin 'briancollins/vim-jst'
Plugin 'kchmck/vim-coffee-script'
"html
Plugin 'alvan/vim-closetag'
Plugin 'hail2u/vim-css3-syntax'
"Plugin 'gorodinskiy/vim-coloresque'
Plugin 'tpope/vim-haml'
"编辑写作===============================
Plugin 'plasticboy/vim-markdown'
Plugin 'jceb/vim-orgmode'
Plugin 'xolox/vim-notes'
Plugin 'iamcco/mathjax-support-for-mkdp'
Plugin 'iamcco/markdown-preview.vim'
nmap <silent> <F8> <Plug>MarkdownPreview " 普通模式
imap <silent> <F8> <Plug>MarkdownPreview " 插入模式
nmap <silent> <F9> <Plug>StopMarkdownPreview " 普通模式
imap <silent> <F9> <Plug>StopMarkdownPreview " 插入模式
"gist
Plugin 'mattn/gist-vim'
call vundle#end()
filetype plugin indent on
"插件安装结束
"=============<自定义命令>================
autocmd BufNewFile * normal G
"====F5 一键运行=====
func! RunScript()
if &filetype == 'python'
exec "!python %"
elseif &filetype == 'c'
if LINUX()
exec "w"
exec "!gcc -g % -o %< && ./%<"
elseif WINDOWS() "添加dgb
exec "w"
exec "!gcc %<"
exec "! %<.exe"
endif
elseif &filetype == 'cpp'
if LINUX()
exec "w"
exec "!gcc -g % -o %< && ./%<"
elseif WINDOWS()
exec "!gcc -g % -o %< && %<"
endif
"golang
elseif &filetype == 'go'
if LINUX()
exec "w"
exec "!go build % && ./%<"
elseif WINDOWS()
exec "!go build % && !%<"
endif
endif
endfunc
map <F5> :call RunScript()<CR>
"设置自定义字典
"au FileType * execute 'setlocal dict+=~/.vim/words/'.&filetype.'.txt'
"set complete-=k complete +=k