程序员的VIM配置

来源:互联网 发布:练配音的软件 编辑:程序博客网 时间:2024/05/16 00:43

后端神器:VIM

让手速跟上思维!

" $Author: xulidong $" $Mail: xu.lidong@qq.com $" $Date: 2015-12-04 $" $URL: http://blog.csdn.net/xufeng0991/article/details/50178493 $" <key> 特殊键" <Esc> Esc" <C-a> Ctrl+a" <Up> 上方向键" <C-LeftMouse> Ctrl+鼠标左键" <S-F11> Shift+F11" <Tab> Tab" <CR> <Enter>set backspace=2" 相当于set backspace=indent,eol,start,解决mac中delete失效问题" 语法高亮syntax enablesyntax on  set nocompatible " 关闭vi键盘兼容模式set nobackup " 关闭备份set number " 显示行号set expandtab " 自动将Tab展开为空格set smarttab " 行首自动加入Tabset tabstop=4 " 1个Tab占4个空格set shiftwidth=4 " 每层缩进空格数set cindent " c/c++风格缩进set autoindent " 自动对齐set smartindent " 只能对齐set showmatch " 括号高亮set hlsearch " 搜索高亮set incsearch " 搜索时逐字高亮set formatoptions+=ro " 注释中换行自动插入注释起始符号set noerrorbells " 关闭滴滴声" Ctrl + a 全选noremap <C-a> <Esc>ggVG" Ctrl + c 复制noremap <C-c> y" Ctr + x 剪切noremap <C-x> d" Ctr + z 撤销" noremap <C-z> u" Ctrl + f 搜索光标所在的字符串noremap <C-f> *N function! ClosePair(char)    if getline('.')[col('.') - 1] == a:char        return "\<Right>"    else        return a:char    endifendfunction" 左括号自动补全:inoremap ( ()<Esc>i:inoremap ) <C-r>=ClosePair(')')<CR>" 大括号自动补全换行:inoremap { {<CR>}<Up><Esc>o:inoremap } <C-r>=ClosePair('}')<CR>" 自动补全方括号:inoremap [ []<Esc>i:inoremap ] <C-r>=ClosePair(']')<CR>" 引号自动补全:inoremap " ""<Esc>i:inoremap ' ''<Esc>iautocmd FileType make setlocal noexpandtab " makefile 不用空格替换Tab

文件托管:https://git.oschina.net/xulidong/tools.git




0 0