Ubuntu14.04 下将vim设置为IDE模式

本文档介绍了如何在Ubuntu14.04上将Vim配置成IDE模式,包括启用语法高亮、设置配色方案、自动加载文件类型相关的插件和缩进规则、开启匹配括号显示、显示行号、以及设置快捷键以增强编辑体验。通过这些设置,Vim将变得更加适合用于开发工作。
摘要由CSDN通过智能技术生成
操作系统:Ubuntu Desktop 14.04

参考: 一步步将vim改造成C/C++开发环境(IDE)
原文地址http://blog168.chinaunix.net/space.php?uid=23089249&do=blog&id=2855999

1、安装Vim和基本插件
首先安装好Vim和Vim的基本插件。这些使用apt-get安装即可:
$sudo  apt-get install vim vim-scripts vim-doc
其中vim-scripts是vim的一些基本插件,包括语法高亮的支持、缩进等等。
 
2、Vim配置文件
Vim强大的功能,其来源基本上就两个地方:Vim插件以及Vim配置文件。
Vim本身的系统配置文件夹是在/usr/share/vim/和/etc/vim/两个文件夹下。一般情况下,我们不会去改变这两个文件夹下的配置文件,而是在用户文件夹/home/user(其中,user为用户名,我的用户名是lingd)下建立自己的配置文件。进入用户文件夹(/home/user/)之后,用gedit新建一个名叫.vimrc的文件:
$  gedit .vimrc
注:使用gedit主要是为了方便大段大段的文字粘贴!
然后把下面的文字拷贝进这个文件之后保存:
  1. " This line should not be removed as it ensures that various options are
  2. " properly set to work with the Vim-related packages available in Debian.
  3.  debian.vim

  4. " Uncomment the next line to make Vim more Vi-compatible
  5. " NOTE: debian.vim sets 'nocompatible'. Setting 'compatible' changes numerous
  6. " options, so any other options should be set AFTER setting 'compatible'.
  7. set nocompatible

  8. " Vim5 and later versions support syntax highlighting. Uncommenting the
  9. " following enables syntax highlighting by default.
  10. if has("syntax")
  11.   syntax on            " 语法高亮
  12. endif
  13. colorscheme ron        " elflord ron peachpuff default 设置配色方案,vim自带的配色方案保存在/usr/share/vim/vim72/colors目录下

  14. " detect file type
  15. filetype on
  16. filetype plugin on

  17. " If using a dark background within the editing area and syntax highlighting
  18. " turn on this option as well
  19. set background=dark

  20. " Uncomment the following to have Vim jump to the last position when
  21. " reopening a file
  22. if has
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值