[VIM] configure VIM with .vimrc in Ubuntu

In Ubuntu, to install VIM (if it is not installed by default)

sudo apt-get install vim

In my PC, there is no configuration file which is called .vimrc, what we have to do is just create it.

cd ~
vim .vimrc

The configuration (it will work automatically) :

set nocompatible        "不使用vi默认键盘布局   (Not use default keyboard configue)
set number              "显示行号 (Show line number)
set autoindent          "自动对齐 
set smartindent         "智能对齐
set showmatch           "括号匹配模式
set ruler               "显示状态行
set incsearch           "查询时非常方便,如要查找book单词,当输入到/b时,会自动找到   第一个b开头的单词,当输入到/bo时,会自动找到第一个bo开头的单词,依次类推,进行查找时,使用此设置会快速找到答案,当你找要匹配的单词时,别忘记回车.
set tabstop=4           "tab键为4个空格
set shiftwidth=4        "换行时行间交错使用4个空格
set softtabstop=4       "设置(软)制表符宽度为4
set cindent             "C语言格式对齐
set nobackup           	"不要备份文件
set clipboard+=unnamed  "与windows共享剪贴板

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s