VimL代码: 我的_vimrc文件配置,还算不错
001 set nocompatible
002 source $VIMRUNTIME/vimrc_example.vim
003 source $VIMRUNTIME/mswin.vim
004 behave mswin
005 set diffexpr=MyDiff()
006 function MyDiff()
007 let opt = '-a --binary '
008 if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
009 if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
010 let arg1 = v:fname_in
011 if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
012 let arg2 = v:fname_new
013 if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
014 let arg3 = v:fname_out
015 if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
016 if &sh =~ '\<cmd'
017 silent execute '!""C:\Program Files\Vim\vim71\diff" ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . '"'
018 else
019 silent execute '!C:\Program" Files\Vim\vim71\diff" ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3
020 endif
021 endfunction
022
023 set cursorline
024 set shiftwidth=4
025 set sts=4
026 set tabstop=4
027 set expandtab
028 set nonu
029 set nobackup
030 set guioptions-=T
031 set guioptions-=m
032 set guifont=Consolas:h12
033 "set guifont=Bitstream_Vera_Sans_Mono:h10
034 "set guifont=Lucida_Console:h10
035 set langmenu=none
036 language messages en_us
037 let $LANG='zh'
038 set fileencoding=utf8
039 set encoding=utf8
040 set tenc=utf8
041 set ut=200
042
043 colorscheme wombat
044
045 map <leader><leader> \be
046 map <leader>Enter \vt
047 map C-Enter C-Tab
048
049 let g:Tlist_Use_Right_Window=1
050 let g:Tlist_Auto_Open=1
051 let g:Tlist_Show_One_File=1
052 let g:Tlist_Compact_Format=1
053 let g:Tlist_Enable_Fold_Column=0
054 let g:treeExplVertical=1
055 let g:treeExplWinSize=30
056 let mapleader = '\'
057
058 set ambiwidth=double
059 set ignorecase smartcase
060 set so=7
061 au GUIEnter * simalt ~x
062
063 python << EOF
064 import time
065 import vim
066 def SetBreakpoint():
067 nLine = int( vim.eval( 'line(".")'))
068 strLine = vim.current.line
069 i = 0
070 strWhite = ""
071 while strLine[i] == ' ' or strLine[i] == "\t":
072 i += 1
073 strWhite += strLine[i]
074 vim.current.buffer.append(
075 "%(space)spdb.set_trace() %(mark)s Breakpoint %(mark)s" %
076 {'space':strWhite, 'mark': '#' * 30}, nLine - 1)
077 for strLine in vim.current.buffer:
078 if strLine == "import pdb":
079 break
080 else:
081 vim.current.buffer.append( 'import pdb', 0)
082 vim.command( 'normal j1')
083 break
084 vim.command( 'map <C-F7> :py SetBreakpoint()<cr>')
085
086 def RemoveBreakpoints():
087 nCurrentLine = int( vim.eval( 'line(".")'))
088 nLines = []
089 nLine = 1
090 for strLine in vim.current.buffer:
091 if strLine == 'import pdb' or strLine.lstrip()[:15] == 'pdb.set_trace()':
092 nLines.append( nLine)
093 nLine += 1
094 nLines.reverse()
095 for nLine in nLines:
096 vim.command( 'normal %dG' % nLine)
097 vim.command( 'normal dd')
098 if nLine < nCurrentLine:
099 nCurrentLine -= 1
100 vim.command( 'normal %dG' % nCurrentLine)
101 vim.command( 'map <C-F8> :py RemoveBreakpoints()<cr>')
102 vim.command( 'map <C-D> :!python %<cr>')
103 EOF