vim配置
1 source $VIMRUNTIME/vimrc_example.vim 2 source $VIMRUNTIME/mswin.vim 3 behave mswin 4 5 set diffexpr=MyDiff() 6 function MyDiff() 7 let opt = '-a --binary ' 8 if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif 9 if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif 10 let arg1 = v:fname_in 11 if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif 12 let arg2 = v:fname_new 13 if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif 14 let arg3 = v:fname_out 15 if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif 16 let eq = '' 17 if $VIMRUNTIME =~ ' ' 18 if &sh =~ '\<cmd' 19 let cmd = '""' . $VIMRUNTIME . '\diff"' 20 let eq = '"' 21 else 22 let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"' 23 endif 24 else 25 let cmd = $VIMRUNTIME . '\diff' 26 endif 27 silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq 28 endfunction 29 30 31 set fileencoding=gb18030 32 set fileencodings=utf-8,gb18030,utf-16,big5 33 set guifont=Consolas:h12 34 au GUIENTER * simalt ~x 35 colorscheme liveme 36 let g:user_emmet_expandabbr_key = '<c-e>' 37 38 set go = "不要图形按钮 39 set noerrorbells 40 set linebreak 41 set textwidth=80 42 set nocompatible 43 set history=400 44 set ruler 45 set number "显示行号 46 set hlsearch 47 set noincsearch 48 set expandtab 49 set noerrorbells 50 set novisualbell 51 set t_vb= "close visual bell 52 set foldmethod=marker 53 set tabstop=4 "统一缩进为4个空格 54 set shiftwidth=4 55 set nobackup "不生成临时文件 56 set nowritebackup 57 "set noswapfile 58 set smarttab 59 set smartindent "智能缩进 60 set shortmess =atI "程序启动不显示援助乌干达儿童 61 set autoindent "自动缩进 62 set cindent 63 set wrap "自动换行 64 set autoread 65 set cmdheight=1 66 set showtabline=2 67 set noeb "不要错误提示音 68 "set clipboard+=unnamed 69 set tabpagemax=20 70 set laststatus=2 71 autocmd FileType * setlocal noeol binary fileformat=dos 72 cd C:\Users\WH\Desktop 73 74 " key stock 75 map tn :tabnext<cr> 76 map tp :tabprevious<cr> 77 map nn :NewTemplateTab html 78 map tr :NERDTree <cr> 79 map ta :tabnew <cr> 80 map te :tabedit <cr> 81 map tc :tabclose<cr> 82 83 " \s 一键保存 84 func! SaveFile() 85 exec "w" 86 endfunc 87 map <leader>s :call SaveFile()<CR> 88 imap <leader>s <ESC>:call SaveFile()<CR> 89 vmap <leader>s <ESC>:call SaveFile()<CR> 90 91 92 " 确保语法高亮 93 if exists("syntax_on") 94 syntax reset 95 else 96 syntax on 97 endif 98 99 "禁用上下左右方向键 100 map <left> <nop> 101 map <right> <nop> 102 map <up> <nop> 103 map <down> <nop>
欢迎转载,但请保留出处,谢谢合作!