分享

Debian中VI的配置方法

 kakaxi 2008-12-19

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 ( ()<esc>:let leavechar=")"<cr>i
ino { {}<esc>:let leavechar="}"<cr>i
ino ' ''<esc>:let leavechar="'"<cr>i
ino " ""<esc>:let leavechar='"'<cr>i
imap <c-l> <esc>:exec "normal f" . leavechar<cr>a

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

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多