您的位置:首页 > 其它

vim 基本配置文件.vimrc 简介

2015-01-07 16:24 239 查看
#去掉讨厌的有关vi一致性模式,避免以前版本的一些bug和局限

 1 set nocompatible

#显示行号

  2 set number

#背景设置为黑色

  3 set background=dark

#光标所在的行突出显示

  4 set cursorline

#设置高亮语法

  5 syntax on

#开启文件插件类型检查

  6 filetype plugin indent on

设置tab为4个空格

  7 set tabstop=4

#设置自动缩进

  8 set autoindent
  9 set smartindent

#设置整行左移\右移时的移动距离为4个空格,通过< / > 来左移或者右移                                                                                                 

 10 set shiftwidth=4

 11 set showmatch

#打开状态栏标尺

 12 set ruler

#文件切换时,当前目录自动切换到当前文件所在的目录

 13 set autochdir
#搜索到文件开头或结尾时不在继续搜索

 14 set nowrapscan

#在搜索过程中就高亮显示已匹配的部分

 15 set incsearch

#高亮显示搜索结果

 16 set hlsearch

#关闭BBBBB的声音

 17 set noerrorbells
 18 set t_vb=

#设置备份文件,例如源文件问biyuntao.txt, 备份文件为biyuntao.txt~

 19 if has("vms")

 20     set nobackup

 21 else

 22     set backup
 23 endif

#设置这个后就可以显示中文啦

 24 :set fileencodings=ucs-bom,utf-8,cp936

 25 :set fileencoding=utf-8

 26 :set encoding=utf-8
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  vim vimrc