vim 技巧¶
升级vim¶
$ sudo add-apt-repository ppa:jonathonf/vim
$ sudo apt-get update && sudo apt-get upgrade
$ sudo apt-get install vim-nox
INSTALL¶
$ sudo apt-get install vim vim-scripts vim-doc $ sudo apt-get install vim-addon-manager # 插件管理 $ sudo apt-get install vim-gnome # 系统黏贴板支持
YouCompleteMe¶
安装¶
Ubuntu Linxu x64
$ sudo apt-get install build-essential cmake $ sudo apt-get install python-dev python3-dev $ sudo apt-get install golang # 搭建go环境$ git clone --depth 1 --recursive https://github.com/Valloric/YouCompleteMe.git \ $HOME/.vim/bundle/YouCompleteMe $ cd $HOME/.vim/bundle/YouCompleteMe $ git submodule update --init --recursive $ ./install.py --clang-completer # c/c++ $ ./install.py --gocode-completer # go $ ./install.py --all
- Vundle
Plugin 'Valloric/YouCompleteMe'
YouCompleteMe的配置¶
在 $HOME/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py 添加:
flags = [
'-Wall',
...
'-isystem',
'./tests/gmock/include',
'-isystem', # 此行及以下,为添加行,检索 C/C++头文件
'/usr/include',
'-isystem',
'/usr/include/c++/5.4.0',
'-isystem',
'/usr/include',
'/usr/include/x86_64-linux-gnu/c++',
]
vim实用技巧¶
技巧 24 面向列块的可视模式编辑表格数据
技巧 30 在指定范围上执行普通模式命令
normal
技巧51 用精确的文本对象选择区
xml 编写技巧
查看当前文件是什么类型了
:set filetype
- Vim升华之树形目录插件NERDTree安装图解
http://www.linuxidc.com/Linux/2013-06/86048.htm
每天一个vim插件–vim-multiple-cursors (foocoder.com)
Vim常用插件——前端开发工具系列
- vi/vim使用进阶: 开启文件类型检测
http://easwy.com/blog/archives/advanced-vim-skills-filetype-on/
- plugin、autoload、ftplugin有什么区别
http://www.cnblogs.com/chris-cp/p/4581593.html
- filetype—- 文件类型检测
http://liuzhijun.iteye.com/blog/1846123
- 像打永春一样使用vim
- vim 命令汇总
- 一步步将vim改造成C/C++开发环境IDE
- vi/vim使用进阶: 智能补全
- Vim 中使用 OmniComplete 为 C/C++ 自动补全
- vim剪切板
- vim 右键复制
project