Ubuntuでのvimのシンプルな構成

2506 ワード

まず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\+\%#\@
修正方法:
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