Ubuntu下vim的简单配置

前端之家收集整理的这篇文章主要介绍了Ubuntu下vim的简单配置前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

首先安装使用apt安装vim编辑器

sudo apt-get install vim
打开vim 编译器输入

vi ~/.vimrc

使用vim编辑配置文件,~/.vimrc文件添加如下内容

set nocompatible

set number

filetype on

set history=1000

set background=dark

Syntax on

set autoindent
set smartindent

set tabstop=4
set shiftwidth=4

set showmatch

set guioptions-=T

set vb t_vb=

set ruler

set nohls

set incsearch
set mouse=a

出现的错误

line   16:  
E319: Sorry,the command is not available in this version: filetype on  
line   17:  
E319: Sorry,the command is not available in this version: filetype plugin on  
line   18:  
E319: Sorry,the command is not available in this version: filetype indent on  
line   21:  
E319: Sorry,the command is not available in this version: Syntax on  
line   45:  
E319: Sorry,the command is not available in this version: match ExtraWhitespace /\s\+$/  
line   46:  
E319: Sorry,the command is not available in this version: autocmd BufWinEnter * match ExtraWhitespace /\s\+$/  
line   47:  
E319: Sorry,the command is not available in this version: autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/  
line   48:  
E319: Sorry,the command is not available in this version: autocmd InsertLeave * match ExtraWhitespace /\s\+$/  
line   49:  
E319: Sorry,the command is not available in this version: autocmd BufWinLeave * call clearmatches()
修改方式:

sudo apt-get install vim-gui-common  
sudo apt-get install vim-runtime
Another cause might be that alternatives is pointing to the wrong one:

update-alternatives –display vim

to show what is used and ...

update-alternatives –config vim
to change to another vim. It could be that /usr/bin/vim.gnome is used and you need /usr/bin/vim

猜你在找的Ubuntu相关文章