centos\linux 下十分钟内 用vim 搭建c++ IDE,以centos 7.0为例

来源:互联网 发布:唱歌录音软件 编辑:程序博客网 时间:2024/06/08 06:53

/***********************************************************************************************************************************************************

在win下面习惯用vs的同学到了linux下面是不是有点无从下手啊。不用捉急,搭建完VIM的IDE后你会觉得并不比VS的IDE差。废话不多说,进入主题!

************************************************************************************************************************************************************/

一、准备工作

1、备份用户目录下的.vimrc文件(vim配置文件),安装git(自动去问度)

命令:

cd ~

cp .vimrc .vimrc_bak


2、首选安装pathogen,该插件可以自动管理其他插件,安装方法:

1)创建目录并下载

mkdir -p ~/.vim/autoload ~/.vim/bundle && \
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim

2)在.vimrc后追加以下配置

execute pathogen#infect()
syntax on
filetype plugin indent on


二、开始安装其他插件,接下来咱们就一起看个栗子吧!插件都可以自己去问度娘,最好找github上面的,那样更新很方便

1、NERD_tree

1) 提供展示文件/目录列表的功能,比自带的文件浏览器要好很多

可以在度娘那里找到git地址:https://github.com/scrooloose/nerdtree



2) git clone至 ~/.vim/bundle目录就OK了

cd ~/.vim/bundle

git clone https://github.com/scrooloose/nerdtree.git




3) 现在用打开VIM看看吧

vim 

:NERDTree
如下图,大功造成了。


其他插件也类似上面的方法安装就成


常用插件,供参考:

NERD_tree
提供展示文件/目录列表的功能,比自带的文件浏览器要好很多
https://github.com/jistr/vim-nerdtree-tabs.git


taglist
用来提供单个源代码文件的函数列表之类的功能。
https://github.com/vim-scripts/taglist.vim.git


NERD_commenter
提供快速注释/反注释代码块的功能
https://github.com/scrooloose/nerdcommenter.git


mark.vim
给不同的单词高亮,表明不同的变量时很有用。
https://github.com/dimasg/vim-mark.git


omnicppcomplete
提供C++代码的自动补全功能 (对vim版本有要求)
https://github.com/vim-scripts/OmniCppComplete.git


a.vim
提供快速切换.h和.cpp文件的功能
https://github.com/vim-scripts/a.vim.git


bufexplore
切换已打开的文件
https://github.com/jlanzarotta/bufexplorer.git


        欢迎各位点评、指正  ^!^

欢迎加入QQ群(565993954)讨论c++相关技术。。。


1 0