mirror of
https://github.com/gryf/.vim.git
synced 2025-12-17 11:30:29 +01:00
Update of buffers plugin from Eclim project, update taglisttoo plugin
(https://github.com/ervandew/taglisttoo).
This commit is contained in:
2
.vimrc
2
.vimrc
@@ -156,7 +156,7 @@ nnoremap <silent> <leader>ff :call g:Jsbeautify()<cr>:retab!<cr>
|
||||
let g:pydiction_location = '/home/gryf/.vim/after/ftplugin/pytdiction/complete-dict'
|
||||
"}}}
|
||||
"TagListToo {{{2
|
||||
let g:VerticalToolWindowSide = 'right'
|
||||
let g:TaglistTooPosition = "right"
|
||||
nmap <Leader>t :TlistToo<CR>
|
||||
"}}}
|
||||
"Tagbar {{{2
|
||||
|
||||
233
autoload/taglisttoo/__init__.py
Normal file
233
autoload/taglisttoo/__init__.py
Normal file
@@ -0,0 +1,233 @@
|
||||
"""
|
||||
Copyright (c) 2005 - 2011, Eric Van Dewoestine
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use of this software in source and binary forms, with
|
||||
or without modification, are permitted provided that the following
|
||||
conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer in the documentation and/or other
|
||||
materials provided with the distribution.
|
||||
|
||||
* Neither the name of Eric Van Dewoestine nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission of
|
||||
Eric Van Dewoestine.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
"""
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
import tempfile
|
||||
import vim
|
||||
|
||||
def ctags(lang, types, filename):
|
||||
ctags = vim.eval('g:Tlist_Ctags_Cmd')
|
||||
|
||||
startupinfo = None
|
||||
if os.name == 'nt':
|
||||
startupinfo = subprocess.STARTUPINFO()
|
||||
if hasattr(subprocess, '_subprocess'):
|
||||
startupinfo.dwFlags |= subprocess._subprocess.STARTF_USESHOWWINDOW
|
||||
else:
|
||||
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
|
||||
|
||||
stdoutfile = tempfile.TemporaryFile()
|
||||
stderrfile = tempfile.TemporaryFile()
|
||||
try:
|
||||
process = subprocess.Popen(
|
||||
[
|
||||
ctags,
|
||||
'-f', '-',
|
||||
'--format=2',
|
||||
'--excmd=pattern',
|
||||
'--fields=nks',
|
||||
'--sort=no',
|
||||
'--language-force=%s' % lang,
|
||||
'--%s-types=%s' % (lang, types),
|
||||
filename,
|
||||
],
|
||||
stdout=stdoutfile,
|
||||
stderr=stderrfile,
|
||||
stdin=subprocess.PIPE,
|
||||
startupinfo=startupinfo,
|
||||
)
|
||||
|
||||
retcode = process.wait()
|
||||
if retcode != 0:
|
||||
stderrfile.seek(0)
|
||||
return (retcode, stderrfile.read())
|
||||
|
||||
stdoutfile.seek(0)
|
||||
return (retcode, stdoutfile.read())
|
||||
|
||||
finally:
|
||||
stdoutfile.close()
|
||||
stderrfile.close()
|
||||
|
||||
def jsctags(filename):
|
||||
jsctags = vim.eval('g:Tlist_JSctags_Cmd')
|
||||
|
||||
startupinfo = None
|
||||
if os.name == 'nt':
|
||||
startupinfo = subprocess.STARTUPINFO()
|
||||
if hasattr(subprocess, '_subprocess'):
|
||||
startupinfo.dwFlags |= subprocess._subprocess.STARTF_USESHOWWINDOW
|
||||
else:
|
||||
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
|
||||
|
||||
temp = tempfile.mkstemp()[1]
|
||||
try:
|
||||
process = subprocess.Popen(
|
||||
[
|
||||
jsctags,
|
||||
'-o', temp,
|
||||
filename,
|
||||
],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
startupinfo=startupinfo,
|
||||
)
|
||||
|
||||
retcode = process.wait()
|
||||
if retcode != 0:
|
||||
return (retcode, process.communicate()[1].strip())
|
||||
return (retcode, open(temp).read())
|
||||
finally:
|
||||
os.unlink(temp)
|
||||
|
||||
def parse(filename, patterns):
|
||||
f = open(filename, 'r')
|
||||
contents = f.read()
|
||||
f.close()
|
||||
|
||||
for i, info in enumerate(patterns):
|
||||
flags = re.DOTALL | re.MULTILINE
|
||||
if len(info) > 3:
|
||||
if info[3] == 'i':
|
||||
flags |= re.IGNORECASE
|
||||
info = info[:3]
|
||||
patterns[i] = info
|
||||
|
||||
try:
|
||||
info[1] = re.compile(info[1], flags)
|
||||
except:
|
||||
print 'Failed to parse pattern: %s' % info[1]
|
||||
raise
|
||||
|
||||
offsets = FileOffsets.compile(filename)
|
||||
|
||||
results = []
|
||||
for ptype, regex, group in patterns:
|
||||
for match in regex.finditer(contents):
|
||||
start = match.start()
|
||||
end = match.end()
|
||||
line = offsets.offsetToLineColumn(start)[0]
|
||||
col = 1
|
||||
|
||||
if group.isdigit():
|
||||
name = match.group(int(group))
|
||||
else:
|
||||
matched = contents[start:end]
|
||||
name = regex.sub(group, matched)
|
||||
|
||||
first = offsets.getLineStart(line)
|
||||
last = offsets.getLineEnd(offsets.offsetToLineColumn(end)[0])
|
||||
pattern = contents[first:last]
|
||||
|
||||
# pattern cannot span lines
|
||||
if '\n' in pattern:
|
||||
lines = pattern.split('\n')
|
||||
for i, l in enumerate(lines):
|
||||
if name in l:
|
||||
pattern = l
|
||||
line += i
|
||||
col = l.index(name) + 1
|
||||
break
|
||||
|
||||
# still multiline, so just use the first one
|
||||
if '\n' in pattern:
|
||||
pattern = lines[0]
|
||||
elif name in pattern:
|
||||
col = pattern.index(name) + 1
|
||||
|
||||
# remove ctrl-Ms
|
||||
pattern = pattern.replace('\r', '')
|
||||
|
||||
results.append({
|
||||
'type': ptype,
|
||||
'name': name,
|
||||
'pattern': '^%s$' % pattern,
|
||||
'line': line,
|
||||
'column': col,
|
||||
})
|
||||
|
||||
return results
|
||||
|
||||
class FileOffsets(object):
|
||||
def __init__(self):
|
||||
self.offsets = []
|
||||
|
||||
@staticmethod
|
||||
def compile(filename):
|
||||
offsets = FileOffsets()
|
||||
offsets.compileOffsets(filename)
|
||||
return offsets;
|
||||
|
||||
def compileOffsets(self, filename):
|
||||
f = file(filename, 'r')
|
||||
try:
|
||||
self.offsets.append(0);
|
||||
|
||||
offset = 0;
|
||||
for line in f:
|
||||
offset += len(line)
|
||||
self.offsets.append(offset)
|
||||
finally:
|
||||
f.close()
|
||||
|
||||
def offsetToLineColumn(self, offset):
|
||||
if offset <= 0:
|
||||
return [1, 1]
|
||||
|
||||
bot = -1
|
||||
top = len(self.offsets) - 1
|
||||
while (top - bot) > 1:
|
||||
mid = (top + bot) / 2
|
||||
if self.offsets[mid] < offset:
|
||||
bot = mid
|
||||
else:
|
||||
top = mid
|
||||
|
||||
if self.offsets[top] > offset:
|
||||
top -= 1
|
||||
|
||||
line = top + 1
|
||||
column = 1 + offset - self.offsets[top]
|
||||
return [line, column]
|
||||
|
||||
def getLineStart(self, line):
|
||||
return self.offsets[line - 1]
|
||||
|
||||
def getLineEnd(self, line):
|
||||
if len(self.offsets) == line:
|
||||
return self.offsets[len(self.offsets) - 1]
|
||||
|
||||
return self.offsets[line] - 1;
|
||||
BIN
autoload/taglisttoo/__init__.pyc
Normal file
BIN
autoload/taglisttoo/__init__.pyc
Normal file
Binary file not shown.
48
autoload/taglisttoo/lang/ant.vim
Normal file
48
autoload/taglisttoo/lang/ant.vim
Normal file
@@ -0,0 +1,48 @@
|
||||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" License: {{{
|
||||
" Copyright (c) 2005 - 2010, Eric Van Dewoestine
|
||||
" All rights reserved.
|
||||
"
|
||||
" Redistribution and use of this software in source and binary forms, with
|
||||
" or without modification, are permitted provided that the following
|
||||
" conditions are met:
|
||||
"
|
||||
" * Redistributions of source code must retain the above
|
||||
" copyright notice, this list of conditions and the
|
||||
" following disclaimer.
|
||||
"
|
||||
" * Redistributions in binary form must reproduce the above
|
||||
" copyright notice, this list of conditions and the
|
||||
" following disclaimer in the documentation and/or other
|
||||
" materials provided with the distribution.
|
||||
"
|
||||
" * Neither the name of Eric Van Dewoestine nor the names of its
|
||||
" contributors may be used to endorse or promote products derived from
|
||||
" this software without specific prior written permission of
|
||||
" Eric Van Dewoestine.
|
||||
"
|
||||
" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
" IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
" THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
" CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
" EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
" PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
" }}}
|
||||
|
||||
" Parse(file, settings) {{{
|
||||
function! taglisttoo#lang#ant#Parse(file, settings)
|
||||
return taglisttoo#util#Parse(a:file, [
|
||||
\ ['p', "<project\\s+(?:[^>]*)name\\s*=\\s*['\"](.*?)['\"]", 1],
|
||||
\ ['i', "<import\\s+(?:[^>]*)file\\s*=\\s*['\"](.*?)['\"]", 1],
|
||||
\ ['t', "<target\\s+(?:[^>]*)name\\s*=\\s*['\"](.*?)['\"]", 1],
|
||||
\ ['r', "<property\\s+(?:[^>]*)name\\s*=\\s*['\"](.*?)['\"]", 1],
|
||||
\ ])
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
45
autoload/taglisttoo/lang/dtd.vim
Normal file
45
autoload/taglisttoo/lang/dtd.vim
Normal file
@@ -0,0 +1,45 @@
|
||||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" License: {{{
|
||||
" Copyright (c) 2005 - 2010, Eric Van Dewoestine
|
||||
" All rights reserved.
|
||||
"
|
||||
" Redistribution and use of this software in source and binary forms, with
|
||||
" or without modification, are permitted provided that the following
|
||||
" conditions are met:
|
||||
"
|
||||
" * Redistributions of source code must retain the above
|
||||
" copyright notice, this list of conditions and the
|
||||
" following disclaimer.
|
||||
"
|
||||
" * Redistributions in binary form must reproduce the above
|
||||
" copyright notice, this list of conditions and the
|
||||
" following disclaimer in the documentation and/or other
|
||||
" materials provided with the distribution.
|
||||
"
|
||||
" * Neither the name of Eric Van Dewoestine nor the names of its
|
||||
" contributors may be used to endorse or promote products derived from
|
||||
" this software without specific prior written permission of
|
||||
" Eric Van Dewoestine.
|
||||
"
|
||||
" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
" IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
" THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
" CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
" EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
" PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
" }}}
|
||||
|
||||
" Parse(file, settings) {{{
|
||||
function! taglisttoo#lang#dtd#Parse(file, settings)
|
||||
return taglisttoo#util#Parse(a:file, [
|
||||
\ ['e', '^\s*<!ELEMENT\s+(.*?)(\s|\s*$)', 1],
|
||||
\ ])
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
46
autoload/taglisttoo/lang/html.vim
Normal file
46
autoload/taglisttoo/lang/html.vim
Normal file
@@ -0,0 +1,46 @@
|
||||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" License: {{{
|
||||
" Copyright (c) 2005 - 2010, Eric Van Dewoestine
|
||||
" All rights reserved.
|
||||
"
|
||||
" Redistribution and use of this software in source and binary forms, with
|
||||
" or without modification, are permitted provided that the following
|
||||
" conditions are met:
|
||||
"
|
||||
" * Redistributions of source code must retain the above
|
||||
" copyright notice, this list of conditions and the
|
||||
" following disclaimer.
|
||||
"
|
||||
" * Redistributions in binary form must reproduce the above
|
||||
" copyright notice, this list of conditions and the
|
||||
" following disclaimer in the documentation and/or other
|
||||
" materials provided with the distribution.
|
||||
"
|
||||
" * Neither the name of Eric Van Dewoestine nor the names of its
|
||||
" contributors may be used to endorse or promote products derived from
|
||||
" this software without specific prior written permission of
|
||||
" Eric Van Dewoestine.
|
||||
"
|
||||
" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
" IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
" THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
" CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
" EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
" PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
" }}}
|
||||
|
||||
" Parse(file, settings) {{{
|
||||
function! taglisttoo#lang#html#Parse(file, settings)
|
||||
return taglisttoo#util#Parse(a:file, [
|
||||
\ ['a', "<a\\s+[^>]*?name=['\"](.*?)['\"]", 1],
|
||||
\ ['i', "<([a-z]*?)\\s+[^>]*?id=['\"](.*?)['\"]", '\1 \2'],
|
||||
\ ])
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
47
autoload/taglisttoo/lang/htmldjango.vim
Normal file
47
autoload/taglisttoo/lang/htmldjango.vim
Normal file
@@ -0,0 +1,47 @@
|
||||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" License: {{{
|
||||
" Copyright (c) 2005 - 2010, Eric Van Dewoestine
|
||||
" All rights reserved.
|
||||
"
|
||||
" Redistribution and use of this software in source and binary forms, with
|
||||
" or without modification, are permitted provided that the following
|
||||
" conditions are met:
|
||||
"
|
||||
" * Redistributions of source code must retain the above
|
||||
" copyright notice, this list of conditions and the
|
||||
" following disclaimer.
|
||||
"
|
||||
" * Redistributions in binary form must reproduce the above
|
||||
" copyright notice, this list of conditions and the
|
||||
" following disclaimer in the documentation and/or other
|
||||
" materials provided with the distribution.
|
||||
"
|
||||
" * Neither the name of Eric Van Dewoestine nor the names of its
|
||||
" contributors may be used to endorse or promote products derived from
|
||||
" this software without specific prior written permission of
|
||||
" Eric Van Dewoestine.
|
||||
"
|
||||
" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
" IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
" THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
" CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
" EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
" PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
" }}}
|
||||
|
||||
" Parse(file, settings) {{{
|
||||
function! taglisttoo#lang#htmldjango#Parse(file, settings)
|
||||
return taglisttoo#util#Parse(a:file, [
|
||||
\ ['a', "<a\\s+[^>]*?name=['\"](.*?)['\"]", 1],
|
||||
\ ['i', "<([a-z]*?)\\s+[^>]*?id=['\"](.*?)['\"]", '\1 \2'],
|
||||
\ ['b', '\{%?\s*block\s+(\w+)', 1],
|
||||
\ ])
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
48
autoload/taglisttoo/lang/htmljinja.vim
Normal file
48
autoload/taglisttoo/lang/htmljinja.vim
Normal file
@@ -0,0 +1,48 @@
|
||||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" License: {{{
|
||||
" Copyright (c) 2005 - 2010, Eric Van Dewoestine
|
||||
" All rights reserved.
|
||||
"
|
||||
" Redistribution and use of this software in source and binary forms, with
|
||||
" or without modification, are permitted provided that the following
|
||||
" conditions are met:
|
||||
"
|
||||
" * Redistributions of source code must retain the above
|
||||
" copyright notice, this list of conditions and the
|
||||
" following disclaimer.
|
||||
"
|
||||
" * Redistributions in binary form must reproduce the above
|
||||
" copyright notice, this list of conditions and the
|
||||
" following disclaimer in the documentation and/or other
|
||||
" materials provided with the distribution.
|
||||
"
|
||||
" * Neither the name of Eric Van Dewoestine nor the names of its
|
||||
" contributors may be used to endorse or promote products derived from
|
||||
" this software without specific prior written permission of
|
||||
" Eric Van Dewoestine.
|
||||
"
|
||||
" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
" IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
" THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
" CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
" EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
" PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
" }}}
|
||||
|
||||
" Parse(file, settings) {{{
|
||||
function! taglisttoo#lang#htmljinja#Parse(file, settings)
|
||||
return taglisttoo#util#Parse(a:file, [
|
||||
\ ['a', "<a\\s+[^>]*?name=['\"](.*?)['\"]", 1],
|
||||
\ ['i', "<([a-z]*?)\\s+[^>]*?id=['\"](.*?)['\"]", '\1 \2'],
|
||||
\ ['b', '\{%?\s*block\s+(\w+)', 1],
|
||||
\ ['m', '\{%-?\s*macro\s+(\w+)\s*\(', 1],
|
||||
\ ])
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
90
autoload/taglisttoo/lang/java.vim
Normal file
90
autoload/taglisttoo/lang/java.vim
Normal file
@@ -0,0 +1,90 @@
|
||||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" License: {{{
|
||||
" Copyright (c) 2005 - 2010, Eric Van Dewoestine
|
||||
" All rights reserved.
|
||||
"
|
||||
" Redistribution and use of this software in source and binary forms, with
|
||||
" or without modification, are permitted provided that the following
|
||||
" conditions are met:
|
||||
"
|
||||
" * Redistributions of source code must retain the above
|
||||
" copyright notice, this list of conditions and the
|
||||
" following disclaimer.
|
||||
"
|
||||
" * Redistributions in binary form must reproduce the above
|
||||
" copyright notice, this list of conditions and the
|
||||
" following disclaimer in the documentation and/or other
|
||||
" materials provided with the distribution.
|
||||
"
|
||||
" * Neither the name of Eric Van Dewoestine nor the names of its
|
||||
" contributors may be used to endorse or promote products derived from
|
||||
" this software without specific prior written permission of
|
||||
" Eric Van Dewoestine.
|
||||
"
|
||||
" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
" IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
" THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
" CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
" EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
" PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
" }}}
|
||||
|
||||
" Format(types, tags) {{{
|
||||
function! taglisttoo#lang#java#Format(types, tags)
|
||||
let formatter = taglisttoo#util#Formatter(a:tags)
|
||||
call formatter.filename()
|
||||
|
||||
let package = filter(copy(a:tags), 'v:val.type == "p"')
|
||||
call formatter.format(a:types['p'], package, '')
|
||||
|
||||
let classes = filter(copy(a:tags), 'v:val.type == "c"')
|
||||
|
||||
" sort classes alphabetically except for the primary containing class.
|
||||
if len(classes) > 1 && g:Tlist_Sort_Type == 'name'
|
||||
let classes = [classes[0]] + sort(classes[1:], 'taglisttoo#util#SortTags')
|
||||
endif
|
||||
|
||||
for class in classes
|
||||
call formatter.blank()
|
||||
|
||||
let visibility = taglisttoo#util#GetVisibility(class)
|
||||
call formatter.heading(a:types['c'], class, '')
|
||||
|
||||
let fields = filter(copy(a:tags),
|
||||
\ 'v:val.type == "f" && v:val.parent =~ "class:.*\\<" . class.name . "$"')
|
||||
call formatter.format(a:types['f'], fields, "\t")
|
||||
|
||||
let methods = filter(copy(a:tags),
|
||||
\ 'v:val.type == "m" && v:val.parent =~ "class:.*\\<" . class.name . "$"')
|
||||
call formatter.format(a:types['m'], methods, "\t")
|
||||
endfor
|
||||
|
||||
let interfaces = filter(copy(a:tags), 'v:val.type == "i"')
|
||||
if g:Tlist_Sort_Type == 'name'
|
||||
call sort(interfaces, 'taglisttoo#util#SortTags')
|
||||
endif
|
||||
for interface in interfaces
|
||||
call formatter.blank()
|
||||
|
||||
let visibility = taglisttoo#util#GetVisibility(interface)
|
||||
call formatter.heading(a:types['i'], interface, '')
|
||||
|
||||
let fields = filter(copy(a:tags),
|
||||
\ 'v:val.type == "f" && v:val.parent =~ "interface:.*\\<" . interface.name . "$"')
|
||||
call formatter.format(a:types['f'], fields, "\t")
|
||||
|
||||
let methods = filter(copy(a:tags),
|
||||
\ 'v:val.type == "m" && v:val.parent =~ "interface:.*\\<" . interface.name . "$"')
|
||||
call formatter.format(a:types['m'], methods, "\t")
|
||||
endfor
|
||||
|
||||
return formatter
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
303
autoload/taglisttoo/lang/javascript.vim
Normal file
303
autoload/taglisttoo/lang/javascript.vim
Normal file
@@ -0,0 +1,303 @@
|
||||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" License: {{{
|
||||
" Copyright (c) 2005 - 2011, Eric Van Dewoestine
|
||||
" All rights reserved.
|
||||
"
|
||||
" Redistribution and use of this software in source and binary forms, with
|
||||
" or without modification, are permitted provided that the following
|
||||
" conditions are met:
|
||||
"
|
||||
" * Redistributions of source code must retain the above
|
||||
" copyright notice, this list of conditions and the
|
||||
" following disclaimer.
|
||||
"
|
||||
" * Redistributions in binary form must reproduce the above
|
||||
" copyright notice, this list of conditions and the
|
||||
" following disclaimer in the documentation and/or other
|
||||
" materials provided with the distribution.
|
||||
"
|
||||
" * Neither the name of Eric Van Dewoestine nor the names of its
|
||||
" contributors may be used to endorse or promote products derived from
|
||||
" this software without specific prior written permission of
|
||||
" Eric Van Dewoestine.
|
||||
"
|
||||
" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
" IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
" THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
" CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
" EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
" PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
" }}}
|
||||
|
||||
" Global Variabls {{{
|
||||
if !exists('g:TaglistTooJSctags')
|
||||
let g:TaglistTooJSctags = 1
|
||||
endif
|
||||
" }}}
|
||||
|
||||
function! taglisttoo#lang#javascript#Format(types, tags) " {{{
|
||||
if !g:TaglistTooJSctags || !exists('g:Tlist_JSctags_Cmd')
|
||||
return s:FormatRegexResults(a:types, a:tags)
|
||||
endif
|
||||
return s:FormatJSctagsResults(a:types, a:tags)
|
||||
endfunction " }}}
|
||||
|
||||
function! s:FormatJSctagsResults(types, tags) " {{{
|
||||
let formatter = taglisttoo#util#Formatter(a:tags)
|
||||
call formatter.filename()
|
||||
|
||||
let functions = filter(copy(a:tags), 'v:val.type == "f" && v:val.namespace == ""')
|
||||
if len(functions) > 0
|
||||
call formatter.blank()
|
||||
call formatter.format(a:types['f'], functions, '')
|
||||
endif
|
||||
|
||||
let members = filter(copy(a:tags), 'v:val.name == "includeScript"')
|
||||
|
||||
let objects = filter(copy(a:tags), 'v:val.jstype == "Object"')
|
||||
for object in objects
|
||||
if object.namespace != ''
|
||||
let object.name = object.namespace . '.' . object.name
|
||||
endif
|
||||
|
||||
call formatter.blank()
|
||||
call formatter.heading(a:types['o'], object, '')
|
||||
|
||||
let members = filter(copy(a:tags), 'v:val.type == "f" && v:val.namespace == object.name')
|
||||
call formatter.format(a:types['f'], members, "\t")
|
||||
endfor
|
||||
|
||||
return formatter
|
||||
endfunction " }}}
|
||||
|
||||
function! s:FormatRegexResults(types, tags) " {{{
|
||||
let pos = getpos('.')
|
||||
|
||||
let formatter = taglisttoo#util#Formatter(a:tags)
|
||||
call formatter.filename()
|
||||
|
||||
let object_contents = []
|
||||
|
||||
let objects = filter(copy(a:tags), 'v:val.type == "o"')
|
||||
let members = filter(copy(a:tags), 'v:val.type == "m"')
|
||||
let functions = filter(copy(a:tags),
|
||||
\ 'v:val.type == "f" && v:val.pattern =~ "\\<function\\>"')
|
||||
let object_bounds = {}
|
||||
for object in objects
|
||||
let object_start = object.line
|
||||
call cursor(object_start, 1)
|
||||
while search('{', 'W') && s:SkipComments()
|
||||
" no op
|
||||
endwhile
|
||||
let object_end = searchpair('{', '', '}', 'W', 's:SkipComments()')
|
||||
|
||||
let methods = []
|
||||
let indexes = []
|
||||
let index = 0
|
||||
for fct in members
|
||||
if len(fct) > 3
|
||||
let fct_line = fct.line
|
||||
if fct_line > object_start && fct_line < object_end
|
||||
call add(methods, fct)
|
||||
elseif fct_line > object_end
|
||||
break
|
||||
elseif fct_line < object_end
|
||||
call add(indexes, index)
|
||||
endif
|
||||
endif
|
||||
let index += 1
|
||||
endfor
|
||||
call reverse(indexes)
|
||||
for i in indexes
|
||||
call remove(members, i)
|
||||
endfor
|
||||
|
||||
let indexes = []
|
||||
let index = 0
|
||||
for fct in functions
|
||||
if len(fct) > 3
|
||||
let fct_line = fct.line
|
||||
if fct_line > object_start && fct_line < object_end
|
||||
call add(methods, fct)
|
||||
call add(indexes, index)
|
||||
elseif fct_line == object_start
|
||||
call add(indexes, index)
|
||||
elseif fct_line > object_end
|
||||
break
|
||||
endif
|
||||
endif
|
||||
let index += 1
|
||||
endfor
|
||||
call reverse(indexes)
|
||||
for i in indexes
|
||||
call remove(functions, i)
|
||||
endfor
|
||||
|
||||
if len(methods) > 0
|
||||
let parent_object = s:GetParentObject(
|
||||
\ object_contents, object_bounds, object_start, object_end)
|
||||
" remove methods from the parent if necessary
|
||||
if len(parent_object)
|
||||
call filter(parent_object.methods, 'index(methods, v:val) == -1')
|
||||
endif
|
||||
let object_bounds[string(object)] = [object_start, object_end]
|
||||
call add(object_contents, {'object': object, 'methods': methods})
|
||||
endif
|
||||
endfor
|
||||
|
||||
if len(functions) > 0
|
||||
call formatter.blank()
|
||||
call formatter.format(a:types['f'], functions, '')
|
||||
endif
|
||||
|
||||
if g:Tlist_Sort_Type == 'name'
|
||||
call sort(object_contents, function('s:ObjectComparator'))
|
||||
endif
|
||||
|
||||
for object_content in object_contents
|
||||
call formatter.blank()
|
||||
call formatter.heading(a:types['o'], object_content.object, '')
|
||||
call formatter.format(a:types['f'], object_content.methods, "\t")
|
||||
endfor
|
||||
|
||||
call setpos('.', pos)
|
||||
|
||||
return formatter
|
||||
endfunction " }}}
|
||||
|
||||
function! taglisttoo#lang#javascript#Parse(file, settings) " {{{
|
||||
if g:TaglistTooJSctags && !exists('g:Tlist_JSctags_Cmd')
|
||||
if executable('jsctags')
|
||||
let g:Tlist_JSctags_Cmd = 'jsctags'
|
||||
elseif executable('javascripttags')
|
||||
let g:Tlist_JSctags_Cmd = 'javascripttags'
|
||||
endif
|
||||
endif
|
||||
|
||||
if !g:TaglistTooJSctags || !exists('g:Tlist_JSctags_Cmd')
|
||||
return s:ParseRegex(a:file, a:settings)
|
||||
endif
|
||||
return s:ParseJSctags(a:file, a:settings)
|
||||
endfunction " }}}
|
||||
|
||||
function! s:ParseJSctags(file, settings) " {{{
|
||||
python << PYTHONEOF
|
||||
retcode, result = taglisttoo.jsctags(vim.eval('a:file'))
|
||||
vim.command('let retcode = %i' % retcode)
|
||||
vim.command("let result = '%s'" % result.replace("'", "''"))
|
||||
PYTHONEOF
|
||||
|
||||
if retcode
|
||||
call s:EchoError('jsctags failed with error code: ' . retcode)
|
||||
return
|
||||
endif
|
||||
|
||||
if has('win32') || has('win64') || has('win32unix')
|
||||
let result = substitute(result, "\<c-m>\n", '\n', 'g')
|
||||
endif
|
||||
|
||||
let results = split(result, '\n')
|
||||
while len(results) && results[0] =~ '^!_'
|
||||
call remove(results, 0)
|
||||
endwhile
|
||||
|
||||
let types = keys(a:settings.tags)
|
||||
let parsed_results = []
|
||||
for result in results
|
||||
" some results use <lnum>G;" (e.g. 1956G;") as the pattern... skip those
|
||||
" for now since taglist expects actual patterns.
|
||||
if result !~ '\t\/\^'
|
||||
continue
|
||||
endif
|
||||
|
||||
let pre = substitute(result, '\(.\{-}\)\t\/\^.*', '\1', '')
|
||||
let pattern = substitute(result, '.\{-}\(\/\^.*\/;"\).*', '\1', '')
|
||||
let post = substitute(result, '.\{-}\/\^.*\/;"\t', '', '')
|
||||
|
||||
let [name, filename] = split(pre, '\t')
|
||||
let parts = split(post, '\t')
|
||||
let [type, line_str] = parts[:1]
|
||||
exec 'let line = ' . substitute(line_str, 'lineno:', '', '')
|
||||
let pattern = substitute(pattern, '^/\(.*\)/;"$', '\1', '')
|
||||
|
||||
let jstypes = filter(copy(parts), 'v:val =~ "^type:"')
|
||||
let namespaces = filter(copy(parts), 'v:val =~ "^namespace:"')
|
||||
|
||||
let jstype = len(jstypes) ? substitute(jstypes[0], '^type:', '', '') : ''
|
||||
let ns = len(namespaces) ? substitute(namespaces[0], '^namespace:', '', '') : ''
|
||||
|
||||
call add(parsed_results, {
|
||||
\ 'type': type,
|
||||
\ 'name': name,
|
||||
\ 'pattern': pattern,
|
||||
\ 'line': line,
|
||||
\ 'namespace': ns,
|
||||
\ 'jstype': jstype,
|
||||
\ })
|
||||
endfor
|
||||
|
||||
return parsed_results
|
||||
endfunction " }}}
|
||||
|
||||
function! s:ParseRegex(file, settings) " {{{
|
||||
let patterns = []
|
||||
" Match Objects/Classes
|
||||
call add(patterns, ['o', '([A-Za-z0-9_.]+)\s*=\s*\{(\s*[^}]|$)', 1])
|
||||
|
||||
" prototype.js has Object.extend to extend existing objects.
|
||||
call add(patterns, ['o', '(?:var\s+)?\b([A-Z][A-Za-z0-9_.]+)\s*=\s*Object\.extend\s*\(', 1])
|
||||
call add(patterns, ['o', '\bObject\.extend\s*\(\b([A-Z][A-Za-z0-9_.]+)\s*,\s*\{', 1])
|
||||
|
||||
" mootools uses 'new Class'
|
||||
call add(patterns, ['o', '(?:var\s+)?\b([A-Z][A-Za-z0-9_.]+)\s*=\s*new\s+Class\s*\(', 1])
|
||||
|
||||
" firebug uses extend
|
||||
call add(patterns, ['o', '(?:var\s+)?\b([A-Z][A-Za-z0-9_.]+)\s*=\s*extend\s*\(', 1])
|
||||
|
||||
" vimperator uses function MyClass ()
|
||||
call add(patterns, ['o', 'function\s+\b([A-Z][A-Za-z0-9_.]+)\s*\(', 1])
|
||||
" vimperator uses var = (function()
|
||||
call add(patterns, ['o', '([A-Za-z0-9_.]+)\s*=\s*\(function\s*\(', 1])
|
||||
|
||||
" Match Functions
|
||||
call add(patterns, ['f', '\bfunction\s+([a-zA-Z0-9_.\$]+?)\s*\(', 1])
|
||||
call add(patterns, ['f', '([a-zA-Z0-9_.\$]+?)\s*=\s*function\s*\(', 1])
|
||||
|
||||
" Match Members
|
||||
call add(patterns, ['m', '\b([a-zA-Z0-9_.\$]+?)\s*:\s*function\s*\(', 1])
|
||||
return taglisttoo#util#Parse(a:file, patterns)
|
||||
endfunction " }}}
|
||||
|
||||
function s:ObjectComparator(o1, o2) " {{{
|
||||
let n1 = a:o1['object'].name
|
||||
let n2 = a:o2['object'].name
|
||||
return n1 == n2 ? 0 : n1 > n2 ? 1 : -1
|
||||
endfunction " }}}
|
||||
|
||||
function s:SkipComments() " {{{
|
||||
let synname = synIDattr(synID(line('.'), col('.'), 1), "name")
|
||||
return synname =~? '\(comment\|string\)'
|
||||
endfunction " }}}
|
||||
|
||||
function s:GetParentObject(objects, bounds, start, end) " {{{
|
||||
for key in keys(a:bounds)
|
||||
let range = a:bounds[key]
|
||||
if range[0] < a:start && range[1] > a:end
|
||||
for object_content in a:objects
|
||||
if string(object_content.object) == key
|
||||
return object_content
|
||||
endif
|
||||
endfor
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
return {}
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
43
autoload/taglisttoo/lang/jproperties.vim
Normal file
43
autoload/taglisttoo/lang/jproperties.vim
Normal file
@@ -0,0 +1,43 @@
|
||||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" License: {{{
|
||||
" Copyright (c) 2005 - 2010, Eric Van Dewoestine
|
||||
" All rights reserved.
|
||||
"
|
||||
" Redistribution and use of this software in source and binary forms, with
|
||||
" or without modification, are permitted provided that the following
|
||||
" conditions are met:
|
||||
"
|
||||
" * Redistributions of source code must retain the above
|
||||
" copyright notice, this list of conditions and the
|
||||
" following disclaimer.
|
||||
"
|
||||
" * Redistributions in binary form must reproduce the above
|
||||
" copyright notice, this list of conditions and the
|
||||
" following disclaimer in the documentation and/or other
|
||||
" materials provided with the distribution.
|
||||
"
|
||||
" * Neither the name of Eric Van Dewoestine nor the names of its
|
||||
" contributors may be used to endorse or promote products derived from
|
||||
" this software without specific prior written permission of
|
||||
" Eric Van Dewoestine.
|
||||
"
|
||||
" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
" IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
" THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
" CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
" EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
" PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
" }}}
|
||||
|
||||
" Parse(file, settings) {{{
|
||||
function! taglisttoo#lang#jproperties#Parse(file, settings)
|
||||
return taglisttoo#util#Parse(a:file, [['p', '^\s*([^#]+?)\s*=', 1]])
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
48
autoload/taglisttoo/lang/log4j.vim
Normal file
48
autoload/taglisttoo/lang/log4j.vim
Normal file
@@ -0,0 +1,48 @@
|
||||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" License: {{{
|
||||
" Copyright (c) 2005 - 2010, Eric Van Dewoestine
|
||||
" All rights reserved.
|
||||
"
|
||||
" Redistribution and use of this software in source and binary forms, with
|
||||
" or without modification, are permitted provided that the following
|
||||
" conditions are met:
|
||||
"
|
||||
" * Redistributions of source code must retain the above
|
||||
" copyright notice, this list of conditions and the
|
||||
" following disclaimer.
|
||||
"
|
||||
" * Redistributions in binary form must reproduce the above
|
||||
" copyright notice, this list of conditions and the
|
||||
" following disclaimer in the documentation and/or other
|
||||
" materials provided with the distribution.
|
||||
"
|
||||
" * Neither the name of Eric Van Dewoestine nor the names of its
|
||||
" contributors may be used to endorse or promote products derived from
|
||||
" this software without specific prior written permission of
|
||||
" Eric Van Dewoestine.
|
||||
"
|
||||
" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
" IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
" THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
" CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
" EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
" PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
" }}}
|
||||
|
||||
" Parse(file, settings) {{{
|
||||
function! taglisttoo#lang#log4j#Parse(file, settings)
|
||||
return taglisttoo#util#Parse(a:file, [
|
||||
\ ['a', "<appender\\s+[^>]*?name=['\"](.*?)['\"]", 1],
|
||||
\ ['c', "<category\\s+[^>]*?name=['\"](.*?)['\"]", 1],
|
||||
\ ['l', "<logger\\s+[^>]*?name=['\"](.*?)['\"]", 1],
|
||||
\ ['r', "<(root)\\s*>", 1],
|
||||
\ ])
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
142
autoload/taglisttoo/lang/php.vim
Normal file
142
autoload/taglisttoo/lang/php.vim
Normal file
@@ -0,0 +1,142 @@
|
||||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" License: {{{
|
||||
" Copyright (c) 2005 - 2010, Eric Van Dewoestine
|
||||
" All rights reserved.
|
||||
"
|
||||
" Redistribution and use of this software in source and binary forms, with
|
||||
" or without modification, are permitted provided that the following
|
||||
" conditions are met:
|
||||
"
|
||||
" * Redistributions of source code must retain the above
|
||||
" copyright notice, this list of conditions and the
|
||||
" following disclaimer.
|
||||
"
|
||||
" * Redistributions in binary form must reproduce the above
|
||||
" copyright notice, this list of conditions and the
|
||||
" following disclaimer in the documentation and/or other
|
||||
" materials provided with the distribution.
|
||||
"
|
||||
" * Neither the name of Eric Van Dewoestine nor the names of its
|
||||
" contributors may be used to endorse or promote products derived from
|
||||
" this software without specific prior written permission of
|
||||
" Eric Van Dewoestine.
|
||||
"
|
||||
" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
" IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
" THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
" CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
" EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
" PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
" }}}
|
||||
|
||||
" Format(types, tags) {{{
|
||||
function! taglisttoo#lang#php#Format(types, tags)
|
||||
let pos = getpos('.')
|
||||
|
||||
let formatter = taglisttoo#util#Formatter(a:tags)
|
||||
call formatter.filename()
|
||||
|
||||
let top_functions = filter(copy(a:tags), 'v:val.type == "f"')
|
||||
|
||||
let class_contents = []
|
||||
let classes = filter(copy(a:tags), 'v:val.type == "c"')
|
||||
if g:Tlist_Sort_Type == 'name'
|
||||
call sort(classes, 'taglisttoo#util#SortTags')
|
||||
endif
|
||||
for class in classes
|
||||
let object_start = class.line
|
||||
call cursor(object_start, 1)
|
||||
call search('{', 'W')
|
||||
let object_end = searchpair('{', '', '}', 'W')
|
||||
|
||||
let functions = []
|
||||
let indexes = []
|
||||
let index = 0
|
||||
for fct in top_functions
|
||||
if len(fct) > 3
|
||||
let fct_line = fct.line
|
||||
if fct_line > object_start && fct_line < object_end
|
||||
call add(functions, fct)
|
||||
call add(indexes, index)
|
||||
endif
|
||||
endif
|
||||
let index += 1
|
||||
endfor
|
||||
call reverse(indexes)
|
||||
for i in indexes
|
||||
call remove(top_functions, i)
|
||||
endfor
|
||||
|
||||
call add(class_contents, {'class': class, 'functions': functions})
|
||||
endfor
|
||||
|
||||
let interface_contents = []
|
||||
let interfaces = filter(copy(a:tags), 'v:val.type == "i"')
|
||||
if g:Tlist_Sort_Type == 'name'
|
||||
call sort(interfaces, 'taglisttoo#util#SortTags')
|
||||
endif
|
||||
for interface in interfaces
|
||||
let object_start = interface.line
|
||||
call cursor(object_start, 1)
|
||||
call search('{', 'W')
|
||||
let object_end = searchpair('{', '', '}', 'W')
|
||||
|
||||
let functions = []
|
||||
let indexes = []
|
||||
let index = 0
|
||||
for fct in top_functions
|
||||
if len(fct) > 3
|
||||
let fct_line = fct.line
|
||||
if fct_line > object_start && fct_line < object_end
|
||||
call add(functions, fct)
|
||||
call add(indexes, index)
|
||||
endif
|
||||
endif
|
||||
let index += 1
|
||||
endfor
|
||||
call reverse(indexes)
|
||||
for i in indexes
|
||||
call remove(top_functions, i)
|
||||
endfor
|
||||
|
||||
call add(interface_contents, {'interface': interface, 'functions': functions})
|
||||
endfor
|
||||
|
||||
if len(top_functions) > 0
|
||||
call formatter.blank()
|
||||
call formatter.format(a:types['f'], top_functions, '')
|
||||
endif
|
||||
|
||||
for class_content in class_contents
|
||||
call formatter.blank()
|
||||
call formatter.heading(a:types['c'], class_content.class, '')
|
||||
call formatter.format(a:types['f'], class_content.functions, "\t")
|
||||
endfor
|
||||
|
||||
for interface_content in interface_contents
|
||||
call formatter.blank()
|
||||
call formatter.heading(a:types['i'], interface_content.interface, '')
|
||||
call formatter.format(a:types['f'], interface_content.functions, "\t")
|
||||
endfor
|
||||
|
||||
call setpos('.', pos)
|
||||
|
||||
return formatter
|
||||
endfunction " }}}
|
||||
|
||||
" Parse(file, settings) {{{
|
||||
function! taglisttoo#lang#php#Parse(file, settings)
|
||||
return taglisttoo#util#Parse(a:file, [
|
||||
\ ['f', '\bfunction\s+([a-zA-Z0-9_]+)\s*\(', 1],
|
||||
\ ['c', '\bclass\s+([a-zA-Z0-9_]+)', 1],
|
||||
\ ['i', '\binterface\s+([a-zA-Z0-9_]+)', 1],
|
||||
\ ])
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
66
autoload/taglisttoo/lang/python.vim
Normal file
66
autoload/taglisttoo/lang/python.vim
Normal file
@@ -0,0 +1,66 @@
|
||||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" License: {{{
|
||||
" Copyright (c) 2005 - 2010, Eric Van Dewoestine
|
||||
" All rights reserved.
|
||||
"
|
||||
" Redistribution and use of this software in source and binary forms, with
|
||||
" or without modification, are permitted provided that the following
|
||||
" conditions are met:
|
||||
"
|
||||
" * Redistributions of source code must retain the above
|
||||
" copyright notice, this list of conditions and the
|
||||
" following disclaimer.
|
||||
"
|
||||
" * Redistributions in binary form must reproduce the above
|
||||
" copyright notice, this list of conditions and the
|
||||
" following disclaimer in the documentation and/or other
|
||||
" materials provided with the distribution.
|
||||
"
|
||||
" * Neither the name of Eric Van Dewoestine nor the names of its
|
||||
" contributors may be used to endorse or promote products derived from
|
||||
" this software without specific prior written permission of
|
||||
" Eric Van Dewoestine.
|
||||
"
|
||||
" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
" IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
" THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
" CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
" EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
" PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
" }}}
|
||||
|
||||
" Format(types, tags) {{{
|
||||
function! taglisttoo#lang#python#Format(types, tags)
|
||||
let formatter = taglisttoo#util#Formatter(a:tags)
|
||||
call formatter.filename()
|
||||
|
||||
let functions = filter(copy(a:tags), 'v:val.type == "f"')
|
||||
if len(functions)
|
||||
call formatter.blank()
|
||||
call formatter.format(a:types['f'], functions, '')
|
||||
endif
|
||||
|
||||
let classes = filter(copy(a:tags), 'v:val.type == "c"')
|
||||
if g:Tlist_Sort_Type == 'name'
|
||||
call sort(classes, 'taglisttoo#util#SortTags')
|
||||
endif
|
||||
|
||||
for class in classes
|
||||
call formatter.blank()
|
||||
call formatter.heading(a:types['c'], class, '')
|
||||
|
||||
let members = filter(copy(a:tags),
|
||||
\ 'v:val.type == "m" && v:val.parent == "class:" . class.name')
|
||||
call formatter.format(a:types['m'], members, "\t")
|
||||
endfor
|
||||
|
||||
return formatter
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
46
autoload/taglisttoo/lang/rst.vim
Normal file
46
autoload/taglisttoo/lang/rst.vim
Normal file
@@ -0,0 +1,46 @@
|
||||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" License: {{{
|
||||
" Copyright (c) 2005 - 2010, Eric Van Dewoestine
|
||||
" All rights reserved.
|
||||
"
|
||||
" Redistribution and use of this software in source and binary forms, with
|
||||
" or without modification, are permitted provided that the following
|
||||
" conditions are met:
|
||||
"
|
||||
" * Redistributions of source code must retain the above
|
||||
" copyright notice, this list of conditions and the
|
||||
" following disclaimer.
|
||||
"
|
||||
" * Redistributions in binary form must reproduce the above
|
||||
" copyright notice, this list of conditions and the
|
||||
" following disclaimer in the documentation and/or other
|
||||
" materials provided with the distribution.
|
||||
"
|
||||
" * Neither the name of Eric Van Dewoestine nor the names of its
|
||||
" contributors may be used to endorse or promote products derived from
|
||||
" this software without specific prior written permission of
|
||||
" Eric Van Dewoestine.
|
||||
"
|
||||
" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
" IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
" THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
" CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
" EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
" PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
" }}}
|
||||
|
||||
" Parse(file, settings) {{{
|
||||
function! taglisttoo#lang#rst#Parse(file, settings)
|
||||
return taglisttoo#util#Parse(a:file, [
|
||||
\ ['a', '^\s*\.\.\s_((\\:|[^:])+):\s*\n', 1],
|
||||
\ ['s', '^([^\n]+)\n[=^-]{4,}', 1],
|
||||
\ ])
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
57
autoload/taglisttoo/lang/sql.vim
Normal file
57
autoload/taglisttoo/lang/sql.vim
Normal file
@@ -0,0 +1,57 @@
|
||||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" License: {{{
|
||||
" Copyright (c) 2005 - 2010, Eric Van Dewoestine
|
||||
" All rights reserved.
|
||||
"
|
||||
" Redistribution and use of this software in source and binary forms, with
|
||||
" or without modification, are permitted provided that the following
|
||||
" conditions are met:
|
||||
"
|
||||
" * Redistributions of source code must retain the above
|
||||
" copyright notice, this list of conditions and the
|
||||
" following disclaimer.
|
||||
"
|
||||
" * Redistributions in binary form must reproduce the above
|
||||
" copyright notice, this list of conditions and the
|
||||
" following disclaimer in the documentation and/or other
|
||||
" materials provided with the distribution.
|
||||
"
|
||||
" * Neither the name of Eric Van Dewoestine nor the names of its
|
||||
" contributors may be used to endorse or promote products derived from
|
||||
" this software without specific prior written permission of
|
||||
" Eric Van Dewoestine.
|
||||
"
|
||||
" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
" IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
" THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
" CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
" EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
" PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
" }}}
|
||||
|
||||
" Parse(file, settings) {{{
|
||||
function! taglisttoo#lang#sql#Parse(file, settings)
|
||||
return taglisttoo#util#Parse(a:file, [
|
||||
\ ['g', 'create\s+(?:group|role)\s+([a-zA-Z0-9_.]+)', 1, 'i'],
|
||||
\ ['u', 'create\s+user\s+([a-zA-Z0-9_.]+)', 1, 'i'],
|
||||
\ ['p', 'create\s+(?:tablespace|dbspace)\s+([a-zA-Z0-9_.]+)', 1, 'i'],
|
||||
\ ['s', 'create\s+schema\s+([a-zA-Z0-9_.]+)', 1, 'i'],
|
||||
\ ['t', 'create\s+(?:temporary\s+)?table\s+(?:if\s+not\s+exists\s+)?[`]?([a-zA-Z0-9_.]+)[`]?', 1, 'i'],
|
||||
\ ['v', 'create\s+(?:or\s+replace\s+)?view\s+([a-zA-Z0-9_.]+)', 1, 'i'],
|
||||
\ ['q', 'create\s+sequence\s+([a-zA-Z0-9_.]+)', 1, 'i'],
|
||||
\ ['x', 'create\s+(?:or\s+replace\s+)?trigger\s+([a-zA-Z0-9_.]+)', 1, 'i'],
|
||||
\ ['f', 'create\s+(?:or\s+replace\s+)?function\s+([a-zA-Z0-9_.]+)', 1, 'i'],
|
||||
\ ['c', 'create\s+(?:or\s+replace\s+)?procedure\s+([a-zA-Z0-9_.]+)', 1, 'i'],
|
||||
\ ['r', "exec\\s+sp_addrole\\s+['\"]([a-zA-Z0-9_.]+)['\"]", 1, 'i'],
|
||||
\ ['m', "exec\\s+sp_addlogin\\s+@loginname=['\"](.*?)['\"]", 1, 'i'],
|
||||
\ ['z', 'alter\s+database.*add\s+filegroup\s+([a-zA-Z0-9_.]+)', 1, 'i'],
|
||||
\ ])
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
46
autoload/taglisttoo/lang/xsd.vim
Normal file
46
autoload/taglisttoo/lang/xsd.vim
Normal file
@@ -0,0 +1,46 @@
|
||||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" License: {{{
|
||||
" Copyright (c) 2005 - 2010, Eric Van Dewoestine
|
||||
" All rights reserved.
|
||||
"
|
||||
" Redistribution and use of this software in source and binary forms, with
|
||||
" or without modification, are permitted provided that the following
|
||||
" conditions are met:
|
||||
"
|
||||
" * Redistributions of source code must retain the above
|
||||
" copyright notice, this list of conditions and the
|
||||
" following disclaimer.
|
||||
"
|
||||
" * Redistributions in binary form must reproduce the above
|
||||
" copyright notice, this list of conditions and the
|
||||
" following disclaimer in the documentation and/or other
|
||||
" materials provided with the distribution.
|
||||
"
|
||||
" * Neither the name of Eric Van Dewoestine nor the names of its
|
||||
" contributors may be used to endorse or promote products derived from
|
||||
" this software without specific prior written permission of
|
||||
" Eric Van Dewoestine.
|
||||
"
|
||||
" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
" IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
" THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
" CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
" EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
" PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
" }}}
|
||||
|
||||
" Parse(file, settings) {{{
|
||||
function! taglisttoo#lang#xsd#Parse(file, settings)
|
||||
return taglisttoo#util#Parse(a:file, [
|
||||
\ ['e', "<(?:xs[d]?:)?element\\s+[^>]*?name=['\"](.*?)['\"]", 1],
|
||||
\ ['t', "<(?:xs[d]?:)?complexType\\s+[^>]*?name=['\"](.*?)['\"]", 1],
|
||||
\ ])
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
1252
autoload/taglisttoo/taglist.vim
Normal file
1252
autoload/taglisttoo/taglist.vim
Normal file
File diff suppressed because it is too large
Load Diff
131
autoload/taglisttoo/util.vim
Normal file
131
autoload/taglisttoo/util.vim
Normal file
@@ -0,0 +1,131 @@
|
||||
" Author: Eric Van Dewoestine
|
||||
"
|
||||
" License: {{{
|
||||
" Copyright (c) 2005 - 2011, Eric Van Dewoestine
|
||||
" All rights reserved.
|
||||
"
|
||||
" Redistribution and use of this software in source and binary forms, with
|
||||
" or without modification, are permitted provided that the following
|
||||
" conditions are met:
|
||||
"
|
||||
" * Redistributions of source code must retain the above
|
||||
" copyright notice, this list of conditions and the
|
||||
" following disclaimer.
|
||||
"
|
||||
" * Redistributions in binary form must reproduce the above
|
||||
" copyright notice, this list of conditions and the
|
||||
" following disclaimer in the documentation and/or other
|
||||
" materials provided with the distribution.
|
||||
"
|
||||
" * Neither the name of Eric Van Dewoestine nor the names of its
|
||||
" contributors may be used to endorse or promote products derived from
|
||||
" this software without specific prior written permission of
|
||||
" Eric Van Dewoestine.
|
||||
"
|
||||
" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
" IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
" THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
" CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
" EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
" PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
" }}}
|
||||
|
||||
function! taglisttoo#util#Formatter(tags) " {{{
|
||||
let formatter = {'lines': [], 'content': [], 'syntax': [], 'tags': a:tags}
|
||||
|
||||
function! formatter.filename() dict " {{{
|
||||
call add(self.content, expand('%:t'))
|
||||
call add(self.lines, -1)
|
||||
endfunction " }}}
|
||||
|
||||
function! formatter.format(type, values, indent) dict " {{{
|
||||
if len(a:values) > 0
|
||||
if g:Tlist_Sort_Type == 'name'
|
||||
call sort(a:values, 'taglisttoo#util#SortTags')
|
||||
endif
|
||||
|
||||
call self.heading(a:type, {}, a:indent)
|
||||
|
||||
for value in a:values
|
||||
let visibility = taglisttoo#util#GetVisibility(value)
|
||||
call add(self.content, "\t" . a:indent . visibility . value.name)
|
||||
call add(self.lines, index(self.tags, value))
|
||||
endfor
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
function! formatter.heading(type, tag, indent) dict " {{{
|
||||
if len(a:tag)
|
||||
call add(self.lines, index(self.tags, a:tag))
|
||||
call add(self.content, a:indent . a:type . ' ' . a:tag.name)
|
||||
call add(self.syntax,
|
||||
\ 'syn match TagListKeyword "^\s*' . a:type . '\%' . len(self.lines) . 'l"')
|
||||
else
|
||||
call add(self.lines, 'label')
|
||||
call add(self.content, a:indent . a:type)
|
||||
call add(self.syntax, 'syn match TagListKeyword "^.*\%' . len(self.lines) . 'l.*"')
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
function! formatter.blank() dict " {{{
|
||||
call add(self.content, '')
|
||||
call add(self.lines, -1)
|
||||
endfunction " }}}
|
||||
|
||||
return formatter
|
||||
endfunction " }}}
|
||||
|
||||
function! taglisttoo#util#GetVisibility(tag) " {{{
|
||||
let pattern = a:tag.pattern
|
||||
if pattern =~ '\<public\>'
|
||||
if pattern =~ '\<static\>'
|
||||
return '*'
|
||||
endif
|
||||
return '+'
|
||||
elseif pattern =~ '\<protected\>'
|
||||
return '#'
|
||||
elseif pattern =~ '\<private\>'
|
||||
return '-'
|
||||
endif
|
||||
return ''
|
||||
endfunction " }}}
|
||||
|
||||
function! taglisttoo#util#Parse(file, patterns) " {{{
|
||||
python << PYTHONEOF
|
||||
filename = vim.eval('a:file')
|
||||
patterns = vim.eval('a:patterns')
|
||||
result = taglisttoo.parse(filename, patterns)
|
||||
vim.command('let results = %s' % ('%r' % result).replace("\\'", "''"))
|
||||
PYTHONEOF
|
||||
|
||||
let tags = []
|
||||
if len(results)
|
||||
for result in results
|
||||
" filter false positives found in comments or strings
|
||||
let lnum = result.line
|
||||
let line = getline(lnum)
|
||||
let col = len(line) - len(substitute(line, '^\s*', '', '')) + 1
|
||||
if synIDattr(synID(lnum, col, 1), 'name') =~? '\(comment\|string\)' ||
|
||||
\ synIDattr(synIDtrans(synID(lnum, col, 1)), 'name') =~? '\(comment\|string\)'
|
||||
continue
|
||||
endif
|
||||
|
||||
call add(tags, result)
|
||||
endfor
|
||||
endif
|
||||
|
||||
return tags
|
||||
endfunction " }}}
|
||||
|
||||
function! taglisttoo#util#SortTags(tag1, tag2) " {{{
|
||||
let name1 = tolower(a:tag1.name)
|
||||
let name2 = tolower(a:tag2.name)
|
||||
return name1 == name2 ? 0 : name1 > name2 ? 1 : -1
|
||||
endfunction " }}}
|
||||
|
||||
" vim:ft=vim:fdm=marker
|
||||
265
doc/taglisttoo.txt
Normal file
265
doc/taglisttoo.txt
Normal file
@@ -0,0 +1,265 @@
|
||||
*taglisttoo.txt*
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
TaglistToo *taglisttoo* *TaglistToo*
|
||||
|
||||
Prerequisites |taglisttoo-prerequisites|
|
||||
Overview |taglisttoo-overview|
|
||||
Usage |taglisttoo-usage|
|
||||
Configuration |taglisttoo-configuration|
|
||||
Extending / Customizing |taglisttoo-customization|
|
||||
Parsing New File Types |taglisttoo-parse|
|
||||
Customizing taglist Contents |taglisttoo-format|
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
Prerequisites *taglisttoo-prerequisites*
|
||||
|
||||
TaglistToo requires the following:
|
||||
|
||||
1. Exuberant Ctags to be installed: http://ctags.sourceforge.net/
|
||||
2. Vim 7.x
|
||||
3. Python support compiled into (g)vim
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
Overview *taglisttoo-overview*
|
||||
|
||||
TaglistToo is a plugin which provides an outline of the current source file in
|
||||
a separate window allowing you to quickly see the classes, methods, functions,
|
||||
etc available and to jump to them quickly. This plugin is very similar to the
|
||||
excellent taglist[1] plugin written by Yegappan Lakshmanan. The motivation
|
||||
for creating an alternative to the hugely popular taglist plugin is that the
|
||||
original was written prior to vim 7.0 and so was forced to use data structures
|
||||
which are very difficult to work with to hold and display the tag information.
|
||||
These data structures make it hard to customize taglist, so TaglistToo aims to
|
||||
provide similar functionality but leveraging vim 7.0+ lists and dictionaries
|
||||
to hold tag information and providing hooks allowing you to customize the
|
||||
resulting taglist window's layout and to add support for new file types not
|
||||
natively supported by ctags.
|
||||
|
||||
[1] http://www.vim.org/scripts/script.php?script_id=273
|
||||
|
||||
Here is a list of enhancements vs unimplemented features from which to compare
|
||||
TaglistToo to the original taglist.vim:
|
||||
|
||||
Enhancements not found in the original taglist:
|
||||
|
||||
- Supports an extension mechanism allowing the taglist display to be
|
||||
customized by file type.
|
||||
- Provides custom displays for a handful of languages (java, javascript, php,
|
||||
python, etc.) which groups methods and variables by object/class for easier
|
||||
viewing and navigation.
|
||||
- Supports denoting tags based on their visibility (+public, -private,
|
||||
*static, #protected).
|
||||
- Provides the ability to add support for new file types not supported by
|
||||
ctags.
|
||||
- Echoing of the current tag while scrolling through the taglist window, which
|
||||
is helpful if the tag name doesn't fit in the width of taglist window.
|
||||
|
||||
Unimplemented features found in the original taglist:
|
||||
|
||||
- Drop down list in gvim with the list of tags.
|
||||
- Tag re-sorting
|
||||
- Support for tags for more than one file in the taglist window.
|
||||
- ... possibly others.
|
||||
|
||||
Other than the feature differences the behavior of TaglistToo is very similar
|
||||
to the original taglist.
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
Usage *taglisttoo-usage*
|
||||
*:TlistToo*
|
||||
|
||||
To open the taglist window simply run the command :TlistToo. As long as the
|
||||
current file type is supported and exists on disk, the taglist window will
|
||||
open and display an outline of the file. Executing :TlistToo again will close
|
||||
the taglist window.
|
||||
|
||||
Within the taglist window you can jump to a particular tag in the source file
|
||||
by hitting <Enter> on the tag.
|
||||
|
||||
Folding of tags by heading is also supported using a subset of vim's standard
|
||||
folding key bindings (Note: unlike the standard key bindings, none of these
|
||||
are recursive):
|
||||
|
||||
za, zA When on a fold, toggle whether it is open or closed.
|
||||
zc, zC Close a fold.
|
||||
zo, zO Open a fold.
|
||||
zn, zR Open all folds.
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
Configuration *taglisttoo-configuration*
|
||||
|
||||
In an attempt to make your transition from the original taglist to TaglistToo
|
||||
as easy as possible, TaglistToo supports a some of the same configuration
|
||||
variables:
|
||||
|
||||
- *g:Tlist_Ctags_Cmd* - Sets the location or your ctags executable (if not
|
||||
set, TaglistToo will try to find either exuberant-ctags or ctags on your
|
||||
path).
|
||||
- *g:Tlist_Auto_Open* (Default: 0) - When non-zero, the taglist will auto open
|
||||
at vim startup if the file type is supported.
|
||||
- *g:Tlist_WinWidth* (Default: 30) - Sets the width of the taglist window.
|
||||
- *g:Tlist_Sort_Type* (Default: 'name') - Determines how the tags should be
|
||||
sorted in the taglist window. When set to 'name', the tags will be sorted
|
||||
alphabetically, but when set to 'order' the tags will be sorted by their
|
||||
occurrence in the source file.
|
||||
- *g:TagList_title* (Default: '[TagList]') - Sets the name of the taglist
|
||||
window.
|
||||
- g:Tlist_Use_Right_Window - Preferably you should set the
|
||||
|g:TaglistTooPosition| variable, but for compatibility with the original
|
||||
taglist, if this variable is set to a non-0 value then
|
||||
|g:TaglistTooPosition| will be set to 'right'.
|
||||
|
||||
Some TaglistToo specific variables:
|
||||
|
||||
- *g:TaglistTooEnabled* (Default: 1) - When set to 0 this disables loading of
|
||||
TaglistToo.
|
||||
- *g:TaglistTooPosition* (Default: 'left') - This determines whether the
|
||||
taglist window will be opened on the left or right side of vim. Supported
|
||||
values include 'left' and 'right'.
|
||||
- *g:TaglistTooTagEcho* (Default: 1) - When set to a non 0 value, when moving
|
||||
the cursor in the taglist window, the name of the tag under the cursor will
|
||||
be echoed to the vim command line.
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
Extending / Customizing *taglisttoo-customization*
|
||||
|
||||
For compatibility with the original taglist, TagListToo supports the same
|
||||
g:tlist_{ft}_settings variables including the string format: >
|
||||
|
||||
let g:tlist_mylang_settings = 'mylang;t:mytype;f:myfield'
|
||||
>
|
||||
|
||||
However, since vim 7 and above has support for lists and dictionaries, the
|
||||
above setting can be expressed for TaglistToo as follows: >
|
||||
|
||||
let g:tlist_mylang_settings = {
|
||||
\ 'lang': 'mylang',
|
||||
\ 'tags': {
|
||||
\ 't': 'mytype',
|
||||
\ 'f': 'myfield',
|
||||
\ }
|
||||
\ }
|
||||
>
|
||||
|
||||
The one character keys in the 'tags' dictionary are what will be passed to
|
||||
ctags --<lang>-types argument, and the value for those keys is the text to be
|
||||
displayed in the taglist window.
|
||||
|
||||
Parsing New File Types: *taglisttoo-parse*
|
||||
|
||||
The default method for which TaglistToo obtains the list of tags for a given
|
||||
source file is to use ctags. If you want to add a new language which isn't
|
||||
supported by ctags by default you generally have a couple options:
|
||||
|
||||
1. You can define a new language via regular expression patterns in your
|
||||
.ctags file using the langdef, langmap, and --regex-<lang> options.
|
||||
2. You can write a C extension to ctags.
|
||||
|
||||
The first approach, while fairly simple, is a bit limiting. The most
|
||||
frustrating limitation is that the file to be parse is processed one line at a
|
||||
time, which prevents you from identifying tags that span two or more lines.
|
||||
|
||||
For example, given the following web.xml file, you would not be able to
|
||||
distinguish between the first block which is a servlet definition, and the
|
||||
second which is a servlet mapping, because you would need to process the parent
|
||||
tag, not just the servlet-name tag: >
|
||||
|
||||
<servlet>
|
||||
<servlet-name>MyServlet</servlet-name>
|
||||
<servlet-class>org.foo.MyServlet</servlet-class>
|
||||
</servlet>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>MyServlet</servlet-name>
|
||||
<servlet-class>/my-servlet</servlet-class>
|
||||
</servlet-mapping>
|
||||
>
|
||||
|
||||
The second approach, is much more flexible, but writing a language processor in
|
||||
C may not be a feasible solution for various reasons (unfamiliarity with C,
|
||||
portability, etc.).
|
||||
|
||||
Taking into account these concerns, TaglistToo provides the means to add new
|
||||
languages by allowing you to configure a vim script function to be executed to
|
||||
obtain the tags. In this function you can process the file however you would
|
||||
like, but TaglistToo provides a simple utility function allowing you to supply
|
||||
a list of tag types, python compatible regular expressions, and the
|
||||
replacement text or group used to obtain the tag name.
|
||||
|
||||
Here is an example function which processes the web.xml file described above: >
|
||||
|
||||
function! ParseWebXml(file, settings)
|
||||
return taglisttoo#util#Parse(a:file, [
|
||||
\ ['s', '<servlet\s*>\s*<servlet-name\s*>\s*(.*?)\s*</servlet-name\s*>', 1],
|
||||
\ ['m', '<servlet-mapping\s*>\s*<servlet-name\s*>\s*(.*?)\s*</servlet-name\s*>', 1],
|
||||
\ ])
|
||||
endfunction
|
||||
>
|
||||
|
||||
There are a couple things to note about how these regular expressions are
|
||||
evaluated:
|
||||
|
||||
1. When compiling the regular expression the DOTALL and MULTILINE flags are
|
||||
always set.
|
||||
2. The regular expressions are executed against the whole file at once.
|
||||
3. If you would like to have the IGNORECASE flag set as well, simply add a
|
||||
'i' as a fourth value to each list where you'd like that flag enabled.
|
||||
4. The third value in each list specifies what replacement value should be
|
||||
used to extract the tag name from the matched text. If the value is an int,
|
||||
it is interpreted as the group number from the regular expression. If the
|
||||
value is a string, then a separate substitution is executed with that
|
||||
value. So if you had two groups you wanted to combine, you could supply
|
||||
'\1 \2' for the third value in the supplied list.
|
||||
|
||||
Now that you have a function which processes the file, you simply need to
|
||||
configure the taglist settings for the webxml file type: >
|
||||
|
||||
let g:tlist_webxml_settings = {
|
||||
\ 'lang': 'webxml',
|
||||
\ 'parse': 'ParseWebXml',
|
||||
\ 'tags': {
|
||||
\ 's': 'servlet',
|
||||
\ 'm': 'servlet-mapping'
|
||||
\ }
|
||||
\ }
|
||||
>
|
||||
|
||||
Notice the new 'parse' key introduced here which tells TaglistToo to use that
|
||||
function instead of the default one.
|
||||
|
||||
Note: This example introduces a new file type, webxml, which doesn't exist by
|
||||
default in vim, so if you want to test this out on a real web.xml file you'll
|
||||
need to manually set the file type (:set ft=webxml).
|
||||
|
||||
Customizing taglist contents: *taglisttoo-format*
|
||||
|
||||
In addition to parsing new file types, you can also customize the taglist
|
||||
format for new or existing file types. To do so you simply tell TaglistToo to
|
||||
use a different format function. Here is an example using TagListToo's python
|
||||
settings: >
|
||||
|
||||
let g:tlist_python_settings = {
|
||||
\ 'lang': 'python',
|
||||
\ 'format': 'taglisttoo#lang#python#Format',
|
||||
\ 'tags': {
|
||||
\ 'c': 'class',
|
||||
\ 'm': 'member',
|
||||
\ 'f': 'function'
|
||||
\ }
|
||||
\ }
|
||||
>
|
||||
|
||||
Instead of using the default format, TaglistToo will invoke the
|
||||
taglisttoo#lang#python#Format function which in this case will group members
|
||||
and functions by the class they are defined in and any global functions will
|
||||
be displayed at the top of the taglist window.
|
||||
|
||||
Unfortunately, implementing a function which customizes the taglist layout is
|
||||
not as straight forward and writing one which parses a new file type. If you
|
||||
wish to write one of these format functions, currently you are best off
|
||||
copying one of the format functions defined in one of the
|
||||
autoload/taglisttoo/lang/<lang>.vim files and customizing it to your needs.
|
||||
Hopefully future versions of TaglistToo will make writing these easier.
|
||||
|
||||
vim:tw=78:ft=help:norl:
|
||||
19
doc/tags
19
doc/tags
@@ -81,6 +81,7 @@
|
||||
:SendBlogArticle vimblogger_ft.txt /*:SendBlogArticle*
|
||||
:Tags: vimblogger_ft.txt /*:Tags:*
|
||||
:Title: vimblogger_ft.txt /*:Title:*
|
||||
:TlistToo taglisttoo.txt /*:TlistToo*
|
||||
:VCSAdd vcscommand.txt /*:VCSAdd*
|
||||
:VCSAnnotate vcscommand.txt /*:VCSAnnotate*
|
||||
:VCSBlame vcscommand.txt /*:VCSBlame*
|
||||
@@ -185,6 +186,7 @@ ShowMarksClearMark showmarks.txt /*ShowMarksClearMark*
|
||||
ShowMarksOn showmarks.txt /*ShowMarksOn*
|
||||
ShowMarksPlaceMark showmarks.txt /*ShowMarksPlaceMark*
|
||||
ShowMarksToggle showmarks.txt /*ShowMarksToggle*
|
||||
TaglistToo taglisttoo.txt /*TaglistToo*
|
||||
VCSCommandCVSDiffOpt vcscommand.txt /*VCSCommandCVSDiffOpt*
|
||||
VCSCommandCVSExec vcscommand.txt /*VCSCommandCVSExec*
|
||||
VCSCommandCommitOnWrite vcscommand.txt /*VCSCommandCommitOnWrite*
|
||||
@@ -294,6 +296,14 @@ fuf-usage fuf.txt /*fuf-usage*
|
||||
fuf-vimrc-example fuf.txt /*fuf-vimrc-example*
|
||||
fuf.txt fuf.txt /*fuf.txt*
|
||||
fuzzyfinder fuf.txt /*fuzzyfinder*
|
||||
g:TagList_title taglisttoo.txt /*g:TagList_title*
|
||||
g:TaglistTooEnabled taglisttoo.txt /*g:TaglistTooEnabled*
|
||||
g:TaglistTooPosition taglisttoo.txt /*g:TaglistTooPosition*
|
||||
g:TaglistTooTagEcho taglisttoo.txt /*g:TaglistTooTagEcho*
|
||||
g:Tlist_Auto_Open taglisttoo.txt /*g:Tlist_Auto_Open*
|
||||
g:Tlist_Ctags_Cmd taglisttoo.txt /*g:Tlist_Ctags_Cmd*
|
||||
g:Tlist_Sort_Type taglisttoo.txt /*g:Tlist_Sort_Type*
|
||||
g:Tlist_WinWidth taglisttoo.txt /*g:Tlist_WinWidth*
|
||||
g:blogger_browser vimblogger_ft.txt /*g:blogger_browser*
|
||||
g:blogger_confirm_del vimblogger_ft.txt /*g:blogger_confirm_del*
|
||||
g:blogger_draft vimblogger_ft.txt /*g:blogger_draft*
|
||||
@@ -920,6 +930,15 @@ tagbar-requirements tagbar.txt /*tagbar-requirements*
|
||||
tagbar-todo tagbar.txt /*tagbar-todo*
|
||||
tagbar-usage tagbar.txt /*tagbar-usage*
|
||||
tagbar.txt tagbar.txt /*tagbar.txt*
|
||||
taglisttoo taglisttoo.txt /*taglisttoo*
|
||||
taglisttoo-configuration taglisttoo.txt /*taglisttoo-configuration*
|
||||
taglisttoo-customization taglisttoo.txt /*taglisttoo-customization*
|
||||
taglisttoo-format taglisttoo.txt /*taglisttoo-format*
|
||||
taglisttoo-overview taglisttoo.txt /*taglisttoo-overview*
|
||||
taglisttoo-parse taglisttoo.txt /*taglisttoo-parse*
|
||||
taglisttoo-prerequisites taglisttoo.txt /*taglisttoo-prerequisites*
|
||||
taglisttoo-usage taglisttoo.txt /*taglisttoo-usage*
|
||||
taglisttoo.txt taglisttoo.txt /*taglisttoo.txt*
|
||||
vS surround.txt /*vS*
|
||||
v_<Leader>m mark.txt /*v_<Leader>m*
|
||||
v_<Leader>r mark.txt /*v_<Leader>r*
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
" Description: vim plugin that provides buffers helpers. Almost all of parts
|
||||
" are taken from Eclim project <http://eclim.sourceforge.net>
|
||||
" Maintainer: Roman 'gryf' Dobosz <gryf73@gmail.com>
|
||||
" Last Change: 2010-08-28
|
||||
" Last Change: 2011-07-16
|
||||
" License: This program is free software: you can redistribute it and/or
|
||||
" modify it under the terms of the GNU General Public License as
|
||||
" published by the Free Software Foundation, either version 3 of
|
||||
@@ -18,7 +18,7 @@
|
||||
" License along with this program. If not, see
|
||||
" <http://www.gnu.org/licenses/>.
|
||||
" ============================================================================
|
||||
let s:Eclim_ver = '1.6.0'
|
||||
let s:Eclim_ver = '1.7.1'
|
||||
|
||||
" Eclim: {{{1
|
||||
" files:
|
||||
@@ -98,10 +98,6 @@ endif
|
||||
if !exists('g:EclimBuffersDefaultAction')
|
||||
let g:EclimBuffersDefaultAction = 'edit'
|
||||
endif
|
||||
if !exists('g:EclimOnlyExclude')
|
||||
let g:EclimOnlyExclude =
|
||||
\ '\(NERD_tree_*\|__Tag_List__\|command-line\)'
|
||||
endif
|
||||
" }}}
|
||||
|
||||
" Buffers() eclim/autoload/eclim/common/buffers.vim {{{2
|
||||
@@ -140,7 +136,6 @@ function! s:Buffers()
|
||||
endfor
|
||||
|
||||
call TempWindow('[buffers]', lines)
|
||||
let b:eclim_buffers = buffers
|
||||
|
||||
setlocal modifiable noreadonly
|
||||
call append(line('$'), ['', '" use ? to view help'])
|
||||
@@ -162,6 +157,7 @@ function! s:Buffers()
|
||||
nnoremap <silent> <buffer> S :call <SID>BufferOpen2('split')<cr>
|
||||
nnoremap <silent> <buffer> T :call <SID>BufferOpen('tablast \| tabnew')<cr>
|
||||
nnoremap <silent> <buffer> D :call <SID>BufferDelete()<cr>
|
||||
nnoremap <silent> <buffer> R :Buffers<cr>
|
||||
|
||||
" assign to buffer var to get around weird vim issue passing list containing
|
||||
" a string w/ a '<' in it on execution of mapping.
|
||||
@@ -171,6 +167,7 @@ function! s:Buffers()
|
||||
\ 'S - open in a new split window',
|
||||
\ 'T - open in a new tab',
|
||||
\ 'D - delete the buffer',
|
||||
\ 'R - refresh the buffer list',
|
||||
\ ]
|
||||
nnoremap <buffer> <silent> ?
|
||||
\ :call BufferHelp(b:buffers_help, 'vertical', 40)<cr>
|
||||
@@ -209,7 +206,19 @@ function! s:BufferDelete()
|
||||
setlocal readonly
|
||||
let buffer = b:eclim_buffers[index]
|
||||
call remove(b:eclim_buffers, index)
|
||||
|
||||
let winnr = bufwinnr(buffer.bufnr)
|
||||
if winnr != -1
|
||||
" if active in a window, go to the window to delete the buffer since that
|
||||
" keeps eclim's prevention of closing the last non-utility window working
|
||||
" properly.
|
||||
let curwin = winnr()
|
||||
exec winnr . 'winc w'
|
||||
bdelete
|
||||
exec curwin . 'winc w'
|
||||
else
|
||||
exec 'bd ' . buffer.bufnr
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
" s:BufferEntryToLine(buffer, filelength) eclim/autoload/eclim/common/buffers.vim {{{2
|
||||
@@ -307,7 +316,7 @@ function! GoToBufferWindow(buf)
|
||||
let winnr = bufwinnr(a:buf)
|
||||
else
|
||||
let name = EscapeBufferName(a:buf)
|
||||
let winnr = bufwinnr(bufnr('^' . name))
|
||||
let winnr = bufwinnr(bufnr('^' . name . '$'))
|
||||
endif
|
||||
if winnr != -1
|
||||
exec winnr . "winc w"
|
||||
@@ -383,17 +392,20 @@ function! TempWindow(name, lines, ...)
|
||||
let name = EscapeBufferName(a:name)
|
||||
|
||||
if bufwinnr(name) == -1
|
||||
silent! noautocmd exec "botright 10sview " . escape(a:name, ' ')
|
||||
let b:eclim_temp_window = 1
|
||||
|
||||
silent! noautocmd exec "botright 10sview " . escape(a:name, ' []')
|
||||
setlocal nowrap
|
||||
setlocal winfixheight
|
||||
setlocal noswapfile
|
||||
setlocal nobuflisted
|
||||
setlocal buftype=nofile
|
||||
setlocal bufhidden=delete
|
||||
silent doautocmd WinEnter
|
||||
else
|
||||
exec bufwinnr(name) . "winc w"
|
||||
let temp_winnr = bufwinnr(name)
|
||||
if temp_winnr != winnr()
|
||||
exec temp_winnr . 'winc w'
|
||||
silent doautocmd WinEnter
|
||||
endif
|
||||
endif
|
||||
|
||||
setlocal modifiable
|
||||
@@ -460,11 +472,16 @@ function! BufferHelp(lines, orientation, size)
|
||||
endif
|
||||
|
||||
silent! noautocmd exec a:size . orient . "new " . escape(name, ' ')
|
||||
let b:eclim_temp_window = 1
|
||||
setlocal nowrap winfixheight
|
||||
if a:orientation == 'vertical'
|
||||
setlocal winfixwidth
|
||||
else
|
||||
setlocal winfixheight
|
||||
endif
|
||||
setlocal nowrap
|
||||
setlocal noswapfile nobuflisted nonumber
|
||||
setlocal buftype=nofile bufhidden=delete
|
||||
nnoremap <buffer> <silent> ? :bd<cr>
|
||||
nnoremap <buffer> <silent> q :bd<cr>
|
||||
|
||||
setlocal modifiable noreadonly
|
||||
silent 1,$delete _
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user