VIM 经典配置

前端之家收集整理的这篇文章主要介绍了VIM 经典配置前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

VIM 经典配置

  1. " =============================================================================
  2. " << 判断操作系统是 Windows 还是 Linux 和判断是终端还是 Gvim >>
  3. " =============================================================================
  4.  
  5.  
  6. " -----------------------------------------------------------------------------
  7. " < 判断操作系统是否是 Windows 还是 Linux >
  8. " -----------------------------------------------------------------------------
  9. let g:iswindows = 0
  10. let g:islinux = 0
  11. if(has("win32") || has("win64") || has("win95") || has("win16"))
  12. let g:iswindows = 1
  13. else
  14. let g:islinux = 1
  15. endif
  16.  
  17.  
  18. " -----------------------------------------------------------------------------
  19. " < 判断是终端还是 Gvim >
  20. " -----------------------------------------------------------------------------
  21. if has("gui_running")
  22. let g:isGUI = 1
  23. else
  24. let g:isGUI = 0
  25. endif
  26.  
  27.  
  28. " =============================================================================
  29. " << 以下为软件默认配置 >>
  30. " =============================================================================
  31.  
  32.  
  33. " -----------------------------------------------------------------------------
  34. " < Windows Gvim 默认配置> 做了一点修改
  35. " -----------------------------------------------------------------------------
  36. if (g:iswindows && g:isGUI)
  37. source $VIMRUNTIME/vimrc_example.vim
  38. source $VIMRUNTIME/mswin.vim
  39. behave mswin
  40. set diffexpr=MyDiff()
  41. function MyDiff()
  42. let opt = '-a --binary '
  43. if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
  44. if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
  45. let arg1 = v:fname_in
  46. if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
  47. let arg2 = v:fname_new
  48. if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
  49. let arg3 = v:fname_out
  50. if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
  51. let eq = ''
  52. if $VIMRUNTIME =~ ' '
  53. if &sh =~ '\<cmd'
  54. let cmd = '""' . $VIMRUNTIME . '\diff"'
  55. let eq = '"'
  56. else
  57. let cmd = substitute($VIMRUNTIME,' ','" ','') . '\diff"'
  58. endif
  59. else
  60. let cmd = $VIMRUNTIME . '\diff'
  61. endif
  62. silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq
  63. endfunction
  64. endif
  65.  
  66.  
  67. " -----------------------------------------------------------------------------
  68. " < Linux Gvim/Vim 默认配置> 做了一点修改
  69. " -----------------------------------------------------------------------------
  70. if g:islinux
  71. set nocompatible
  72. set hlsearch "高亮搜索
  73. set incsearch "在输入要搜索文字时,实时匹配
  74.  
  75.  
  76. " Uncomment the following to have Vim jump to the last position when
  77. " reopening a file
  78. if has("autocmd")
  79. au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
  80. endif
  81.  
  82.  
  83. if g:isGUI
  84. " Source a global configuration file if available
  85. if filereadable("/etc/vim/gvimrc.local")
  86. source /etc/vim/gvimrc.local
  87. endif
  88. else
  89. " This line should not be removed as it ensures that varIoUs options are
  90. " properly set to work with the Vim-related packages available in Debian.
  91. runtime! debian.vim
  92.  
  93.  
  94. " Vim5 and later versions support Syntax highlighting. Uncommenting the next
  95. " line enables Syntax highlighting by default.
  96. if has("Syntax")
  97. Syntax on
  98. endif
  99.  
  100.  
  101. set mouse=a " 在任何模式下启用鼠标
  102. set t_Co=256 " 在终端启用256色
  103. set backspace=2 " 设置退格键可用
  104.  
  105.  
  106. " Source a global configuration file if available
  107. if filereadable("/etc/vim/vimrc.local")
  108. source /etc/vim/vimrc.local
  109. endif
  110. endif
  111. endif
  112.  
  113.  
  114. " -----------------------------------------------------------------------------
  115. " < 编码配置 >
  116. " -----------------------------------------------------------------------------
  117. " 注:使用utf-8格式后,软件与程序源码、文件路径不能有中文,否则报错
  118. set encoding=utf-8 "设置gvim内部编码
  119. set fileencoding=utf-8 "设置当前文件编码
  120. set fileencodings=ucs-bom,utf-8,gbk,cp936,latin-1 "设置支持打开的文件的编码
  121.  
  122.  
  123. " 文件格式,默认 ffs=dos,unix
  124. if(g:iswindows)
  125. set fencs=gbk
  126. set fileformat=dos "设置新文件的<EOL>格式
  127. set fileformats=dos,unix,mac "给出文件的<EOL>格式类型
  128. else
  129. set fileformat=unix "设置新文件的<EOL>格式
  130. set fileformats=unix,dos,mac "给出文件的<EOL>格式类型
  131. endif
  132.  
  133.  
  134. if (g:iswindows && g:isGUI)
  135. "解决菜单乱码
  136. source $VIMRUNTIME/delmenu.vim
  137. source $VIMRUNTIME/menu.vim
  138.  
  139.  
  140. "解决consle输出乱码
  141. language messages zh_CN.utf-8
  142. endif
  143.  
  144.  
  145. " -----------------------------------------------------------------------------
  146. " < 界面配置 >
  147. " -----------------------------------------------------------------------------
  148. set nobackup
  149. set ai
  150. set ci
  151. set ts=4
  152. set sw=4
  153. set expandtab
  154. filetype plugin indent on
  155. set ruler "显示标尺
  156. set number "显示行号
  157. set laststatus=2 "启用状态栏信息
  158. set cmdheight=2 "设置命令行的高度为2,默认为1
  159. set cursorline "突出显示当前行
  160. " set guifont=YaHei_Consolas_Hybrid:h10 "设置字体:字号(字体名称空格用下划线代替)
  161. set nowrap "设置不自动换行
  162. set shortmess=atI "去掉欢迎界面
  163.  
  164.  
  165. " 设置 gVim 窗口初始位置及大小
  166. if g:isGUI
  167. "au GUIEnter * simalt ~x "窗口启动时自动最大化
  168. winpos 450 300 "指定窗口出现的位置,坐标原点在屏幕左上角
  169. set lines=28 columns=120 "指定窗口大小,lines为高度,columns为宽度
  170. endif
  171.  
  172.  
  173. " 设置代码配色方案
  174. if g:isGUI
  175. colorscheme evening "Gvim配色方案
  176. else
  177. colorscheme Tomorrow-Night-Eighties "终端配色方案
  178. endif
  179.  
  180.  
  181. " 显示/隐藏菜单栏、工具栏、滚动条,可用 Ctrl + F11 切换
  182. if g:isGUI
  183. set guioptions-=m
  184. set guioptions-=T
  185. set guioptions-=r
  186. set guioptions-=L
  187. map <silent> <c-F11> :if &guioptions =~# 'm' <Bar>
  188. \set guioptions-=m <Bar>
  189. \set guioptions-=T <Bar>
  190. \set guioptions-=r <Bar>
  191. \set guioptions-=L <Bar>
  192. \else <Bar>
  193. \set guioptions+=m <Bar>
  194. \set guioptions+=T <Bar>
  195. \set guioptions+=r <Bar>
  196. \set guioptions+=L <Bar>
  197. \endif<CR>
  198. endif
  199.  
  200.  
  201. " -----------------------------------------------------------------------------
  202. " < 编写文件时的配置 >
  203. " -----------------------------------------------------------------------------
  204. filetype on "启用文件类型侦测
  205. filetype plugin on "针对不同的文件类型加载对应的插件
  206. filetype plugin indent on "启用缩进
  207. set smartindent "启用智能对齐方式
  208. set expandtab "Tab键转换为空格
  209. set tabstop=4 "设置Tab键的宽度
  210. set shiftwidth=4 "换行时自动缩进4个空格
  211. set smarttab "指定按一次backspace就删除shiftwidth宽度的空格
  212. "set foldenable "启用折叠
  213. "set foldmethod=indent "indent 折叠方式
  214. "set foldmethod=marker "marker 折叠方式
  215.  
  216. imap <F7> <C-R>=strftime("%Y_%m_%d-%H:%M")<CR>
  217. " 用空格键来开关折叠
  218. nnoremap <space> @=((foldclosed(line('.')) < 0) ? 'zc' : 'zo')<CR>
  219. " 插入空行
  220. nnoremap tt o<esc>
  221. nnoremap TT O<esc>
  222.  
  223.  
  224. " 文件在外部被修改自动更新该文件
  225. set autoread
  226.  
  227.  
  228. " 常规模式下输入 cS 清除行尾空格
  229. nmap cS :%s/\s\+$//g<CR>:noh<CR>
  230.  
  231.  
  232. " 常规模式下输入 cM 清除行尾 ^M 符号
  233. nmap cM :%s/\r$//g<CR>:noh<CR>
  234.  
  235.  
  236. set ignorecase "搜索模式里忽略大小写
  237. set smartcase "如果搜索模式包含大写字符,不使用 'ignorecase' 选项,只有在输入搜索模式并且打开 'ignorecase' 选项时才会使用
  238. " set noincsearch "在输入要搜索文字时,取消实时匹配
  239.  
  240.  
  241. " Ctrl + I 替换ESC键进入normal模式
  242. imap <C-I> <Esc>
  243.  
  244. " Ctrl + K 插入模式下光标向上移动
  245. imap <c-k> <Up>
  246.  
  247.  
  248. " Ctrl + J 插入模式下光标向下移动
  249. imap <c-j> <Down>
  250.  
  251.  
  252. " Ctrl + H 插入模式下光标向左移动
  253. imap <c-h> <Left>
  254.  
  255.  
  256. " Ctrl + L 插入模式下光标向右移动
  257. imap <c-l> <Right>
  258.  
  259.  
  260. " 启用每行超过80列的字符提示(字体变蓝并加下划线)
  261. au BufWinEnter * let w:m2=matchadd('Underlined','\%>' . 80 . 'v.\+',-1)
  262.  
  263.  
  264. " 分屏窗口光标移动
  265. nmap <C-h> <C-w>h
  266. nmap <C-l> <C-w>l
  267. nmap <C-k> <C-w>k
  268. nmap <C-j> <C-w>j
  269.  
  270.  
  271. " 定义快捷键的前缀,即<Leader>
  272. let mapleader=";"
  273. " -----------------------------------------------------------------------------
  274. " < 编程配置 >
  275. " -----------------------------------------------------------------------------
  276. """""文件标题""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  277. "新建.c,.h,.sh,.java文件自动插入文件
  278. autocmd BufNewFile *.cpp,*.[ch],*.sh,*.java exec ":call SetTitle()"
  279. ""定义函数SetTitle,自动插入文件
  280. func SetTitle()
  281. "如果文件类型为.sh文件
  282. if &filetype == 'sh'
  283. call setline(1,"\#########################################################################")
  284. call append(line("."),"\# File Name: ".expand("%"))
  285. call append(line(".")+1,"\# Author: ma6174")
  286. call append(line(".")+2,"\# mail: ma6174@163.com")
  287. call append(line(".")+3,"\# Created Time: ".strftime("%c"))
  288. call append(line(".")+4,"\#########################################################################")
  289. call append(line(".")+5,"\#!/bin/bash")
  290. call append(line(".")+6,"")
  291. else
  292. call setline(1,"/*************************************************************************")
  293. call append(line(".")," > File Name: ".expand("%"))
  294. call append(line(".")+1," > Author: ma6174")
  295. call append(line(".")+2," > Mail: ma6174@163.com ")
  296. call append(line(".")+3," > Created Time: ".strftime("%c"))
  297. call append(line(".")+4," ************************************************************************/")
  298. call append(line(".")+5,"")
  299. endif
  300. if &filetype == 'cpp'
  301. call append(line(".")+6,"#include<iostream>")
  302. call append(line(".")+7,"using namespace std;")
  303. call append(line(".")+8,"")
  304. endif
  305. if &filetype == 'c'
  306. call append(line(".")+6,"#include<stdio.h>")
  307. call append(line(".")+7,"")
  308. endif
  309. "新建文件后,自动定位到文件末尾
  310. autocmd BufNewFile * normal G
  311. endfunc
  312. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  313. " ---------{<([符号自动补全--------------------------------------------------------------------
  314. :inoremap < <><ESC>i
  315. :inoremap > <c-r>=ClosePair('>')<CR>
  316. :inoremap ( ()<ESC>i
  317. :inoremap ) <c-r>=ClosePair(')')<CR>
  318. :inoremap { {<CR>}<ESC>O
  319. :inoremap } <c-r>=ClosePair('}')<CR>
  320. :inoremap [ []<ESC>i
  321. :inoremap ] <c-r>=ClosePair(']')<CR>
  322. :inoremap " ""<ESC>i
  323. :inoremap ' ''<ESC>i
  324. function! ClosePair(char)
  325. if getline('.')[col('.') - 1] == a:char
  326. return "\<Right>"
  327. else
  328. return a:char
  329. endif
  330. endfunction
  331. filetype plugin indent on
  332.  
  333.  
  334. "打开文件类型检测,加了这句才可以用智能补全
  335. set completeopt=longest,menu
  336.  
  337. set wrap
  338. map j gj
  339. map k gk
  340. " -----------------------------------------------------------------------------
  341. " < 编译、连接、运行配置 >
  342. "------------------------------------------------------------------------------
  343. " F9 一键保存、编译、连接存并运行
  344. map <F9> :call Run()<CR>
  345. imap <F9> <ESC>:call Run()<CR>
  346.  
  347.  
  348. " Ctrl + F9 一键保存并编译
  349. map <c-F9> :call Compile()<CR>
  350. imap <c-F9> <ESC>:call Compile()<CR>
  351.  
  352.  
  353. " Ctrl + F10 一键保存并连接
  354. map <c-F10> :call Link()<CR>
  355. imap <c-F10> <ESC>:call Link()<CR>
  356.  
  357.  
  358. let s:LastShellReturn_C = 0
  359. let s:LastShellReturn_L = 0
  360. let s:ShowWarning = 1
  361. let s:Obj_Extension = '.o'
  362. let s:Exe_Extension = '.exe'
  363. let s:Sou_Error = 0
  364.  
  365.  
  366. let s:windows_CFlags = 'gcc\ -fexec-charset=gbk\ -Wall\ -g\ -O0\ -c\ %\ -o\ %<.o'
  367. let s:linux_CFlags = 'gcc\ -Wall\ -g\ -O0\ -c\ %\ -o\ %<.o'
  368.  
  369.  
  370. let s:windows_CPPFlags = 'g++\ -fexec-charset=gbk\ -Wall\ -g\ -O0\ -c\ %\ -o\ %<.o'
  371. let s:linux_CPPFlags = 'g++\ -Wall\ -g\ -O0\ -c\ %\ -o\ %<.o'
  372.  
  373.  
  374. func! Compile()
  375. exe ":ccl"
  376. exe ":update"
  377. if expand("%:e") == "c" || expand("%:e") == "cpp" || expand("%:e") == "cxx"
  378. let s:Sou_Error = 0
  379. let s:LastShellReturn_C = 0
  380. let Sou = expand("%:p")
  381. let Obj = expand("%:p:r").s:Obj_Extension
  382. let Obj_Name = expand("%:p:t:r").s:Obj_Extension
  383. let v:statusmsg = ''
  384. if !filereadable(Obj) || (filereadable(Obj) && (getftime(Obj) < getftime(Sou)))
  385. redraw!
  386. if expand("%:e") == "c"
  387. if g:iswindows
  388. exe ":setlocal makeprg=".s:windows_CFlags
  389. else
  390. exe ":setlocal makeprg=".s:linux_CFlags
  391. endif
  392. echohl WarningMsg | echo " compiling..."
  393. silent make
  394. elseif expand("%:e") == "cpp" || expand("%:e") == "cxx"
  395. if g:iswindows
  396. exe ":setlocal makeprg=".s:windows_CPPFlags
  397. else
  398. exe ":setlocal makeprg=".s:linux_CPPFlags
  399. endif
  400. echohl WarningMsg | echo " compiling..."
  401. silent make
  402. endif
  403. redraw!
  404. if v:shell_error != 0
  405. let s:LastShellReturn_C = v:shell_error
  406. endif
  407. if g:iswindows
  408. if s:LastShellReturn_C != 0
  409. exe ":bo cope"
  410. echohl WarningMsg | echo " compilation Failed"
  411. else
  412. if s:ShowWarning
  413. exe ":bo cw"
  414. endif
  415. echohl WarningMsg | echo " compilation successful"
  416. endif
  417. else
  418. if empty(v:statusmsg)
  419. echohl WarningMsg | echo " compilation successful"
  420. else
  421. exe ":bo cope"
  422. endif
  423. endif
  424. else
  425. echohl WarningMsg | echo ""Obj_Name"is up to date"
  426. endif
  427. else
  428. let s:Sou_Error = 1
  429. echohl WarningMsg | echo " please choose the correct source file"
  430. endif
  431. exe ":setlocal makeprg=make"
  432. endfunc
  433.  
  434.  
  435. func! Link()
  436. call Compile()
  437. if s:Sou_Error || s:LastShellReturn_C != 0
  438. return
  439. endif
  440. let s:LastShellReturn_L = 0
  441. let Sou = expand("%:p")
  442. let Obj = expand("%:p:r").s:Obj_Extension
  443. if g:iswindows
  444. let Exe = expand("%:p:r").s:Exe_Extension
  445. let Exe_Name = expand("%:p:t:r").s:Exe_Extension
  446. else
  447. let Exe = expand("%:p:r")
  448. let Exe_Name = expand("%:p:t:r")
  449. endif
  450. let v:statusmsg = ''
  451. if filereadable(Obj) && (getftime(Obj) >= getftime(Sou))
  452. redraw!
  453. if !executable(Exe) || (executable(Exe) && getftime(Exe) < getftime(Obj))
  454. if expand("%:e") == "c"
  455. setlocal makeprg=gcc\ -o\ %<\ %<.o
  456. echohl WarningMsg | echo " linking..."
  457. silent make
  458. elseif expand("%:e") == "cpp" || expand("%:e") == "cxx"
  459. setlocal makeprg=g++\ -o\ %<\ %<.o
  460. echohl WarningMsg | echo " linking..."
  461. silent make
  462. endif
  463. redraw!
  464. if v:shell_error != 0
  465. let s:LastShellReturn_L = v:shell_error
  466. endif
  467. if g:iswindows
  468. if s:LastShellReturn_L != 0
  469. exe ":bo cope"
  470. echohl WarningMsg | echo " linking Failed"
  471. else
  472. if s:ShowWarning
  473. exe ":bo cw"
  474. endif
  475. echohl WarningMsg | echo " linking successful"
  476. endif
  477. else
  478. if empty(v:statusmsg)
  479. echohl WarningMsg | echo " linking successful"
  480. else
  481. exe ":bo cope"
  482. endif
  483. endif
  484. else
  485. echohl WarningMsg | echo ""Exe_Name"is up to date"
  486. endif
  487. endif
  488. setlocal makeprg=make
  489. endfunc
  490.  
  491.  
  492. func! Run()
  493. let s:ShowWarning = 0
  494. call Link()
  495. let s:ShowWarning = 1
  496. if s:Sou_Error || s:LastShellReturn_C != 0 || s:LastShellReturn_L != 0
  497. return
  498. endif
  499. let Sou = expand("%:p")
  500. let Obj = expand("%:p:r").s:Obj_Extension
  501. if g:iswindows
  502. let Exe = expand("%:p:r").s:Exe_Extension
  503. else
  504. let Exe = expand("%:p:r")
  505. endif
  506. if executable(Exe) && getftime(Exe) >= getftime(Obj) && getftime(Obj) >= getftime(Sou)
  507. redraw!
  508. echohl WarningMsg | echo " running..."
  509. if g:iswindows
  510. exe ":!%<.exe"
  511. else
  512. if g:isGUI
  513. exe ":!gnome-terminal -e ./%<"
  514. else
  515. exe ":!./%<"
  516. endif
  517. endif
  518. redraw!
  519. echohl WarningMsg | echo " running finish"
  520. endif
  521. endfunc
  522.  
  523. " -----------------------------------------------------------------------------
  524. " < txtbrowser 插件配置 >
  525. " 用于文本文件生成标签与与语法高亮(调用TagList插件生成标签,如果可以)
  526. " -----------------------------------------------------------------------------
  527. "au BufRead,BufNewFile *.vm,*.txt setlocal ft=txt
  528.  
  529. " -----------------------------------------------------------------------------
  530. " <grep插件配置 >
  531. " 在工程中快速查找
  532. " -----------------------------------------------------------------------------
  533. "nnoremap <silent> <F3> :Grep<CR>
  534.  
  535. " -----------------------------------------------------------------------------
  536. " < TagList 插件配置 >
  537. " 高效地浏览源码,其功能就像vc中的workpace
  538. " 那里面列出了当前文件中的所有宏,全局变量,函数名等
  539. " 常规模式下输入 tl 调用插件,如果有打开 Tagbar 窗口则先将其关闭
  540. " -----------------------------------------------------------------------------
  541. " nmap tl :Tlist<CR>
  542. " let Tlist_Show_One_File=1 "显示当前文件的tags
  543. " let Tlist_Enable_Fold_Column=0 "使taglist插件不显示左边的折叠行
  544. " let Tlist_Exit_OnlyWindow=1 "如果Taglist窗口是最后一个窗口则退出Vim
  545. " let Tlist_File_Fold_Auto_Close=1 "自动折叠
  546. " let Tlist_WinWidth=30 "设置窗口宽度
  547. " let Tlist_Use_Right_Window=1 "在右侧窗口中显示
  548.  
  549. " -----------------------------------------------------------------------------
  550. " < NERDTree 插件配置 >
  551. " 有目录村结构的文件浏览插件
  552. " 常规模式下输入 F2 调用插件
  553. " -----------------------------------------------------------------------------
  554. let NERDTreeWinPos = "left" " where NERD tree window is placed on the screen
  555. let NERDTreeWinSize = 25 " size of the NERD tree
  556. nmap <F2> :NERDTreeToggle<CR>
  557. au VimEnter * NERDTree | wincmd l
  558. au WinEnter * call s:CloseIfOnlyNerdTreeLeft()
  559.  
  560. " Close all open buffers on entering a window if the only
  561. " buffer that's left is the NERDTree buffer
  562. function! s:CloseIfOnlyNerdTreeLeft()
  563. if exists("t:NERDTreeBufName")
  564. if bufwinnr(t:NERDTreeBufName) != -1
  565. if winnr("$") == 1
  566. q
  567. endif
  568. endif
  569. endif
  570. endfunction
  571.  
  572. " -----------------------------------------------------------------------------
  573. " < ctags 插件配置 >
  574. " -----------------------------------------------------------------------------
  575. set tags=tags;
  576. set autochdir
  577.  
  578. " -----------------------------------------------------------------------------
  579. " < PowerLine 状态栏增强展示插件配置 >
  580. " -----------------------------------------------------------------------------
  581. "vim有一个状态栏 加上powline则有两个状态栏
  582. set laststatus=2
  583. set t_Co=256
  584. let g:Powline_symbols='fancy'
  585.  
  586. " -----------------------------------------------------------------------------
  587. " < tagbar 状态栏增强展示插件配置 >
  588. " -----------------------------------------------------------------------------
  589. "nmap <Leader>tb :TagbarToggle<CR> "快捷键设置
  590. let g:tagbar_ctags_bin='ctags' "ctags程序的路径
  591. let g:tagbar_width=30 "窗口宽度的设置
  592. nmap tl :Tagbar<CR>
  593.  
  594. " -----------------------------------------------------------------------------
  595. " < minibufexpl.vim 状态栏增强展示插件配置 >
  596. " -----------------------------------------------------------------------------
  597. let g:miniBufExplMapWindowNavVim = 1
  598. let g:miniBufExplMapWindowNavArrows = 1
  599. let g:miniBufExplMapCTabSwitchBufs = 1
  600. let g:miniBufExplModSelTarget = 1
  601. let g:miniBufExplMoreThanOne=0
  602.  
  603. map <F11> :MBEbp<CR>
  604. map <F12> :MBEbn<CR>
  605.  
  606. " -----------------------------------------------------------------------------
  607. " < Mark--Karkat(也就是 Mark 插件配置 >
  608. " 给不同的单词高亮,表明不同的变量时很有用,详细帮助见 :h mark.txt
  609. " -----------------------------------------------------------------------------
  610. set viminfo+=! " 保存全局变量
  611. let g:mwAutoSaveMarks = 1
  612. let g:mwAutoLoadMarks = 1
  613. nmap <F3> \*
  614.  
  615. " -----------------------------------------------------------------------------
  616. " < a.vim 插件配置 >
  617. " -----------------------------------------------------------------------------
  618. nnoremap <silent> <F12> :A<CR>

猜你在找的Bash相关文章