mirror of
https://github.com/gryf/.vim.git
synced 2026-02-12 14:05:44 +01:00
Added pmx specific stuff
This commit is contained in:
@@ -50,6 +50,24 @@ else
|
||||
let b:did_pylint_plugin = 1
|
||||
endif
|
||||
|
||||
if !exists('*s:CheckPylint')
|
||||
function s:CheckPylint()
|
||||
python << EOF
|
||||
try:
|
||||
import vim
|
||||
from pylint import lint
|
||||
from pylint.reporters.text import TextReporter
|
||||
except ImportError:
|
||||
vim.command("return 0")
|
||||
vim.command("return 1")
|
||||
EOF
|
||||
endfunction
|
||||
endif
|
||||
|
||||
if s:CheckPylint() == 0
|
||||
finish
|
||||
endif
|
||||
|
||||
if !exists("b:did_pylint_init")
|
||||
let b:did_pylint_init = 0
|
||||
|
||||
@@ -59,16 +77,9 @@ if !exists("b:did_pylint_init")
|
||||
endif
|
||||
|
||||
python << EOF
|
||||
import vim
|
||||
import sys
|
||||
from StringIO import StringIO
|
||||
|
||||
try:
|
||||
from pylint import lint
|
||||
from pylint.reporters.text import TextReporter
|
||||
except ImportError:
|
||||
raise AssertionError('Pylint is required for this plugin')
|
||||
|
||||
class VImPylint(object):
|
||||
|
||||
sys_stderr = sys.stderr
|
||||
|
||||
@@ -22,3 +22,7 @@ snippet ~
|
||||
|
||||
snippet ...
|
||||
…
|
||||
snippet fn
|
||||
`expand("%")`
|
||||
snippet fp
|
||||
`expand("%:p")`
|
||||
|
||||
@@ -5,11 +5,11 @@ snippet imp
|
||||
import ${1:module}
|
||||
# Module Docstring
|
||||
snippet docs
|
||||
'''
|
||||
"""
|
||||
File: ${1:`Filename('$1.py', 'foo.py')`}
|
||||
Author: ${2:`g:snips_author`}
|
||||
Description: ${3}
|
||||
'''
|
||||
"""
|
||||
snippet wh
|
||||
while ${1:condition}:
|
||||
${2:# code...}
|
||||
@@ -19,7 +19,9 @@ snippet for
|
||||
# New Class
|
||||
snippet cl
|
||||
class ${1:ClassName}(${2:object}):
|
||||
"""${3:docstring for $1}"""
|
||||
"""
|
||||
${3:docstring for $1}
|
||||
"""
|
||||
def __init__(self, ${4:arg}):
|
||||
${5:super($1, self).__init__()}
|
||||
self.$4 = $4
|
||||
@@ -27,7 +29,9 @@ snippet cl
|
||||
# New Function
|
||||
snippet def
|
||||
def ${1:fname}(${2:`indent('.') ? 'self' : ''`}):
|
||||
"""${3:docstring for $1}"""
|
||||
"""
|
||||
${3:docstring for $1}
|
||||
"""
|
||||
${4:pass}
|
||||
snippet deff
|
||||
def ${1:fname}(${2:`indent('.') ? 'self' : ''`}):
|
||||
@@ -106,9 +110,11 @@ snippet docmodule
|
||||
"""
|
||||
snippet debug
|
||||
LOG.debug(self.${1:method_name}.__doc__.strip())
|
||||
snippet pywin
|
||||
import pywin.debugger; pywin.debugger.set_trace()
|
||||
snippet edbg
|
||||
import sys
|
||||
pydevdPath = r"/mnt/data/IDE/eclipse/plugins/org.python.pydev.debug_1.6.5.2011020317/pysrc"
|
||||
pydevdPath = r"/home/share/data/IDE/eclipse/plugins/org.python.pydev.debug_1.6.5.2011020317/pysrc"
|
||||
if not pydevdPath in sys.path:
|
||||
sys.path.append(pydevdPath)
|
||||
import pydevd
|
||||
|
||||
Reference in New Issue
Block a user