Debian中VI的配置方法 - shaovey的专栏 - CSDNBlog

来源:百度文库 编辑:神马文学网 时间:2024/04/29 00:07:14

Debian中VI的配置方法收藏

新一篇: Debian中安装VMware Tools | 旧一篇: HTML中META的用法

刚刚安装了Debian,却发现其自带的VI存在问题:
1)不支持语法高亮提示
2)不支持Backspace键的删除功能

原来Debian中自带的VI是VIM-TINY,程序本身就是不支持语法高亮和Backspace删除功能。

可以使用以下办法解决:
1)重新安装其它版本的VI
  apt-get install vim vim-runtime ctags
2)配置~/.vimrc
  添加syntax on

 

VI常用的配置选项
-----------------------
set number
set showcmd
set incsearch
set expandtab
set showcmd
set history=400
set autoread
set ffs=unix,mac,dos
set hlsearch
set shiftwidth=2
set wrap
set ai
set si
set cindent
set termencoding=unix
set tabstop=2
set nocompatible
set showmatch
set fileencodings=utf-8,gb2312,18030,gbk
set fileformats=unix
set ttyfast
syntax on
set imcmdline
set previewwindow
set showfulltag
set cursorline
set ruler
" set mouse=a

" Close the error bells
set vb t_vb=
set nowrapscan

" When open a file, it will jump to the last cursor position
if has("autocmd")
autocmd BufReadPost *
 \ if line("'\"") > 0 && line ("'\"") <= line("$") |
 \   exe "normal! g'\"" |
 \ endif
endif

" For ctags
set tags=tags;
set autochdir

" For taglist
let Tlist_Show_One_File=1
let Tlist_Exit_OnlyWindow=1
let Tlist_Auto_Open=1
set updatetime=100

" For auto complete '(' and '{'
ino ( ():let leavechar=")"i
ino { {}:let leavechar="}"i
ino ' '':let leavechar="'"i
ino " "":let leavechar='"'i
imap :exec "normal f" . leavechara

" For comment in C program /**/
set comments=s1:/*,mb:*,ex0:/