mirror of
https://github.com/gryf/.vim.git
synced 2025-12-17 11:30:29 +01:00
Added exclude variable for pep8
changed the way that indent is attached to python files (fuck you iCard) added convinient snippets for rest files
This commit is contained in:
@@ -46,12 +46,17 @@
|
||||
"
|
||||
" }}}
|
||||
|
||||
|
||||
if exists("b:did_pep8_plugin")
|
||||
finish " only load once
|
||||
else
|
||||
let b:did_pep8_plugin = 1
|
||||
endif
|
||||
|
||||
if !exists("g:pep8_exclude")
|
||||
let g:pep8_exclude = []
|
||||
endif
|
||||
|
||||
if !exists("b:did_pep8_init")
|
||||
let b:did_pep8_init = 0
|
||||
|
||||
@@ -76,6 +81,7 @@ class VImPep8(object):
|
||||
self.fname = vim.current.buffer.name
|
||||
self.bufnr = vim.current.buffer.number
|
||||
self.output = []
|
||||
self.exclude_list = vim.eval("g:pep8_exclude")
|
||||
|
||||
def reporter(self, lnum, col, text, check):
|
||||
self.output.append([lnum, col, text])
|
||||
@@ -93,6 +99,13 @@ class VImPep8(object):
|
||||
qf_dict = {}
|
||||
|
||||
for line in self.output:
|
||||
skip = False
|
||||
for exclude_pattern in self.exclude_list:
|
||||
if exclude_pattern in line[2]:
|
||||
skip = True
|
||||
break
|
||||
if skip:
|
||||
continue
|
||||
qf_dict['bufnr'] = self.bufnr
|
||||
qf_dict['lnum'] = line[0]
|
||||
qf_dict['col'] = line[1]
|
||||
|
||||
Reference in New Issue
Block a user