手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

Vim配置及说明——IDE编程环境

[日期:2014-04-08] 来源:Linux社区  作者:zhongcq [字体:大 中 小]

20、自动括号补全

插件:Raimondi/delimitMate

推荐等级:★★★★☆

vimrc中配置如下:

"自动补全单引号,双引号等
Bundle 'Raimondi/delimitMate'
" for Python docstring ",优化输入
au FileType python let b:delimitMate_nesting_quotes = ['"']

21、代码对齐

插件:godlygeek/tabular

推荐等级:★★★★★

vimrc中配置如下:

"for code alignment
Bundle 'godlygeek/tabular'
" \bb                 按=号对齐代码 [Tabular插件]
nmap <leader>bb :Tab /=<CR>
" \bn                 自定义对齐    [Tabular插件]
nmap <leader>bn :Tab /

22、静态代码分析

插件:scrooloose/syntastic

推荐等级:★★★★☆

syntastic是一款支持多语言的实时语法检查插件。在 syntastic 的作用下,编码中、编译前,所有语法错误都将被抓出来并 呈现给你。

vimrc中配置如下:

" 使用pyflakes,速度比pylint快
Bundle 'scrooloose/syntastic'
let g:syntastic_error_symbol = '✗'	"set error or warning signs
let g:syntastic_warning_symbol = '⚠'
let g:syntastic_check_on_open=1
let g:syntastic_enable_highlighting = 0
"let g:syntastic_python_checker="flake8,pyflakes,pep8,pylint"
let g:syntastic_python_checkers=['pyflakes']
"highlight SyntasticErrorSign guifg=white guibg=black

let g:syntastic_cpp_include_dirs = ['/usr/include/']
let g:syntastic_cpp_remove_include_errors = 1
let g:syntastic_cpp_check_header = 1
let g:syntastic_cpp_compiler = 'clang++'
let g:syntastic_cpp_compiler_options = '-std=c++11 -stdlib=libstdc++'
let g:syntastic_enable_balloons = 1	"whether to show balloons

23、快速跳转到TODO列表

插件:vim-scripts/TaskList.vim

推荐等级:★★★★☆

查看并快速跳转到代码中的TODO列表。重构代码时一般通读,标记修改位置,非常实用

vimrc中配置如下:

Bundle 'vim-scripts/TaskList.vim'
map <leader>td <Plug>TaskList

24、维基百科

插件:vim-scripts/vimwiki

推荐等级:★★★★☆

vim下的维基百科,我的博客就是用vimwiki写的。

vimrc中配置如下:

Bundle 'vim-scripts/vimwiki'
let g:vimwiki_w32_dir_enc     = 'utf-8' " 设置编码
let g:vimwiki_use_mouse       = 1       " 使用鼠标映射
let g:vimwiki_valid_html_tags = 'a,img,b,i,s,u,sub,sup,br,hr,div,del,code,red,center,left,right,h1,h2,h3,h4,h5,h6,pre,script,style'
                                        " 声明可以在wiki里面使用的HTML标签
" 对中文用户来说,我们并不怎么需要驼峰英文成为维基词条
let g:vimwiki_camel_case = 0

let blog = {}
if g:isWIN
    if g:atCompany
        let blog.path          = 'D:/Files/Files/mysite/wiki/'
        let blog.path_html     = 'D:/Files/Files/mysite/html/'
        let blog.template_path = 'D:/Files/Files/mysite/templates/'
        let blog.nested_syntaxes = {'python': 'python', 'c++': 'cpp'}
    else
        let blog.path          = 'D:/Files/mysite/wiki/'
        let blog.path_html     = 'D:/Files/mysite/html/'
        let blog.template_path = 'D:/Files/mysite/templates/'
        let blog.nested_syntaxes = {'python': 'python', 'c++': 'cpp'}
    endif
else
    let blog.path          = '~/mysite/wiki/'
    let blog.path_html     = '~/mysite/html/'
    let blog.template_path = '~/mysite/templates/'
endif
let blog.template_default  = 'site'
let blog.template_ext      = '.html'
let blog.auto_export       = 1

let g:vimwiki_list = [blog]

25、多光标批量操作

插件:terryma/vim-multiple-cursors

推荐等级:★★★☆☆

vimrc中配置如下:

"for mutil cursor
Bundle 'terryma/vim-multiple-cursors'
let g:multi_cursor_use_default_mapping=0
" Default mapping
let g:multi_cursor_next_key='<C-m>'
let g:multi_cursor_prev_key='<C-p>'
let g:multi_cursor_skip_key='<C-x>'
let g:multi_cursor_quit_key='<Esc>'

26、python语法高亮

"python syntax highlight
Bundle 'hdima/python-syntax'
let python_highlight_all = 1

27、其他说明

在我的vimrc中使用了ctags,需要安装

sudo apt-get install ctags

linux
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款