找开语法显示,自动显示行号,背景显示为黑色等等一系列的功能,下面就对这个vimrc文件进行注释下下,如果你需要此功能
的话就可以在文件的末行添加或者直接把 " 给去掉就行啦。废话少说,入正题吧:
/etc/vim/vimrc文件:
" All system-wide defaults are set in $VIMRUNTIME/debian.vim (usually just
" /usr/share/vim/vimcurrent/debian.vim) and sourced by the call to :runtime
" you can find below. If you wish to change any of those settings, you should
" do it in this file (/etc/vim/vimrc), since debian.vim will be overwritten
" everytime an upgrade of the vim packages is performed. It is recommended to
" make changes after sourcing debian.vim since it alters the value of the
" 'compatible' option.
" This line should not be removed as it ensures that various options are
" properly set to work with the Vim-related packages available in Debian.
runtime! debian.vim
" Uncomment the next line to make Vim more Vi-compatible
" NOTE: debian.vim sets 'nocompatible'. Setting 'compatible' changes numerous
" options, so any other options should be set AFTER setting 'compatible'.
"set compatible #兼容有关vi一致性模式
" Vim5 and later versions support syntax highlighting. Uncommenting the next
" line enables syntax highlighting by default.
syntax on #开启语法显示
" If using a dark background within the editing area and syntax highlighting
" turn on this option as well
"set background=dark #设置vim背景色为黑色
" Uncomment the following to have Vim jump to the last position when
" reopening a file
"if has("autocmd")
" au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
" \| exe "normal g'\"" | endif
"endif
" Uncomment the following to have Vim load indentation rules according to the
" detected filetype. Per default Debian Vim only load filetype specific
" plugins.
"if has("autocmd")
" filetype indent on
"endif
" The following are commented out as they cause vim to behave a lot
" differently from regular Vi. They are highly recommended though.
"set showcmd " Show (partial) command in status line.
"set showmatch " Show matching brackets.
"set ignorecase " Do case insensitive matching
"set smartcase " Do smart case matching
"set incsearch " Incremental search
"set autowrite " Automatically save before commands like :next and :make
"set hidden " Hide buffers when they are abandoned
"set mouse=a " Enable mouse usage (all modes) in terminals
" Source a global configuration file if available
" XXX Deprecated, please move your changes here in /etc/vim/vimrc
if filereadable("/etc/vim/vimrc.local")
source /etc/vim/vimrc.local
endif
set number #显示行号
"set history=1000 #记录历史的行数
"set nocompatible #去掉有关vi一致性模式
"set autoindent #vim使用自动对齐,也就是把当前行的对齐格式应用到下一行
"set smartindent #依据上面的对齐格式,智能的选择对齐方式
"set tabstop=4 #设置tab键为4个空格
"set shiftwidth=4 #设置当行之间交错时使用4个空格
"set showmatch #设置匹配模式,类似当输入一个左括号时会匹配相应的那个右括号
"set guioptions-=T #去除vim的GUI版本中的toolbar
"set vb t_vb= #当vim进行编辑时,如果命令错误,会发出一个响声,该设置去掉响声
"set ruler #在编辑过程中,在右下角显示光标位置的状态行
"set nohls #默认情况下,寻找匹配是高亮度显示的,该设置关闭高亮显示
"set incsearch #查询时非常方便,如要查找book单词,当输入到/b时,会自动找到第一个b开头的单
词,当输入到/bo时,会自动找到第一个bo开头的单词,依次类推,进行查找时,使用此设置会快速找到
答案,当你找要匹配的单词时,别忘记回车
"if has("vms")
"set nobackup
"else
"set backup
"endif #修改一个文件后,自动进行备份,备份的文件名为原文件名加"~"后缀
将上面的注释 " 去掉后保存退出就可以实现那些功能了。如果设置完后,发现功能没有起作用,检查一下系统下是否安装了vim-enhanced包。
参考资料:
1.vim的完全翻译版在下面连接处可以找到
http://vimcdoc.sourceforge.net/
可以下载其中的一个PDF版本,里面介绍的很详细,强烈推荐:)
2.更详细的vim信息可以访问:
3.一个带有英文注释的.vimrc例子
http://www.vi-improved.org/vimrc.php
--
/**************************************/
Name: Xiong Feng
E-mail:linux0818@gmail.com
MSN:linux0818@hotmail.com
QQ:23562033
Address: GuangZhou.China
/**************************************/
没有评论:
发表评论