removed some pythonic stuff, that I really didn't need

This commit is contained in:
Thomas Ruoff
2010-04-02 17:54:50 +02:00
parent 10ad11a047
commit 87ef306b84

View File

@@ -1,52 +1,3 @@
python << EOF
def SetBreakpoint():
import re
nLine = int( vim.eval( 'line(".")'))
strLine = vim.current.line
strWhite = re.search( '^(\s*)', strLine).group(1)
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')
vim.command( 'map <f7> :py SetBreakpoint()<cr>')
def RemoveBreakpoints():
import re
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 <s-f7> :py RemoveBreakpoints()<cr>')
EOF
set makeprg=python\ -c\ \"import\ py_compile,sys;\ sys.stderr=sys.stdout;\ py_compile.compile(r'%')\"
set efm=%C\ %.%#,%A\ \ File\ \"%f\"\\,\ line\ %l%.%#,%Z%[%^\ ]%\\@=%m
"PEP 8 Friendly
setlocal tabstop=4
setlocal softtabstop=4
@@ -56,3 +7,5 @@ setlocal smarttab
setlocal expandtab
setlocal smartindent
" Code completion
autocmd FileType python set omnifunc=pythoncomplete#Complete