Vim配置文件
在 home 目录下新建或替换 .vimrc 文件
vim ~/.vimrc
复制填入以下内容,可能会报错如^M等错误,简单百度就能解决。
文件目录:~/.vimrc
"========================================================================="
"
"" DesCRiption: 适合自己使用的vimrc文件,for Linux/Windows, GUI/Console
"
"========================================================================="
syntax on "自动语法高亮"
set nu " 显示行号"
color elflord "设置背景主题 "
syntax on " 语法高亮"
autocmd InsertLeave * se nocul "用浅色高亮当前行"
autocmd InsertEnter * se cul "用浅色高亮当前行"
set ruler "显示标尺"
set showcmd "输入的命令显示出来,看的清楚些"
set cmdheight=1 "命令行(在状态行下)的高度,设置为1"
set scrolloff=3 " 光标移动到buffer的顶部和底部时保持3行距离"
set novisualbell "不要闪烁"
set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [POS=%l,%v][%p%%]\ %{strftime(\"%d/%m/%y\ -\ %H:%M\")} "状态行显示的内容"
set laststatus=1 "启动显示状态行(1),总是显示状态行(2) "
set foldenable "允许折叠 "
set foldmethod=manual "手动折叠 "
set background=dark "背景使用黑色 "
set nocompatible "去掉讨厌的有关vi一致性模式,避免以前版本的一些bug和局限 "
"搜索时忽略大小写"
set smartcase
"动态搜索"
set incsearch
"高亮显示搜索结果"
set hlsearch
"自动匹配括号"
set showmatch
"显示行尾空格为小方块"
set listchars=tab:»■,trail:■
set list
"tab 显示匹配命令清单"
set wildmenu
set wildmode=longest:list,full
"显示中文帮助"
if version >= 603
set helplang=cn
set encoding=utf-8
endif
" 设置配色方案"
colorscheme elflord
"字体"
if (has("gui_running"))
set guifont=Bitstream\ Vera\ Sans\ Mono\ 10
endif
set fencs=utf-8,ucs-bom,shift-jis,gb18030,gbk,gb2312,cp936
set termencoding=utf-8
set encoding=utf-8
set fileencodings=ucs-bom,utf-8,cp936
set fileencoding=utf-8