vim 配置
发布时间:2020-12-15 17:05:17 所属栏目:安全 来源:网络整理
导读:cp /usr/share/vim/vimrc /usr/share/vim/vimrc_backup " Configuration file for vimset modelines=0" CVE-2007-2438" Normally we use vim-extensions. If you want true vi-compatibility" remove change the following statementsset nocompatible" Use
cp /usr/share/vim/vimrc/usr/share/vim/vimrc_backup " Configuration file for vim set modelines=0 " CVE-2007-2438 " Normally we use vim-extensions. If you want true vi-compatibility " remove change the following statements set nocompatible " Use Vim defaults instead of 100% vi compatibility set backspace=2 " more powerful backspacing " Don't write backup file if vim is being called by "crontab -e" au BufWrite /private/tmp/crontab.* set nowritebackup nobackup " Don't write backup file if vim is being called by "chpass" au BufWrite /private/etc/pw.* set nowritebackup nobackup " 以下内容为新增内容 set showmatch " 高亮显示对应的括号 set number " 显示行号 set cindent " C风格的对齐方式 set autoindent " 自动对齐 set confirm " 在处理未保存或只读文件的时候,弹出确认 set tabstop=4 " Tab键的宽度 syntax on " 自动语法高亮 set softtabstop=4 set shiftwidth=4 " 统一缩进为4 set mouse=a " 开启鼠标功能 set selection=exclusive set selectmode=mouse,key set guifont=Courier_New:h10:cANSI " 设置字体 " 编码设置 set enc=utf-8 set fencs=utf-8,ucs-bom,shift-jis,gb18030,gbk,gb2312,cp936 " 语言设置 set langmenu=zh_CN.UTF-8 set helplang=cn " 我的状态行显示的内容(包括文件类型和解码) set statusline=%F%m%r%h%w [FORMAT=%{&ff}] [TYPE=%Y] [POS=%l,%v][%p%%] %{strftime("%d/%m/%y - %H:%M")} set statusline=[%F]%y%r%m%*%=[Line:%l/%L,Column:%c][%p%%] " 总是显示状态行 set laststatus=2 " 命令行(在状态行下)的高度,默认为1,这里是2 set cmdheight=2 set hlsearch set incsearch " 搜索逐字符高亮 set gdefault " 行内替换 set matchtime=5 " 对应括号高亮的时间(单位是十分之一秒) " 设置当文件被改动时自动载入 set autoread " 共享剪贴板 set clipboard+=unnamed " 映射全选+复制 ctrl+a map <C-A> ggVGY map! <C-A> <Esc>ggVGY map <F12> gg=G "自动补全 :inoremap ( ()<ESC>i :inoremap ) <c-r>=ClosePair(')')<CR> :inoremap { {<CR>}<ESC>O :inoremap } <c-r>=ClosePair('}')<CR> :inoremap [ []<ESC>i :inoremap ] <c-r>=ClosePair(']')<CR> :inoremap " ""<ESC>i :inoremap ' ''<ESC>i function! ClosePair(char) if getline('.')[col('.') - 1] == a:char return "&;Right>" else return a:char endif endfunction filetype plugin indent on "打开文件类型检测,加了这句才可以用智能补全 set completeopt=longest,menu References: http://blog.csdn.net/freeking101/article/details/62037015 @qingdujun 2017-11-18 北京 怀柔 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- 颜色 – Vim CursorLine插入模式中的颜色变化
- bash – 添加尾随逗号以确保.csv行具有相同的列数
- 使用Scalaz(或Shapeless)为每个子类创建Monoids
- 在Scala中,如何在类的主构造函数中定义局部参数?
- twitter-bootstrap – 带有角度指令的可点击bootstrap-date
- angularjs – 使用Jest对Angular Directives进行单元测试
- Axis2创建WebService实例
- BootStrap glyphicons 瀛椾綋鍥炬爣瀹炵幇鏂规硶
- Netbeans IDE的Vim插件
- 在Scala中将BitSet设置为[Int]或反之亦然