VIM代码自动完成
2010-11-23 19:32
204 查看
安装插件ctags,omnicppcomplete,修改_vimrc文件:
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
let eq = ''
if $VIMRUNTIME =~ ' '
if &sh =~ '\<cmd'
let cmd = '""' . $VIMRUNTIME . '\diff"'
let eq = '"'
else
let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'
endif
else
let cmd = $VIMRUNTIME . '\diff'
endif
silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq
endfunction
set nocp
filetype plugin on
filetype indent on
set tags+=D:\MinGW\tags\tags;
au BufWritePost *.c,*.cpp,*.cc,*.h !ctags -R --c++-kinds=+p --fields=+iaS --extra=+q
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
let eq = ''
if $VIMRUNTIME =~ ' '
if &sh =~ '\<cmd'
let cmd = '""' . $VIMRUNTIME . '\diff"'
let eq = '"'
else
let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'
endif
else
let cmd = $VIMRUNTIME . '\diff'
endif
silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq
endfunction
set nocp
filetype plugin on
filetype indent on
set tags+=D:\MinGW\tags\tags;
au BufWritePost *.c,*.cpp,*.cc,*.h !ctags -R --c++-kinds=+p --fields=+iaS --extra=+q
相关文章推荐
- Vim 中 Java 代码自动完成 - vim-javacomplete2
- vim中实现php代码自动完成功能
- vim中实现javascript代码自动完成功能
- vim中实现CSS、HTML代码自动完成功能
- VIM自动完成功能
- LiteIDE 的代码自动完成(AutoComplete)
- Notepad++代码自动完成制作方法
- VC6.0下不能自动完成类方法和属性的解决办法(vc6无法使用代码自动完成)
- phpstorm安装laravel-ide-helper实现自动完成、代码提示和跟踪
- VIM代码 格式化与注释 自动对齐
- IntelliJ IDEA 的 20 个代码自动完成的特性
- php 搜索框提示(自动完成)实例代码
- windows下vim和Doxygen自动生成代码文档
- 十分钟打造AutoComplete自动完成效果代码
- ThinkPHP3.1新特性之动态设置自动完成及自动验证示例代码
- 配置phpstorm完美支持Codeigniter(CI)代码自动完成(代码提示)
- jQuery autocomplate 自扩展插件、自动完成示例代码
- C++读写文件代码自动生成器(python3完成)
- vim下php文件中自动缩排html代码
- WinForm 自动完成控件实例代码简析