先发个效果图,操作系统Slackware Linux,窗口管理器Fvwm2,虚拟终端Xterm,Vim版本7.2
下面是我的配置文件
~/.vimrc:
- " ===========================
- " Programming
- " ===========================
-
- filetype plugin indent on "开启文件检测
- syntax on "语法高亮
- set number "显示行号
- set cursorline "行高亮
- set ruler "总是显示当前光标位置
- set cindent "自动缩进
- set smartindent "智能对齐方式
- set matchpairs=(:),{:},[:],<:> "匹配括号的规则
- set whichwrap=b,s,<,>,[,] "让退格、空格、上下箭头遇到行首行尾时自动移动
- set expandtab "用空格替代tab
- set tabstop=8 "tab占8个字符
- set softtabstop=8 "按一次tab前进或后退8个字符
- set ignorecase "搜索时忽略大小写
- set wrapscan "循环搜索
- set hlsearch "高亮搜索
- set incsearch "即时搜索及反白显示第一个匹配
-
- "折叠设置
- set foldmethod=marker
- set foldlevel=3
- set foldcolumn=4
-
- " ===========================
- " Generel
- " ===========================
- color evening "颜色主题
- set history=256 "冒号命令和搜索命令的历史记录长度
- set showcmd "回显输入的命令
- set showmode "显示当前的模式
- set mouse=a "在所有模式下都启用鼠标
- set backspace=start,indent,eol "解除Backspace的限制
- set clipboard+=unnamed "使关联系统的剪贴板
- set encoding=utf-8 "vim内部使用的编码方式
- "vim中当前文件的字符编码方式
- set fileencodings=utf-8,ucs-bom,cp936,gb18030,big5,euc-jp,euc-kr,latin1
- "防止界面乱码(中文情况下)
- set langmenu=zh_CN.UTF-8
- language message zh_CN.UTF-8
-
- "状态栏显示设置
- set laststatus=2
- set statusline=
- set statusline+=%2*%-3.3n%0*\
- set statusline+=%f\
- set statusline+=%h%1*%m%r%w%0*
- set statusline+=[
- if v:version >= 600
- set statusline+=%{strlen(&ft)?&ft:'none'},
- set statusline+=%{&encoding},
- endif
- set statusline+=%{&fileformat}]
- if filereadable(expand("$VIM/vimfiles/plugin/vimbuddy.vim"))
- set statusline+=\ %{VimBuddy()}
- endif
- set statusline+=%=
- set statusline+=0x%-8B\
- set statusline+=%-14.(%l,%c%V%)\ %<%P