Vim配置文件vimrc

来源:互联网 发布:阿里云服务器是什么 编辑:程序博客网 时间:2024/05/17 07:09

**set nocompatible
filetype plugin on ” 载入文件类型插件
filetype indent on ” 为特定文件类型载入缩进文件
filetype on ” 侦测文件类型
syntax on ” 语法高亮
“——————————————————————————-
” vim基本配置
“——————————————————————————-
set autoindent ” 继续前一行缩进方式
set autoread ” 文件被外界修改时自动读取
set autowrite ” 写每个修改过的缓冲区 :next , …
set autochdir ” 可自动切换文件所在目录为工作目录
set backspace=indent,eol,start ” 插入模式中的任意退格键
set whichwrap+=<,>,h,l
set fencs=utf-8,cp936,gb2312
“set backup ” 保留一个备份文件
“set nobackup ” 不备份文件
“setlocal noswapfile ” 不产生swap文件
“set bufhidden ” 当buffer被丢去的时候隐藏它
“set linespace=0 ” 字符间插入的像素行数

set browsedir=current ” which directory to use for the file browser
set complete+=k ” scan the files given with the ‘dictionary’ option
set cindent ” 选择C语言缩进方式
set history=1000 ” 记忆1000行历史命令,控制history文件
set hlsearch ” 高亮显示最后使用的搜索模式
set incsearch ” 搜索时,逐个字符高亮
set ignorecase ” 搜索时忽略大小写
set listchars=tab:>.,eol:$ ” 输入:set list 命令时候显示的内容
set scrolloff=3 ” 光标移到buffer的顶部或底部保留三行的距离
set mouse=a ” 在文本的任意地方使用鼠标
set selection=exclusive
set selectmode=mouse,key

set nowrap ” 不要换行
set nowrapscan ” 再搜索到文件两端时,禁止搜索
set popt=left:8pc,right:3pc ” print options
set ruler ” 显示光标的行号和列号
set shiftwidth=4 ” 统一缩进为4
set softtabstop=4
set showcmd ” display incomplete commands
set showmatch ” 高亮显示匹配的括号
set smartindent ” 为C程序提供自动缩进
set smartcase
set smarttab ” 再行和段开始处使用制表符
set tabstop=4 ” tab制表符长度为4
set visualbell ” visual bell instead of beeping
set wildignore=.bak,.o,.e,~ ” wildmenu: ignore these extensions
set wildmenu ” 增强模式中命令行自动完成操作
set number ” 显示行号
set magic ” 设置魔法
set ft=asm
” 用空格键来开关折叠
set foldenable ” 开始折叠
set foldmethod=manual
“set foldmethod=syntax ” 开始语法折叠
nnoremap @=((foldclosed(line(‘.’)) < 0)?’zc’:’zo’)
“===================================
” 状态行颜色
“===================================
highlight StatusLine guifg=SlateBlue guibg=Yellow
highlight StatusLineNC guifg=Gray guibg=White
“———————————–
” 可自动切换文件所在目录为工作目录
“———————————–
if has(“autocmd”)
autocmd BufEnter * :lchdir %:p:h
endif

“———————————–
” 关闭窗口 (调用进程管理器解决KDE设置冲突)
“———————————–
noremap :close
inoremap :close
“———————————–
” 窗口间快速匹配
” 当前窗口信息保存到下个窗口进行内容匹配
” Choose :bprevious or :bnext
“———————————–
noremap :if &modifiable && !&readonly &&
\ &modified :write :endif:bprevious
inoremap :if &modifiable && !&readonly &&
\ &modified :write :endif:bprevious

“——————————————————————————-

0 0