ubuntu11.04中vi编辑器的配置

来源:互联网 发布:淘宝加盟代理怎么样 编辑:程序博客网 时间:2024/04/30 15:39

 其实ubuntu的使用很方便。首先,在软件中心安装所有与vi相关的软件,截图如下:

进入Ubuntu软件中心后在搜索框里输入vim,截图如下:

选择并进行安装。

其次,打开终端,输入命令:vim  /etc/vim/vimrc

在其最后加上如下几行:

set nocompatible  
set autoindent
set smartindent
set showmatch
set ruler
set incsearch
set tabstop=4
set shiftwidth=4
set softtabstop=4
set cindent
set nobackup
set clipboard+=unnamed

即可。

附:

set nocompatible                 不使用vi默认键盘布局
set autoindent                     自动对齐
set smartindent                   智能对齐
set showmatch                    括号匹配模式
set ruler                               显示状态行
set incsearch                       搜索时一边输入一边显示效果
set tabstop=4                       tab键为4个空格
set shiftwidth=4
set softtabstop=4
set cindent                           C语言格式对齐
set nobackup                       不要备份文件
set clipboard+=unnamed     与windows共享剪贴板