Vim 是一个 Linux 平台上功能非常强大的编辑器,他是早年的 Vi 编辑器的加强版。这个 gVim 是 windows 版的,并且有了标准的 windows 风格的图形界面,所以叫 g(graphical)Vim。我们可以将 gvim 理解为 vim(vi的加强版)图形化版本,其指令和用法都完全相同,所以可以參考 vim 的指令。
Read-Only 的用途:比如用 read-only 打开已经用 vim 打开过的文件,就不会提示让人烦躁的 .swp 文件存在的问题;
比如可以用它来看 TXT 的电子书不会存在误删误改(ctrl+b ctrl+f 很方便).
Vim 配置
在网上直接找到了 spf13,号称 vim 的终极配置。应该是很棒的样子。但是我只开发 C/C++,感觉 spf13 整合的好多。一方面机器资源有限,能感觉到配置 spf13 之后打开 vim 变慢,另一方面,毕竟是 vim 新手,连复制粘贴都尚未熟练掌握的菜鸟,并不能领会到 spf13 有多强大。或许太容易得到的也就不珍惜吧。
set nocompatible " be iMproved, required filetype off " required
" set the runtime path to include Vundle and initialize set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin() " alternatively, pass a path where Vundle should install plugins "call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required Plugin 'VundleVim/Vundle.vim'
" The following are examples of different formats supported. " Keep Plugin commands between vundle#begin/end. " plugin on GitHub repo Bundle 'ervandew/supertab' " YCM 已经集成了 syntastic Bundle 'Valloric/YouCompleteMe' " 引擎 & 代码块描述 Bundle 'SirVer/ultisnips' Bundle 'honza/vim-snippets' " delimitMate 不好用。使用 auto-pairs "Bundle 'Raimondi/delimitMate' Bundle 'jiangmiao/auto-pairs' Bundle 'tpope/vim-surround' "Bundle 'rdnetto/YCM-Generator' "快速注释 Bundle 'scrooloose/nerdcommenter' "文档化注释 Bundle 'vim-scripts/DoxygenToolkit.vim' "目录树 Bundle 'scrooloose/nerdtree' "函数列表 Bundle 'majutsushi/tagbar' "快速查找 Bundle 'kien/ctrlp.vim' "状态栏 Bundle 'vim-airline/vim-airline' " Git 工具 Bundle 'tpope/vim-fugitive' " cpp 语法高亮 Bundle 'octol/vim-cpp-enhanced-highlight' "代码格式化工具 Bundle 'Chiel92/vim-autoformat' " plugin from http://vim-scripts.org/vim/scripts.html Bundle 'EasyGrep' "头文件和源文件快速切换 Bundle 'a.vim' " 自动插入 commets Bundle 'c.vim' " plugin from http://vim-scripts.org/vim/scripts.html " Git plugin not hosted on GitHub " git repos on your local machine (i.e. when working on your own plugin) " The sparkup vim script is in a subdirectory of this repo called vim. " Pass the path to set the runtimepath properly. " Install L9 and avoid a Naming conflict if you've already installed a " different version somewhere else.
" All of your Plugins must be added before the following line call vundle#end() " required filetype plugin indent on " required " To ignore plugin indent changes, instead use: "filetype plugin on " " Brief help " :PluginList - lists configured plugins " :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate " :PluginSearch foo - searches for foo; append `!` to refresh local cache " :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal " " see :h vundle for more details or wiki for FAQ " Put your non-Plugin stuff after this line
let g:ycm_global_ycm_extra_conf = '/home/vimer/.ycm_extra_conf.py' " 允许 vim 加载 .ycm_extra_conf.py 文件,不再提示 let g:ycm_confirm_extra_conf=0
set number syntax on " 映射快捷键。<leader> 前缀键默认是 \ nnoremap <F8> :TagbarToggle<CR> nnoremap <leader>jd :YcmCompleter GoToDefinitionElseDeclaration<CR> nnoremap <Leader>fl :NERDTreeToggle<CR> "设置NERDTree子窗口宽度 let NERDTreeWinSize=23" " Trigger configuration. Do not use <tab> if you use " https://github.com/Valloric/YouCompleteMe. let g:UltiSnipsExpandTrigger="<tab>" let g:UltiSnipsJumpForwardTrigger='<C-b>' let g:UltiSnipsJumpBackwardTrigger='<C-z>' " 解决 Ultisnips 与 YCM 插件的冲突 " First, change the default key-binding of YCM let g:ycm_key_list_select_completion = ['<C-n>', '<Down>'] let g:ycm_key_list_previous_completion = ['<C-p>', '<Up>'] " Then set the default action of SuperTab to triggering <C-n> let g:SuperTabDefaultCompletionType = '<C-n>'
let g:DoxygenToolkit_authorName="nielong <nielong2014@gmail.com>" let g:DoxygenToolkit_briefTag_funcName="yes" let g:doxygen_enhanced_color=1