Ubuntu中的vim配置

首先编辑~/.vimrc,把下面的内容保存到该文件中。

set nocompatible
set encoding=utf-8
set fileencodings=utf-8,chinese
set tabstop=4
set cindent shiftwidth=4
set backspace=indent,eol,start
autocmd Filetype c set omnifunc=ccomplete#Complete
autocmd Filetype cpp set omnifunc=cppcomplete#Complete
set incsearch
set number
set display=lastline
set ignorecase
syntax on
set nobackup
set ruler
set showcmd
set smartindent
set hlsearch
set cmdheight=1
set laststatus=2
set shortmess=atI
set formatoptions=tcrqn
set autoindent  

一般情况下vim需要配合着ctags才能够发挥出最强大的效果。使用下面的命令安装ctags:

sudo apt-get install exuberant-ctags

你可能感兴趣的:(Ubuntu)