gvim/vim配置普通c++/c IDE

应该说vim/gvim+gcc/g++的开发环境已经非常能够满足一般的变成需要,我试了几种不同的IDE,包括Eclipse和Anjuta,用一个JAVA环境的IDE(Eclipse)来改装成c++的,总有点挂羊头卖狗肉的嫌疑,而且eclipse启动非常慢,有时候我是在等不及。而anjuta则不错,有很多的语言支持,语法高亮等等应有尽有,而且配置一点也不麻

烦,但是我们在平时写一个文件的程序的时候动摇这么一个IDE似乎总有点麻烦,况且gvim+g++也能做到,所以我配置了如题的环境。

安装gvim是简单的,只要在终端输入sudo apt-get install gvim 就可以安装上,然后可以在终端输入gvim打开gvim编辑器。

这个时候的编辑器什么也没有,没有语法高亮,自动补齐等等,所以要做一点工作,首先要找到vimrc这个文件:

终端下输入 locate vimrc

我的机器是显示这个文件在/etc/vim中,所以我们要进入到这个文件中,这个时候可能文件的权限是root,为了方便点,我把权限先改成用户的,以我的电脑为例

eric@eric-laptop:cd /etc/vim

eric@eric-laptop:sudo -s

[sudo] password for eric:

root@eric-laptop~vim:#chown eric:eric vimrc

好了,现在我们可以打开vimrc文件了。

以下是我的配置文件:

" All system-wide defaults are set in $VIMRUNTIME/debian.vim (usually just

" /usr/share/vim/vimcurrent/debian.vim) and sourced by the call to :runtime

" you can find below.  If you wish to change any of those settings, you should

" do it in this file (/etc/vim/vimrc), since debian.vim will be overwritten

" everytime an upgrade of the vim packages is performed.  It is recommended to

" make changes after sourcing debian.vim since it alters the value of the

" 'compatible' option.

" This line should not be removed as it ensures that various options are

" properly set to work with the Vim-related packages available in Debian.

runtime! debian.vim

" Uncomment the next line to make Vim more Vi-compatible

" NOTE: debian.vim sets 'nocompatible'.  Setting 'compatible' changes numerous

" options, so any other options should be set AFTER setting 'compatible'.

"set compatible

" Vim5 and later versions support syntax highlighting. Uncommenting the next

" line enables syntax highlighting by default.

"语法高亮syntax on"背景颜色colorscheme blue

" If using a dark background within the editing area and syntax highlighting

" turn on this option as well

set background=dark

" Uncomment the following to have Vim jump to the last position when

" reopening a file

"if has("autocmd")

"  au BufReadPost * if line("'\"") > 0 && line("'\"") set showmatch        " Show matching brackets.

"set ignorecase        " Do case insensitive matching

set smartcase        " Do smart case matching

"set incsearch        " Incremental search

set autowrite        " Automatically save before commands like :next and :make

"set hidden             " Hide buffers when they are abandoned

"set mouse=a        " Enable mouse usage (all modes) in terminals

set autoindent

" Source a global configuration file if available

" XXX Deprecated, please move your changes here in /etc/vim/vimrc

if filereadable("/etc/vim/vimrc.local")

  source /etc/vim/vimrc.local

endif


更多精彩linux视频教程,尽在51CTO学院:
wKioL1PE_n3z629yAACXIHScsJM092.jpg

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值