realfun 发表于 2013-2-4 22:56:49

我的_vimrc文件,还算不错

代码高亮来自:代码发芽网
 
<div style="">          VimL代码: 我的_vimrc文件配置,还算不错    <div class="source"> set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin
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
  if &sh =~ '\<cmd'
    silent execute '!""C:\Program Files\Vim\vim71\diff" ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . '"'
  else
    silent execute '!C:\Program" Files\Vim\vim71\diff" ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3
  endif
endfunction

set cursorline
set shiftwidth=4
set sts=4
set tabstop=4
set expandtab
set nonu
set nobackup
set guioptions-=T
set guioptions-=m
set guifont=Consolas:h12
"set guifont=Bitstream_Vera_Sans_Mono:h10
"set guifont=Lucida_Console:h10
set langmenu=none
language messages en_us
let $LANG='zh'
"set fileencodings=utf-8,GBK
set fileencoding=utf8
set encoding=utf8
set tenc=utf8
set ut=200

"colorscheme desert
colorscheme wombat

map <leader><leader> \be
map <leader>Enter \vt
map C-Enter C-Tab

let g:Tlist_Use_Right_Window=1
let g:Tlist_Auto_Open=1
let g:Tlist_Show_One_File=1
let g:Tlist_Compact_Format=1
let g:Tlist_Enable_Fold_Column=0
let g:treeExplVertical=1
let g:treeExplWinSize=30
let mapleader = '\'

set iskeyword+=.

set ignorecase smartcase
set so=7
au GUIEnter * simalt ~x

python << EOF
import time
import vim
def SetBreakpoint():
    nLine = int( vim.eval( 'line(".")'))
    strLine = vim.current.line
    i = 0
    strWhite = ""
    while strLine == ' ' or strLine == "\t":
        i += 1
        strWhite += strLine
    vim.current.buffer.append(
       "%(space)spdb.set_trace() %(mark)s Breakpoint %(mark)s" %
         {'space':strWhite, 'mark': '#' * 30}, nLine - 1)
    for strLine in vim.current.buffer:
        if strLine == "import pdb":
            break
        else:
            vim.current.buffer.append( 'import pdb', 0)
            vim.command( 'normal j1')
            break
vim.command( 'map <C-F7> :py SetBreakpoint()<cr>')

def RemoveBreakpoints():
    nCurrentLine = int( vim.eval( 'line(".")'))
    nLines = []
    nLine = 1
    for strLine in vim.current.buffer:
        if strLine == 'import pdb' or strLine.lstrip()[:15] == 'pdb.set_trace()':
            nLines.append( nLine)
        nLine += 1
    nLines.reverse()
    for nLine in nLines:
        vim.command( 'normal %dG' % nLine)
        vim.command( 'normal dd')
        if nLine < nCurrentLine:
            nCurrentLine -= 1
    vim.command( 'normal %dG' % nCurrentLine)
vim.command( 'map <C-F8> :py RemoveBreakpoints()<cr>')
vim.command( 'map <C-D> :!python %<cr>')
EOF
页: [1]
查看完整版本: 我的_vimrc文件,还算不错