我的Vim(Gvim) 配置

前端之家收集整理的这篇文章主要介绍了我的Vim(Gvim) 配置前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

大家都很强, 可与之共勉。

因为暂时用不到Linux,所以先用Gvim凑合一下。

我的配置

set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin

set ai
set cin
set ruler
set number
set mouse=a
set showcmd
set hlsearch
set incsearch
set tabstop=4
set smartindent
set shiftwidth=4
set softtabstop=4

imap jj <ESC>
inoremap ( ()<ESC>i
inoremap [ []<ESC>i
inoremap " ""<ESC>i "inoremap < <><ESC>i
inoremap { {}<ESC>i<CR><ESC>O

winpos 5 5
set lines=60
set columns=232

color desert
set guifont=Courier_new:h16:b:cDEFAULT

Syntax on

nmap <C-A> ggVG
vmap <C-C> "+y filetype plugin indent on autocmd FileType cpp set cindent autocmd FileType cpp map <F3> : !start vim %<.in autocmd FileType cpp map <F4> : !start vim %<.out autocmd FileType cpp map <F5> : ! time ./%< <CR> autocmd FileType cpp map <F8> : ! time ./%< < %<.in <CR> autocmd FileType cpp map <F9> : w <CR> : ! g++ % -o %< -g -Wall -Wextra -Wconversion && size %< <CR> autocmd FileType cpp map <C-F9> : w <CR> : ! g++ % -o %< -O2 && size %< <CR> autocmd FileType cpp map <F10> : ! gdb %< --silent <CR> set diffexpr=MyDiff() function MyDiff() let opt = '-a --binary ' if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
  if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
  let arg1 = v:fname_in
  if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
  let arg2 = v:fname_new
  if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
  let arg3 = v:fname_out
  if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
  let eq = ''
  if $VIMRUNTIME =~ ' '
    if &sh =~ '\<cmd'
      let cmd = '""' . $VIMRUNTIME . '\diff"' let eq = '"'
    else
      let cmd = substitute($VIMRUNTIME,' ','" ','') . '\diff"'
    endif
  else
    let cmd = $VIMRUNTIME . '\diff'
  endif
  silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq
endfunction
原文链接:/bash/390433.html

猜你在找的Bash相关文章