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









评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值