参考链接:https://blog.csdn.net/sjin_1314/article/details/85041335
我的系统为Centos 7 .2
1、安装Vim:
yum install vim
2、安装 Vundle
在github上下载Vundle,保存目录在~/.vim/bundle/vundle路径下,需要自己配置.vimrc及.vimrc.bundles(插件设置)
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
vim ~/.vimrc 添加如下内容:
set syntax=on
set nu
set ts=4
set sw=4
set tags=tags;
set autochdir
set hlsearch
set cc=80
set encoding=utf-8
set expandtab
set autoindent
set foldlevel=99
set foldmethod=indent
if filereadable(expand("~/.vimrc.bundles"))
source ~/.vimrc.bundles
endif
vim ~/.vimrc.bundles添加如下内容
set nocompatible " be iMproved, required
filetype off " required
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'tell-k/vim-autopep8'
Plugin 'jiangmiao/auto-pairs'
Plugin 'nvie/vim-flake8'
Plugin 'tmhedberg/SimpylFold'
Plugin 'jistr/vim-nerdtree-tabs'
Plugin 'scrooloose/nerdtree'
Plugin 'vim-syntastic/syntastic'
Plugin 'vim-scripts/indentpython.vim'
call vundle#end()
filetype plugin indent on
安装脚本
在vim中运行:PluginInstall
或者在命令行直接安装而不打开vim运行vim +PluginInstall +qall
3、vim中文帮助文档
wget https://sourceforge.net/projects/vimcdoc/files/vimcdoc/1.8.0/vimcdoc-1.8.0.tar.gz
解压后执行脚本程序后,打开vim后 :help 会成中文。
4、taglist文件安装(转载),Taglist是vim的一个插件,可以方便地在终端侧边显示出当前程序所有的函数、宏等信息。
1)在官方网站上面下载Taglist文件,直接件在~/.vim/目录中解压缩
plugin/taglist.vim – taglist插件
doc/taglist.txt - taglist帮助文件
2)进入~/.vim/doc目录,在Vim下运行"helptags ."命令。此步骤是将doc下的帮助文档加入到Vim的帮助主题中,这样我们 就可以通过在Vim中运行“help taglist.txt”查看taglist帮助。
3)打开配置文件~/.vimrc,加入以下几行
let Tlist_Show_One_File=1 "不同时显示多个文件的tag,只显示当前文件的
let Tlist_Exit_OnlyWindow=1 "如果taglist窗口是最后一个窗口,则退出vim
let Tlist_Ctags_Cmd="/usr/bin/ctags" "将taglist与ctags关联
4).vimrc中定义了下面的映射,使用<F9>键就可以打开/关闭taglist窗口:
map <silent> <F9> :TlistToggle<cr>
ctrl+ww进入左侧的菜单
5)、安装 ctags
yum install ctags
6)生成tags文件:ctags -R 文件或目录
ctrl+]:跳转到函数定义
ctrl+o:返回
具体很多插件的使用可以参照https://www.cnblogs.com/snowbook/p/5923770.html
来源:CSDN
作者:qq_41572664
链接:https://blog.csdn.net/qq_41572664/article/details/103916224