Add more plugins
git-svn-id: http://photonzero.com/dotfiles/trunk@85 23f722f6-122a-0410-8cef-c75bd312dd78
This commit is contained in:
parent
ee165a5f86
commit
01886340e4
105 changed files with 9388 additions and 0 deletions
BIN
.vim/bundle/vim-fuzzyfinder/.hg/00changelog.i
Normal file
BIN
.vim/bundle/vim-fuzzyfinder/.hg/00changelog.i
Normal file
Binary file not shown.
1
.vim/bundle/vim-fuzzyfinder/.hg/branch
Normal file
1
.vim/bundle/vim-fuzzyfinder/.hg/branch
Normal file
|
|
@ -0,0 +1 @@
|
|||
default
|
||||
3
.vim/bundle/vim-fuzzyfinder/.hg/branchheads.cache
Normal file
3
.vim/bundle/vim-fuzzyfinder/.hg/branchheads.cache
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
4014e500fb8d90e4906fb63b500c67dab92fdd9e 329
|
||||
4014e500fb8d90e4906fb63b500c67dab92fdd9e default
|
||||
470f6d5b3be5e7be8cee15f99d0a47f4579b936a 2.7
|
||||
BIN
.vim/bundle/vim-fuzzyfinder/.hg/dirstate
Normal file
BIN
.vim/bundle/vim-fuzzyfinder/.hg/dirstate
Normal file
Binary file not shown.
2
.vim/bundle/vim-fuzzyfinder/.hg/hgrc
Normal file
2
.vim/bundle/vim-fuzzyfinder/.hg/hgrc
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
[paths]
|
||||
default = https://bitbucket.org/ns9tks/vim-fuzzyfinder
|
||||
3
.vim/bundle/vim-fuzzyfinder/.hg/requires
Normal file
3
.vim/bundle/vim-fuzzyfinder/.hg/requires
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
revlogv1
|
||||
store
|
||||
fncache
|
||||
BIN
.vim/bundle/vim-fuzzyfinder/.hg/store/00changelog.i
Normal file
BIN
.vim/bundle/vim-fuzzyfinder/.hg/store/00changelog.i
Normal file
Binary file not shown.
BIN
.vim/bundle/vim-fuzzyfinder/.hg/store/00manifest.i
Normal file
BIN
.vim/bundle/vim-fuzzyfinder/.hg/store/00manifest.i
Normal file
Binary file not shown.
BIN
.vim/bundle/vim-fuzzyfinder/.hg/store/data/.hgtags.i
Normal file
BIN
.vim/bundle/vim-fuzzyfinder/.hg/store/data/.hgtags.i
Normal file
Binary file not shown.
BIN
.vim/bundle/vim-fuzzyfinder/.hg/store/data/autoload/fuf.vim.i
Normal file
BIN
.vim/bundle/vim-fuzzyfinder/.hg/store/data/autoload/fuf.vim.i
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.vim/bundle/vim-fuzzyfinder/.hg/store/data/doc/fuf.jax.i
Normal file
BIN
.vim/bundle/vim-fuzzyfinder/.hg/store/data/doc/fuf.jax.i
Normal file
Binary file not shown.
BIN
.vim/bundle/vim-fuzzyfinder/.hg/store/data/doc/fuf.txt.i
Normal file
BIN
.vim/bundle/vim-fuzzyfinder/.hg/store/data/doc/fuf.txt.i
Normal file
Binary file not shown.
BIN
.vim/bundle/vim-fuzzyfinder/.hg/store/data/doc/fuzzyfinder.jax.i
Normal file
BIN
.vim/bundle/vim-fuzzyfinder/.hg/store/data/doc/fuzzyfinder.jax.i
Normal file
Binary file not shown.
BIN
.vim/bundle/vim-fuzzyfinder/.hg/store/data/doc/fuzzyfinder.txt.i
Normal file
BIN
.vim/bundle/vim-fuzzyfinder/.hg/store/data/doc/fuzzyfinder.txt.i
Normal file
Binary file not shown.
BIN
.vim/bundle/vim-fuzzyfinder/.hg/store/data/plugin/fuf.vim.i
Normal file
BIN
.vim/bundle/vim-fuzzyfinder/.hg/store/data/plugin/fuf.vim.i
Normal file
Binary file not shown.
Binary file not shown.
33
.vim/bundle/vim-fuzzyfinder/.hg/store/fncache
Normal file
33
.vim/bundle/vim-fuzzyfinder/.hg/store/fncache
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
data/.hgtags.i
|
||||
data/autoload/fuf.vim.i
|
||||
data/autoload/fuf.vim.rej.i
|
||||
data/autoload/fuf/allfile.vim.i
|
||||
data/autoload/fuf/aroundmrufile.vim.i
|
||||
data/autoload/fuf/bookmark.vim.i
|
||||
data/autoload/fuf/bookmarkdir.vim.i
|
||||
data/autoload/fuf/bookmarkfile.vim.i
|
||||
data/autoload/fuf/buffer.vim.i
|
||||
data/autoload/fuf/buffertag.vim.i
|
||||
data/autoload/fuf/callbackfile.vim.i
|
||||
data/autoload/fuf/callbackitem.vim.i
|
||||
data/autoload/fuf/changelist.vim.i
|
||||
data/autoload/fuf/coveragefile.vim.i
|
||||
data/autoload/fuf/dir.vim.i
|
||||
data/autoload/fuf/file.vim.i
|
||||
data/autoload/fuf/givencmd.vim.i
|
||||
data/autoload/fuf/givendir.vim.i
|
||||
data/autoload/fuf/givenfile.vim.i
|
||||
data/autoload/fuf/help.vim.i
|
||||
data/autoload/fuf/jumplist.vim.i
|
||||
data/autoload/fuf/line.vim.i
|
||||
data/autoload/fuf/mrucmd.vim.i
|
||||
data/autoload/fuf/mrufile.vim.i
|
||||
data/autoload/fuf/quickfix.vim.i
|
||||
data/autoload/fuf/tag.vim.i
|
||||
data/autoload/fuf/taggedfile.vim.i
|
||||
data/doc/fuf.jax.i
|
||||
data/doc/fuf.txt.i
|
||||
data/doc/fuzzyfinder.jax.i
|
||||
data/doc/fuzzyfinder.txt.i
|
||||
data/plugin/fuf.vim.i
|
||||
data/plugin/fuzzyfinder.vim.i
|
||||
BIN
.vim/bundle/vim-fuzzyfinder/.hg/store/undo
Normal file
BIN
.vim/bundle/vim-fuzzyfinder/.hg/store/undo
Normal file
Binary file not shown.
37
.vim/bundle/vim-fuzzyfinder/.hg/tags.cache
Normal file
37
.vim/bundle/vim-fuzzyfinder/.hg/tags.cache
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
329 4014e500fb8d90e4906fb63b500c67dab92fdd9e 3b8d45ee3174b5163a5978766f8ad7595a9a35c7
|
||||
|
||||
8b503e03294bfee2391550ea1c25d9abe619d947 2.9
|
||||
ab897fc2f4c1bb5d30918a925bcc123bab59a79f 2.8
|
||||
1bdf383f40c90ed71dc4aaa25ca50e9afc1d95ea 3.2
|
||||
747edb3f3b4c187fcd38aac896fc8d8a107b8e1c 3.3
|
||||
e8bcbf4bf440ad14602cb8d11f2c15447a38df60 3.0
|
||||
ea42cdfe7cdd635d5965b4dc6edda0ae5e374f38 3.1
|
||||
cf9f65e5dd9e06fbdd28864fbe62fc0688afd02d 2.7
|
||||
12fd426abbc05bbacb1b24aab95dd1f7961df865 2.6
|
||||
1117ddd9a19b525c324b10b4911dcd67fb89eb66 4.1
|
||||
7d7aa8a1c62c41d3064125e7f9dafddd31c9bb78 4.0
|
||||
dee72a3e6790d6859454653b8eec56b37359247a 4.2
|
||||
ca56346d327bbcb61ba47dfc9e9cf31792b78cec 2.19
|
||||
1c1996f7dc544ac58ce3690093de1aea968dcad6 2.18
|
||||
96c547a54644878708a2155f33cb5547fe3cbf70 2.22.0
|
||||
b72936ccf5a96340dcfd6742b574a35313642c70 2.22.1
|
||||
2ce20535b10cde9c8c76f23a5ce66a6b64cc8775 2.22.2
|
||||
910105ab1b8eda365c4074fc272dc564dfe0f4bb 2.14
|
||||
29e0f8d83208931bd7a3b0d50f8c6aff26189e1e 2.13
|
||||
ae392ea7870399aa91b1f227fb851c35373778aa 2.12
|
||||
1d04353cf94a95da831add20bcae270f52e0df5d 2.11
|
||||
7423b8e0af6b25e3c86c2e5285951a32d45cff85 2.10
|
||||
eca54ee53e9c4e8a26585d882fb3cb63938aedbd 2.21.0
|
||||
2acd9f721c0ee8852c8a2f5d2764a1ddafd01b95 2.17
|
||||
3dfda50187099bda28dec2035b9d0197cc3e60ee 2.16
|
||||
5830ee92a86aea9e19e87c94ef4e07babd80e02a 2.15
|
||||
6686856c4cd7a3ba0a35edaf333f78d06609ed48 4.1.1
|
||||
1934aa0f4065b702c379f3b7abc4bda1526eeffe 2.22.3
|
||||
fe1572fcdfedd27cf816dbb533acfa403ad626a6 2.6.1
|
||||
23cf697e42ec871e391a097c811f2337c1a3b4a0 2.6.2
|
||||
13463a6e73364f373618b322ff509266bfc33e35 3.4
|
||||
90d30a932a172df9e8d94333092440db668fa301 2.8.1
|
||||
8a46435f4532a77102eff580e2be44c9737ec89f 4.2.2
|
||||
672cfc1651da9e8fb2025846fb7c4a8fb6c9aa98 4.2.1
|
||||
21629b1a14f4b86396898532dee5e58ca0843082 3.5
|
||||
adcae4f87ad44e9ed1d864acf69d8b1c232fe68c 2.20
|
||||
1
.vim/bundle/vim-fuzzyfinder/.hg/undo.branch
Normal file
1
.vim/bundle/vim-fuzzyfinder/.hg/undo.branch
Normal file
|
|
@ -0,0 +1 @@
|
|||
default
|
||||
0
.vim/bundle/vim-fuzzyfinder/.hg/undo.dirstate
Normal file
0
.vim/bundle/vim-fuzzyfinder/.hg/undo.dirstate
Normal file
35
.vim/bundle/vim-fuzzyfinder/.hgtags
Normal file
35
.vim/bundle/vim-fuzzyfinder/.hgtags
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
12fd426abbc05bbacb1b24aab95dd1f7961df865 2.6
|
||||
fe1572fcdfedd27cf816dbb533acfa403ad626a6 2.6.1
|
||||
23cf697e42ec871e391a097c811f2337c1a3b4a0 2.6.2
|
||||
cf9f65e5dd9e06fbdd28864fbe62fc0688afd02d 2.7
|
||||
ab897fc2f4c1bb5d30918a925bcc123bab59a79f 2.8
|
||||
90d30a932a172df9e8d94333092440db668fa301 2.8.1
|
||||
8b503e03294bfee2391550ea1c25d9abe619d947 2.9
|
||||
7423b8e0af6b25e3c86c2e5285951a32d45cff85 2.10
|
||||
1d04353cf94a95da831add20bcae270f52e0df5d 2.11
|
||||
ae392ea7870399aa91b1f227fb851c35373778aa 2.12
|
||||
29e0f8d83208931bd7a3b0d50f8c6aff26189e1e 2.13
|
||||
910105ab1b8eda365c4074fc272dc564dfe0f4bb 2.14
|
||||
5830ee92a86aea9e19e87c94ef4e07babd80e02a 2.15
|
||||
3dfda50187099bda28dec2035b9d0197cc3e60ee 2.16
|
||||
2acd9f721c0ee8852c8a2f5d2764a1ddafd01b95 2.17
|
||||
1c1996f7dc544ac58ce3690093de1aea968dcad6 2.18
|
||||
ca56346d327bbcb61ba47dfc9e9cf31792b78cec 2.19
|
||||
adcae4f87ad44e9ed1d864acf69d8b1c232fe68c 2.20
|
||||
eca54ee53e9c4e8a26585d882fb3cb63938aedbd 2.21.0
|
||||
96c547a54644878708a2155f33cb5547fe3cbf70 2.22.0
|
||||
b72936ccf5a96340dcfd6742b574a35313642c70 2.22.1
|
||||
2ce20535b10cde9c8c76f23a5ce66a6b64cc8775 2.22.2
|
||||
1934aa0f4065b702c379f3b7abc4bda1526eeffe 2.22.3
|
||||
e8bcbf4bf440ad14602cb8d11f2c15447a38df60 3.0
|
||||
ea42cdfe7cdd635d5965b4dc6edda0ae5e374f38 3.1
|
||||
1bdf383f40c90ed71dc4aaa25ca50e9afc1d95ea 3.2
|
||||
747edb3f3b4c187fcd38aac896fc8d8a107b8e1c 3.3
|
||||
13463a6e73364f373618b322ff509266bfc33e35 3.4
|
||||
21629b1a14f4b86396898532dee5e58ca0843082 3.5
|
||||
7d7aa8a1c62c41d3064125e7f9dafddd31c9bb78 4.0
|
||||
1117ddd9a19b525c324b10b4911dcd67fb89eb66 4.1
|
||||
6686856c4cd7a3ba0a35edaf333f78d06609ed48 4.1.1
|
||||
dee72a3e6790d6859454653b8eec56b37359247a 4.2
|
||||
672cfc1651da9e8fb2025846fb7c4a8fb6c9aa98 4.2.1
|
||||
8a46435f4532a77102eff580e2be44c9737ec89f 4.2.2
|
||||
1046
.vim/bundle/vim-fuzzyfinder/autoload/fuf.vim
Normal file
1046
.vim/bundle/vim-fuzzyfinder/autoload/fuf.vim
Normal file
File diff suppressed because it is too large
Load diff
163
.vim/bundle/vim-fuzzyfinder/autoload/fuf/bookmarkdir.vim
Normal file
163
.vim/bundle/vim-fuzzyfinder/autoload/fuf/bookmarkdir.vim
Normal file
|
|
@ -0,0 +1,163 @@
|
|||
"=============================================================================
|
||||
" Copyright (c) 2010 Takeshi NISHIDA
|
||||
"
|
||||
"=============================================================================
|
||||
" LOAD GUARD {{{1
|
||||
|
||||
if !l9#guardScriptLoading(expand('<sfile>:p'), 0, 0, [])
|
||||
finish
|
||||
endif
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" GLOBAL FUNCTIONS {{{1
|
||||
|
||||
"
|
||||
function fuf#bookmarkdir#createHandler(base)
|
||||
return a:base.concretize(copy(s:handler))
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#bookmarkdir#getSwitchOrder()
|
||||
return g:fuf_bookmarkdir_switchOrder
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#bookmarkdir#getEditableDataNames()
|
||||
return ['items']
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#bookmarkdir#renewCache()
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#bookmarkdir#requiresOnCommandPre()
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#bookmarkdir#onInit()
|
||||
call fuf#defineLaunchCommand('FufBookmarkDir', s:MODE_NAME, '""', [])
|
||||
command! -bang -narg=? FufBookmarkDirAdd call s:bookmark(<q-args>)
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" LOCAL FUNCTIONS/VARIABLES {{{1
|
||||
|
||||
let s:MODE_NAME = expand('<sfile>:t:r')
|
||||
let s:OPEN_TYPE_DELETE = -1
|
||||
|
||||
"
|
||||
function s:bookmark(word)
|
||||
let item = {
|
||||
\ 'time' : localtime(),
|
||||
\ }
|
||||
|
||||
let item.path = l9#inputHl('Question', '[fuf] Directory to bookmark:',
|
||||
\ fnamemodify(getcwd(), ':p:~'), 'dir')
|
||||
if item.path !~ '\S'
|
||||
call fuf#echoWarning('Canceled')
|
||||
return
|
||||
endif
|
||||
let item.word = l9#inputHl('Question', '[fuf] Bookmark as:',
|
||||
\ fnamemodify(getcwd(), ':p:~'))
|
||||
if item.word !~ '\S'
|
||||
call fuf#echoWarning('Canceled')
|
||||
return
|
||||
endif
|
||||
let items = fuf#loadDataFile(s:MODE_NAME, 'items')
|
||||
call insert(items, item)
|
||||
call fuf#saveDataFile(s:MODE_NAME, 'items', items)
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:findItem(items, word)
|
||||
for item in a:items
|
||||
if item.word ==# a:word
|
||||
return item
|
||||
endif
|
||||
endfor
|
||||
return {}
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" s:handler {{{1
|
||||
|
||||
let s:handler = {}
|
||||
|
||||
"
|
||||
function s:handler.getModeName()
|
||||
return s:MODE_NAME
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getPrompt()
|
||||
return fuf#formatPrompt(g:fuf_bookmarkdir_prompt, self.partialMatching, '')
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getPreviewHeight()
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.isOpenable(enteredPattern)
|
||||
return 1
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.makePatternSet(patternBase)
|
||||
return fuf#makePatternSet(a:patternBase, 's:interpretPrimaryPatternForNonPath',
|
||||
\ self.partialMatching)
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.makePreviewLines(word, count)
|
||||
return []
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getCompleteItems(patternPrimary)
|
||||
return self.items
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onOpen(word, mode)
|
||||
if a:mode ==# s:OPEN_TYPE_DELETE
|
||||
let items = fuf#loadDataFile(s:MODE_NAME, 'items')
|
||||
call filter(items, 'v:val.word !=# a:word')
|
||||
call fuf#saveDataFile(s:MODE_NAME, 'items', items)
|
||||
let self.reservedMode = self.getModeName()
|
||||
return
|
||||
else
|
||||
let item = s:findItem(fuf#loadDataFile(s:MODE_NAME, 'items'), a:word)
|
||||
if !empty(item)
|
||||
execute ':cd ' . fnameescape(item.path)
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeEnterPre()
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeEnterPost()
|
||||
call fuf#defineKeyMappingInHandler(g:fuf_bookmarkdir_keyDelete,
|
||||
\ 'onCr(' . s:OPEN_TYPE_DELETE . ')')
|
||||
let self.items = fuf#loadDataFile(s:MODE_NAME, 'items')
|
||||
call map(self.items, 'fuf#makeNonPathItem(v:val.word, strftime(g:fuf_timeFormat, v:val.time))')
|
||||
call fuf#mapToSetSerialIndex(self.items, 1)
|
||||
call map(self.items, 'fuf#setAbbrWithFormattedWord(v:val, 1)')
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeLeavePost(opened)
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" vim: set fdm=marker:
|
||||
199
.vim/bundle/vim-fuzzyfinder/autoload/fuf/bookmarkfile.vim
Normal file
199
.vim/bundle/vim-fuzzyfinder/autoload/fuf/bookmarkfile.vim
Normal file
|
|
@ -0,0 +1,199 @@
|
|||
"=============================================================================
|
||||
" Copyright (c) 2010 Takeshi NISHIDA
|
||||
"
|
||||
"=============================================================================
|
||||
" LOAD GUARD {{{1
|
||||
|
||||
if !l9#guardScriptLoading(expand('<sfile>:p'), 0, 0, [])
|
||||
finish
|
||||
endif
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" GLOBAL FUNCTIONS {{{1
|
||||
|
||||
"
|
||||
function fuf#bookmarkfile#createHandler(base)
|
||||
return a:base.concretize(copy(s:handler))
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#bookmarkfile#getSwitchOrder()
|
||||
return g:fuf_bookmarkfile_switchOrder
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#bookmarkfile#getEditableDataNames()
|
||||
return ['items']
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#bookmarkfile#renewCache()
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#bookmarkfile#requiresOnCommandPre()
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#bookmarkfile#onInit()
|
||||
call fuf#defineLaunchCommand('FufBookmarkFile', s:MODE_NAME, '""', [])
|
||||
command! -bang -narg=? FufBookmarkFileAdd call s:bookmarkHere(<q-args>)
|
||||
command! -bang -narg=0 -range FufBookmarkFileAddAsSelectedText call s:bookmarkHere(l9#getSelectedText())
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" LOCAL FUNCTIONS/VARIABLES {{{1
|
||||
|
||||
let s:MODE_NAME = expand('<sfile>:t:r')
|
||||
let s:OPEN_TYPE_DELETE = -1
|
||||
|
||||
" opens a:path and jumps to the line matching to a:pattern from a:lnum within
|
||||
" a:range. if not found, jumps to a:lnum.
|
||||
function s:jumpToBookmark(path, mode, pattern, lnum)
|
||||
call fuf#openFile(a:path, a:mode, g:fuf_reuseWindow)
|
||||
call cursor(s:getMatchingLineNumber(getline(1, '$'), a:pattern, a:lnum), 0)
|
||||
normal! zvzz
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:getMatchingLineNumber(lines, pattern, lnumBegin)
|
||||
let l = min([a:lnumBegin, len(a:lines)])
|
||||
for [l0, l1] in map(range(0, g:fuf_bookmarkfile_searchRange),
|
||||
\ '[l + v:val, l - v:val]')
|
||||
if l0 <= len(a:lines) && a:lines[l0 - 1] =~# a:pattern
|
||||
return l0
|
||||
elseif l1 >= 0 && a:lines[l1 - 1] =~# a:pattern
|
||||
return l1
|
||||
endif
|
||||
endfor
|
||||
return l
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:getLinePattern(lnum)
|
||||
return '\C\V\^' . escape(getline(a:lnum), '\') . '\$'
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:bookmarkHere(word)
|
||||
if !empty(&buftype) || expand('%') !~ '\S'
|
||||
call fuf#echoWarning('Can''t bookmark this buffer.')
|
||||
return
|
||||
endif
|
||||
let item = {
|
||||
\ 'word' : (a:word =~# '\S' ? substitute(a:word, '\n', ' ', 'g')
|
||||
\ : pathshorten(expand('%:p:~')) . '|' . line('.') . '| ' . getline('.')),
|
||||
\ 'path' : expand('%:p'),
|
||||
\ 'lnum' : line('.'),
|
||||
\ 'pattern' : s:getLinePattern(line('.')),
|
||||
\ 'time' : localtime(),
|
||||
\ }
|
||||
let item.word = l9#inputHl('Question', '[fuf] Bookmark as:', item.word)
|
||||
if item.word !~ '\S'
|
||||
call fuf#echoWarning('Canceled')
|
||||
return
|
||||
endif
|
||||
let items = fuf#loadDataFile(s:MODE_NAME, 'items')
|
||||
call insert(items, item)
|
||||
call fuf#saveDataFile(s:MODE_NAME, 'items', items)
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:findItem(items, word)
|
||||
for item in a:items
|
||||
if item.word ==# a:word
|
||||
return item
|
||||
endif
|
||||
endfor
|
||||
return {}
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" s:handler {{{1
|
||||
|
||||
let s:handler = {}
|
||||
|
||||
"
|
||||
function s:handler.getModeName()
|
||||
return s:MODE_NAME
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getPrompt()
|
||||
return fuf#formatPrompt(g:fuf_bookmarkfile_prompt, self.partialMatching, '')
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getPreviewHeight()
|
||||
return g:fuf_previewHeight
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.isOpenable(enteredPattern)
|
||||
return 1
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.makePatternSet(patternBase)
|
||||
return fuf#makePatternSet(a:patternBase, 's:interpretPrimaryPatternForNonPath',
|
||||
\ self.partialMatching)
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.makePreviewLines(word, count)
|
||||
let item = s:findItem(fuf#loadDataFile(s:MODE_NAME, 'items'), a:word)
|
||||
let lines = fuf#getFileLines(item.path)
|
||||
if empty(lines)
|
||||
return []
|
||||
endif
|
||||
let index = s:getMatchingLineNumber(lines, item.pattern, item.lnum) - 1
|
||||
return fuf#makePreviewLinesAround(
|
||||
\ lines, [index], a:count, self.getPreviewHeight())
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getCompleteItems(patternPrimary)
|
||||
return self.items
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onOpen(word, mode)
|
||||
if a:mode ==# s:OPEN_TYPE_DELETE
|
||||
let items = fuf#loadDataFile(s:MODE_NAME, 'items')
|
||||
call filter(items, 'v:val.word !=# a:word')
|
||||
call fuf#saveDataFile(s:MODE_NAME, 'items', items)
|
||||
let self.reservedMode = self.getModeName()
|
||||
return
|
||||
else
|
||||
let item = s:findItem(fuf#loadDataFile(s:MODE_NAME, 'items'), a:word)
|
||||
if !empty(item)
|
||||
call s:jumpToBookmark(item.path, a:mode, item.pattern, item.lnum)
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeEnterPre()
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeEnterPost()
|
||||
call fuf#defineKeyMappingInHandler(g:fuf_bookmarkfile_keyDelete,
|
||||
\ 'onCr(' . s:OPEN_TYPE_DELETE . ')')
|
||||
let self.items = fuf#loadDataFile(s:MODE_NAME, 'items')
|
||||
call map(self.items, 'fuf#makeNonPathItem(v:val.word, strftime(g:fuf_timeFormat, v:val.time))')
|
||||
call fuf#mapToSetSerialIndex(self.items, 1)
|
||||
call map(self.items, 'fuf#setAbbrWithFormattedWord(v:val, 1)')
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeLeavePost(opened)
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" vim: set fdm=marker:
|
||||
189
.vim/bundle/vim-fuzzyfinder/autoload/fuf/buffer.vim
Normal file
189
.vim/bundle/vim-fuzzyfinder/autoload/fuf/buffer.vim
Normal file
|
|
@ -0,0 +1,189 @@
|
|||
"=============================================================================
|
||||
" Copyright (c) 2007-2010 Takeshi NISHIDA
|
||||
"
|
||||
"=============================================================================
|
||||
" LOAD GUARD {{{1
|
||||
|
||||
if !l9#guardScriptLoading(expand('<sfile>:p'), 0, 0, [])
|
||||
finish
|
||||
endif
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" GLOBAL FUNCTIONS {{{1
|
||||
|
||||
"
|
||||
function fuf#buffer#createHandler(base)
|
||||
return a:base.concretize(copy(s:handler))
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#buffer#getSwitchOrder()
|
||||
return g:fuf_buffer_switchOrder
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#buffer#getEditableDataNames()
|
||||
return []
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#buffer#renewCache()
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#buffer#requiresOnCommandPre()
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#buffer#onInit()
|
||||
call fuf#defineLaunchCommand('FufBuffer', s:MODE_NAME, '""', [])
|
||||
augroup fuf#buffer
|
||||
autocmd!
|
||||
autocmd BufEnter * call s:updateBufTimes()
|
||||
autocmd BufWritePost * call s:updateBufTimes()
|
||||
augroup END
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" LOCAL FUNCTIONS/VARIABLES {{{1
|
||||
|
||||
let s:MODE_NAME = expand('<sfile>:t:r')
|
||||
let s:OPEN_TYPE_DELETE = -1
|
||||
|
||||
let s:bufTimes = {}
|
||||
|
||||
"
|
||||
function s:updateBufTimes()
|
||||
let s:bufTimes[bufnr('%')] = localtime()
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:makeItem(nr)
|
||||
let fname = (empty(bufname(a:nr))
|
||||
\ ? '[No Name]'
|
||||
\ : fnamemodify(bufname(a:nr), ':p:~:.'))
|
||||
let time = (exists('s:bufTimes[a:nr]') ? s:bufTimes[a:nr] : 0)
|
||||
let item = fuf#makePathItem(fname, strftime(g:fuf_timeFormat, time), 0)
|
||||
let item.index = a:nr
|
||||
let item.bufNr = a:nr
|
||||
let item.time = time
|
||||
let item.abbrPrefix = s:getBufIndicator(a:nr) . ' '
|
||||
return item
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:getBufIndicator(bufNr)
|
||||
if !getbufvar(a:bufNr, '&modifiable')
|
||||
return '[-]'
|
||||
elseif getbufvar(a:bufNr, '&modified')
|
||||
return '[+]'
|
||||
elseif getbufvar(a:bufNr, '&readonly')
|
||||
return '[R]'
|
||||
else
|
||||
return ' '
|
||||
endif
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:compareTimeDescending(i1, i2)
|
||||
return a:i1.time == a:i2.time ? 0 : a:i1.time > a:i2.time ? -1 : +1
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:findItem(items, word)
|
||||
for item in a:items
|
||||
if item.word ==# a:word
|
||||
return item
|
||||
endif
|
||||
endfor
|
||||
return {}
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" s:handler {{{1
|
||||
|
||||
let s:handler = {}
|
||||
|
||||
"
|
||||
function s:handler.getModeName()
|
||||
return s:MODE_NAME
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getPrompt()
|
||||
return fuf#formatPrompt(g:fuf_buffer_prompt, self.partialMatching, '')
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getPreviewHeight()
|
||||
return g:fuf_previewHeight
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.isOpenable(enteredPattern)
|
||||
return 1
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.makePatternSet(patternBase)
|
||||
return fuf#makePatternSet(a:patternBase, 's:interpretPrimaryPatternForPath',
|
||||
\ self.partialMatching)
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.makePreviewLines(word, count)
|
||||
let item = s:findItem(self.items, a:word)
|
||||
if empty(item)
|
||||
return []
|
||||
endif
|
||||
return fuf#makePreviewLinesForFile(item.bufNr, a:count, self.getPreviewHeight())
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getCompleteItems(patternPrimary)
|
||||
return self.items
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onOpen(word, mode)
|
||||
" not use bufnr(a:word) in order to handle unnamed buffer
|
||||
let item = s:findItem(self.items, a:word)
|
||||
if empty(item)
|
||||
" do nothing
|
||||
elseif a:mode ==# s:OPEN_TYPE_DELETE
|
||||
execute item.bufNr . 'bdelete'
|
||||
let self.reservedMode = self.getModeName()
|
||||
else
|
||||
call fuf#openBuffer(item.bufNr, a:mode, g:fuf_reuseWindow)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeEnterPre()
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeEnterPost()
|
||||
call fuf#defineKeyMappingInHandler(g:fuf_buffer_keyDelete,
|
||||
\ 'onCr(' . s:OPEN_TYPE_DELETE . ')')
|
||||
let self.items = range(1, bufnr('$'))
|
||||
call filter(self.items, 'buflisted(v:val) && v:val != self.bufNrPrev && v:val != bufnr("%")')
|
||||
call map(self.items, 's:makeItem(v:val)')
|
||||
if g:fuf_buffer_mruOrder
|
||||
call sort(self.items, 's:compareTimeDescending')
|
||||
call fuf#mapToSetSerialIndex(self.items, 1)
|
||||
endif
|
||||
let self.items = fuf#mapToSetAbbrWithSnippedWordAsPath(self.items)
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeLeavePost(opened)
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" vim: set fdm=marker:
|
||||
300
.vim/bundle/vim-fuzzyfinder/autoload/fuf/buffertag.vim
Normal file
300
.vim/bundle/vim-fuzzyfinder/autoload/fuf/buffertag.vim
Normal file
|
|
@ -0,0 +1,300 @@
|
|||
"=============================================================================
|
||||
" Copyright (c) 2010 Takeshi NISHIDA
|
||||
"
|
||||
"=============================================================================
|
||||
" LOAD GUARD {{{1
|
||||
|
||||
if !l9#guardScriptLoading(expand('<sfile>:p'), 0, 0, [])
|
||||
finish
|
||||
endif
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" GLOBAL FUNCTIONS {{{1
|
||||
|
||||
"
|
||||
function fuf#buffertag#createHandler(base)
|
||||
return a:base.concretize(copy(s:handler))
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#buffertag#getSwitchOrder()
|
||||
return g:fuf_buffertag_switchOrder
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#buffertag#getEditableDataNames()
|
||||
return []
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#buffertag#renewCache()
|
||||
let s:tagItemsCache = {}
|
||||
let s:tagDataCache = {}
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#buffertag#requiresOnCommandPre()
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#buffertag#onInit()
|
||||
call fuf#defineLaunchCommand('FufBufferTag', s:MODE_NAME, '""',
|
||||
\ [['g:fuf_buffertag_forAll', 0]])
|
||||
call fuf#defineLaunchCommand('FufBufferTagAll', s:MODE_NAME, '""',
|
||||
\ [['g:fuf_buffertag_forAll', 1]])
|
||||
call fuf#defineLaunchCommand('FufBufferTagWithCursorWord', s:MODE_NAME,
|
||||
\ 'expand(''<cword>'')', [['g:fuf_buffertag_forAll', 0]])
|
||||
call fuf#defineLaunchCommand('FufBufferTagAllWithCursorWord', s:MODE_NAME,
|
||||
\ 'expand(''<cword>'')', [['g:fuf_buffertag_forAll', 1]])
|
||||
call fuf#defineLaunchCommand('FufBufferTagWithSelectedText', s:MODE_NAME,
|
||||
\ 'l9#getSelectedText()', [['g:fuf_buffertag_forAll', 0]])
|
||||
call fuf#defineLaunchCommand('FufBufferTagAllWithSelectedText', s:MODE_NAME,
|
||||
\ 'l9#getSelectedText()', [['g:fuf_buffertag_forAll', 1]])
|
||||
call l9#defineVariableDefault('g:fuf_buffertag_forAll', 0) " private option
|
||||
" the following settings originate from taglist.vim
|
||||
call l9#defineVariableDefault('g:fuf_buffertag__asm' , '--language-force=asm --asm-types=dlmt')
|
||||
call l9#defineVariableDefault('g:fuf_buffertag__aspperl' , '--language-force=asp --asp-types=fsv')
|
||||
call l9#defineVariableDefault('g:fuf_buffertag__aspvbs' , '--language-force=asp --asp-types=fsv')
|
||||
call l9#defineVariableDefault('g:fuf_buffertag__awk' , '--language-force=awk --awk-types=f')
|
||||
call l9#defineVariableDefault('g:fuf_buffertag__beta' , '--language-force=beta --beta-types=fsv')
|
||||
call l9#defineVariableDefault('g:fuf_buffertag__c' , '--language-force=c --c-types=dgsutvf')
|
||||
call l9#defineVariableDefault('g:fuf_buffertag__cpp' , '--language-force=c++ --c++-types=nvdtcgsuf')
|
||||
call l9#defineVariableDefault('g:fuf_buffertag__cs' , '--language-force=c# --c#-types=dtncEgsipm')
|
||||
call l9#defineVariableDefault('g:fuf_buffertag__cobol' , '--language-force=cobol --cobol-types=dfgpPs')
|
||||
call l9#defineVariableDefault('g:fuf_buffertag__eiffel' , '--language-force=eiffel --eiffel-types=cf')
|
||||
call l9#defineVariableDefault('g:fuf_buffertag__erlang' , '--language-force=erlang --erlang-types=drmf')
|
||||
call l9#defineVariableDefault('g:fuf_buffertag__expect' , '--language-force=tcl --tcl-types=cfp')
|
||||
call l9#defineVariableDefault('g:fuf_buffertag__fortran' , '--language-force=fortran --fortran-types=pbceiklmntvfs')
|
||||
call l9#defineVariableDefault('g:fuf_buffertag__html' , '--language-force=html --html-types=af')
|
||||
call l9#defineVariableDefault('g:fuf_buffertag__java' , '--language-force=java --java-types=pcifm')
|
||||
call l9#defineVariableDefault('g:fuf_buffertag__javascript', '--language-force=javascript --javascript-types=f')
|
||||
call l9#defineVariableDefault('g:fuf_buffertag__lisp' , '--language-force=lisp --lisp-types=f')
|
||||
call l9#defineVariableDefault('g:fuf_buffertag__lua' , '--language-force=lua --lua-types=f')
|
||||
call l9#defineVariableDefault('g:fuf_buffertag__make' , '--language-force=make --make-types=m')
|
||||
call l9#defineVariableDefault('g:fuf_buffertag__pascal' , '--language-force=pascal --pascal-types=fp')
|
||||
call l9#defineVariableDefault('g:fuf_buffertag__perl' , '--language-force=perl --perl-types=clps')
|
||||
call l9#defineVariableDefault('g:fuf_buffertag__php' , '--language-force=php --php-types=cdvf')
|
||||
call l9#defineVariableDefault('g:fuf_buffertag__python' , '--language-force=python --python-types=cmf')
|
||||
call l9#defineVariableDefault('g:fuf_buffertag__rexx' , '--language-force=rexx --rexx-types=s')
|
||||
call l9#defineVariableDefault('g:fuf_buffertag__ruby' , '--language-force=ruby --ruby-types=cfFm')
|
||||
call l9#defineVariableDefault('g:fuf_buffertag__scheme' , '--language-force=scheme --scheme-types=sf')
|
||||
call l9#defineVariableDefault('g:fuf_buffertag__sh' , '--language-force=sh --sh-types=f')
|
||||
call l9#defineVariableDefault('g:fuf_buffertag__csh' , '--language-force=sh --sh-types=f')
|
||||
call l9#defineVariableDefault('g:fuf_buffertag__zsh' , '--language-force=sh --sh-types=f')
|
||||
call l9#defineVariableDefault('g:fuf_buffertag__slang' , '--language-force=slang --slang-types=nf')
|
||||
call l9#defineVariableDefault('g:fuf_buffertag__sml' , '--language-force=sml --sml-types=ecsrtvf')
|
||||
call l9#defineVariableDefault('g:fuf_buffertag__sql' , '--language-force=sql --sql-types=cFPrstTvfp')
|
||||
call l9#defineVariableDefault('g:fuf_buffertag__tcl' , '--language-force=tcl --tcl-types=cfmp')
|
||||
call l9#defineVariableDefault('g:fuf_buffertag__vera' , '--language-force=vera --vera-types=cdefgmpPtTvx')
|
||||
call l9#defineVariableDefault('g:fuf_buffertag__verilog' , '--language-force=verilog --verilog-types=mcPertwpvf')
|
||||
call l9#defineVariableDefault('g:fuf_buffertag__vim' , '--language-force=vim --vim-types=avf')
|
||||
call l9#defineVariableDefault('g:fuf_buffertag__yacc' , '--language-force=yacc --yacc-types=l')
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" LOCAL FUNCTIONS/VARIABLES {{{1
|
||||
|
||||
let s:MODE_NAME = expand('<sfile>:t:r')
|
||||
|
||||
"
|
||||
function s:parseTagLine(line)
|
||||
" tag W:\Win32\SRC7\NCSIM\NCVW32\CUBEFACE.H /^#define CUBEFACE_H$/;" macro line:4
|
||||
let fields = matchlist(a:line, '\v^([^\t]+)\t(.+)\t\/\^(.+)\$\/\;\"\t(.+)\tline\:(\d+)')
|
||||
if empty(fields)
|
||||
return {}
|
||||
endif
|
||||
return {
|
||||
\ 'tag' : fields[1],
|
||||
\ 'fname' : fields[2],
|
||||
\ 'pattern': fields[3],
|
||||
\ 'kind' : fields[4],
|
||||
\ 'lnum' : str2nr(fields[5]),
|
||||
\ }
|
||||
endfunction
|
||||
|
||||
"
|
||||
let s:TEMP_VARIABLES_GROUP = expand('<sfile>:p')
|
||||
|
||||
"
|
||||
function s:getFileType(bufNr)
|
||||
let ft = getbufvar(a:bufNr, '&filetype')
|
||||
if !empty(ft) || bufloaded(a:bufNr)
|
||||
return ft
|
||||
endif
|
||||
let ft = getbufvar(a:bufNr, 'fuf_buffertag_filetype')
|
||||
if !empty(ft)
|
||||
return ft
|
||||
endif
|
||||
call l9#tempvariables#set(s:TEMP_VARIABLES_GROUP, '&eventignore', 'FileType')
|
||||
call l9#tempvariables#set(s:TEMP_VARIABLES_GROUP, '&filetype', &filetype)
|
||||
" from taglist.vim
|
||||
execute 'doautocmd filetypedetect BufRead ' . bufname(a:bufNr)
|
||||
let ft = &filetype
|
||||
call l9#tempvariables#end(s:TEMP_VARIABLES_GROUP)
|
||||
call setbufvar(a:bufNr, 'fuf_buffertag_filetype', ft)
|
||||
return ft
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:makeCtagsCmd(bufNr)
|
||||
let ft = s:getFileType(a:bufNr)
|
||||
if !exists('g:fuf_buffertag__{ft}')
|
||||
return ''
|
||||
endif
|
||||
"
|
||||
let cmd = join([g:fuf_buffertag_ctagsPath,
|
||||
\ '-f - --sort=no --excmd=pattern --fields=nKs',
|
||||
\ g:fuf_buffertag__{ft},
|
||||
\ shellescape(fnamemodify(bufname(a:bufNr), ':p'))])
|
||||
return cmd
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:getTagItems(bufNr)
|
||||
let cmd = s:makeCtagsCmd(a:bufNr)
|
||||
if empty(cmd)
|
||||
return []
|
||||
elseif !exists('s:tagItemsCache[cmd]') ||
|
||||
\ s:tagItemsCache[cmd].time < getftime(expand(bufname(a:bufNr)))
|
||||
let items = split(system(cmd), "\n")
|
||||
if v:shell_error
|
||||
call fuf#echoError([cmd] + items)
|
||||
throw "Command error"
|
||||
endif
|
||||
call map(items, 's:parseTagLine(v:val)')
|
||||
call filter(items, '!empty(v:val)')
|
||||
let s:tagItemsCache[cmd] = {
|
||||
\ 'time' : localtime(),
|
||||
\ 'items' : items,
|
||||
\ }
|
||||
endif
|
||||
return s:tagItemsCache[cmd].items
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:makeItem(tag, itemMap)
|
||||
let menu = fnamemodify(a:itemMap[a:tag][0].fname, ':t')
|
||||
\ . ' [' . a:itemMap[a:tag][0].kind . ']'
|
||||
if len(a:itemMap[a:tag]) > 1
|
||||
let menu .= ' (' . len(a:itemMap[a:tag]) . ')'
|
||||
endif
|
||||
let item = fuf#makeNonPathItem(a:tag, menu)
|
||||
return item
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:getTagData(bufNrs)
|
||||
let key = join([0] + sort(copy(a:bufNrs)), "\n")
|
||||
let bufNames = map(copy(a:bufNrs), 'bufname(v:val)')
|
||||
if !exists('s:tagDataCache[key]') ||
|
||||
\ fuf#countModifiedFiles(bufNames, s:tagDataCache[key].time) > 0
|
||||
let itemMap = {}
|
||||
for item in l9#concat(map(copy(a:bufNrs), 's:getTagItems(v:val)'))
|
||||
if !exists('itemMap[item.tag]')
|
||||
let itemMap[item.tag] = []
|
||||
endif
|
||||
call add(itemMap[item.tag], item)
|
||||
endfor
|
||||
let items = sort(keys(itemMap))
|
||||
call map(items, 's:makeItem(v:val, itemMap)')
|
||||
call fuf#mapToSetSerialIndex(items, 1)
|
||||
call map(items, 'fuf#setAbbrWithFormattedWord(v:val, 1)')
|
||||
let s:tagDataCache[key] = {
|
||||
\ 'time' : localtime(),
|
||||
\ 'itemMap': itemMap,
|
||||
\ 'items' : items,
|
||||
\ }
|
||||
endif
|
||||
return [s:tagDataCache[key].items, s:tagDataCache[key].itemMap]
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:jumpToTag(item, mode)
|
||||
call fuf#openFile(a:item.fname, a:mode, g:fuf_reuseWindow)
|
||||
call cursor(a:item.lnum, 1)
|
||||
normal! zvzz
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" s:handler {{{1
|
||||
|
||||
let s:handler = {}
|
||||
|
||||
"
|
||||
function s:handler.getModeName()
|
||||
return s:MODE_NAME
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getPrompt()
|
||||
return fuf#formatPrompt(g:fuf_buffertag_prompt, self.partialMatching, '')
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getPreviewHeight()
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.isOpenable(enteredPattern)
|
||||
return 1
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.makePatternSet(patternBase)
|
||||
return fuf#makePatternSet(a:patternBase, 's:interpretPrimaryPatternForNonPath',
|
||||
\ self.partialMatching)
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.makePreviewLines(word, count)
|
||||
return []
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getCompleteItems(patternPrimary)
|
||||
return self.items
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onOpen(word, mode)
|
||||
if !exists('self.itemMap[a:word][0]')
|
||||
call fuf#echoError('Definition not found:' . a:word)
|
||||
return
|
||||
elseif len(self.itemMap[a:word]) == 1
|
||||
let i = 0
|
||||
else
|
||||
let list = map(fuf#mapToSetSerialIndex(copy(self.itemMap[a:word]), 1),
|
||||
\ 'printf(" %2d: %s|%d| [%s] %s",v:val.index, fnamemodify(v:val.fname, ":~:."), v:val.lnum, v:val.kind, v:val.pattern)')
|
||||
let i = inputlist(['Select a definition of "' . a:word . '":'] + list) - 1
|
||||
endif
|
||||
if 0 <= i && i < len(self.itemMap[a:word])
|
||||
call s:jumpToTag(self.itemMap[a:word][i], a:mode)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeEnterPre()
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeEnterPost()
|
||||
if g:fuf_buffertag_forAll
|
||||
let bufNrs = filter(range(1, bufnr('$')), 'buflisted(v:val)')
|
||||
else
|
||||
let bufNrs = [self.bufNrPrev]
|
||||
endif
|
||||
let [self.items, self.itemMap] = s:getTagData(bufNrs)
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeLeavePost(opened)
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" vim: set fdm=marker:
|
||||
137
.vim/bundle/vim-fuzzyfinder/autoload/fuf/callbackfile.vim
Normal file
137
.vim/bundle/vim-fuzzyfinder/autoload/fuf/callbackfile.vim
Normal file
|
|
@ -0,0 +1,137 @@
|
|||
"=============================================================================
|
||||
" Copyright (c) 2007-2010 Takeshi NISHIDA
|
||||
"
|
||||
"=============================================================================
|
||||
" LOAD GUARD {{{1
|
||||
|
||||
if !l9#guardScriptLoading(expand('<sfile>:p'), 0, 0, [])
|
||||
finish
|
||||
endif
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" GLOBAL FUNCTIONS {{{1
|
||||
|
||||
"
|
||||
function fuf#callbackfile#createHandler(base)
|
||||
return a:base.concretize(copy(s:handler))
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#callbackfile#getSwitchOrder()
|
||||
return -1
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#callbackfile#getEditableDataNames()
|
||||
return []
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#callbackfile#renewCache()
|
||||
let s:cache = {}
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#callbackfile#requiresOnCommandPre()
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#callbackfile#onInit()
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#callbackfile#launch(initialPattern, partialMatching, prompt, exclude, listener)
|
||||
let s:prompt = (empty(a:prompt) ? '>' : a:prompt)
|
||||
let s:exclude = a:exclude
|
||||
let s:listener = a:listener
|
||||
call fuf#launch(s:MODE_NAME, a:initialPattern, a:partialMatching)
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" LOCAL FUNCTIONS/VARIABLES {{{1
|
||||
|
||||
let s:MODE_NAME = expand('<sfile>:t:r')
|
||||
|
||||
"
|
||||
function s:enumItems(dir)
|
||||
let key = getcwd() . g:fuf_ignoreCase . s:exclude . "\n" . a:dir
|
||||
if !exists('s:cache[key]')
|
||||
let s:cache[key] = fuf#enumExpandedDirsEntries(a:dir, s:exclude)
|
||||
if isdirectory(a:dir)
|
||||
call insert(s:cache[key], fuf#makePathItem(a:dir . '.', '', 0))
|
||||
endif
|
||||
call fuf#mapToSetSerialIndex(s:cache[key], 1)
|
||||
call fuf#mapToSetAbbrWithSnippedWordAsPath(s:cache[key])
|
||||
endif
|
||||
return s:cache[key]
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" s:handler {{{1
|
||||
|
||||
let s:handler = {}
|
||||
|
||||
"
|
||||
function s:handler.getModeName()
|
||||
return s:MODE_NAME
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getPrompt()
|
||||
return fuf#formatPrompt(s:prompt, self.partialMatching, '')
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getPreviewHeight()
|
||||
return g:fuf_previewHeight
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.isOpenable(enteredPattern)
|
||||
return a:enteredPattern =~# '[^/\\]$'
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.makePatternSet(patternBase)
|
||||
return fuf#makePatternSet(a:patternBase, 's:interpretPrimaryPatternForPathTail',
|
||||
\ self.partialMatching)
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.makePreviewLines(word, count)
|
||||
return fuf#makePreviewLinesForFile(a:word, a:count, self.getPreviewHeight())
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getCompleteItems(patternPrimary)
|
||||
let items = copy(s:enumItems(fuf#splitPath(a:patternPrimary).head))
|
||||
return filter(items, 'bufnr("^" . v:val.word . "$") != self.bufNrPrev')
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onOpen(word, mode)
|
||||
call s:listener.onComplete(a:word, a:mode)
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeEnterPre()
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeEnterPost()
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeLeavePost(opened)
|
||||
if !a:opened && exists('s:listener.onAbort()')
|
||||
call s:listener.onAbort()
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" vim: set fdm=marker:
|
||||
139
.vim/bundle/vim-fuzzyfinder/autoload/fuf/callbackitem.vim
Normal file
139
.vim/bundle/vim-fuzzyfinder/autoload/fuf/callbackitem.vim
Normal file
|
|
@ -0,0 +1,139 @@
|
|||
"=============================================================================
|
||||
" Copyright (c) 2007-2010 Takeshi NISHIDA
|
||||
"
|
||||
"=============================================================================
|
||||
" LOAD GUARD {{{1
|
||||
|
||||
if !l9#guardScriptLoading(expand('<sfile>:p'), 0, 0, [])
|
||||
finish
|
||||
endif
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" GLOBAL FUNCTIONS {{{1
|
||||
|
||||
"
|
||||
function fuf#callbackitem#createHandler(base)
|
||||
return a:base.concretize(copy(s:handler))
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#callbackitem#getSwitchOrder()
|
||||
return -1
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#callbackitem#getEditableDataNames()
|
||||
return []
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#callbackitem#renewCache()
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#callbackitem#requiresOnCommandPre()
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#callbackitem#onInit()
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#callbackitem#launch(initialPattern, partialMatching, prompt, listener, items, forPath)
|
||||
let s:prompt = (empty(a:prompt) ? '>' : a:prompt)
|
||||
let s:listener = a:listener
|
||||
let s:forPath = a:forPath
|
||||
let s:items = copy(a:items)
|
||||
if s:forPath
|
||||
call map(s:items, 'fuf#makePathItem(v:val, "", 1)')
|
||||
call fuf#mapToSetSerialIndex(s:items, 1)
|
||||
call fuf#mapToSetAbbrWithSnippedWordAsPath(s:items)
|
||||
else
|
||||
call map(s:items, 'fuf#makeNonPathItem(v:val, "")')
|
||||
call fuf#mapToSetSerialIndex(s:items, 1)
|
||||
call map(s:items, 'fuf#setAbbrWithFormattedWord(v:val, 1)')
|
||||
endif
|
||||
call fuf#launch(s:MODE_NAME, a:initialPattern, a:partialMatching)
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" LOCAL FUNCTIONS/VARIABLES {{{1
|
||||
|
||||
let s:MODE_NAME = expand('<sfile>:t:r')
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" s:handler {{{1
|
||||
|
||||
let s:handler = {}
|
||||
|
||||
"
|
||||
function s:handler.getModeName()
|
||||
return s:MODE_NAME
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getPrompt()
|
||||
return fuf#formatPrompt(s:prompt, self.partialMatching, '')
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getPreviewHeight()
|
||||
if s:forPath
|
||||
return g:fuf_previewHeight
|
||||
endif
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.isOpenable(enteredPattern)
|
||||
return 1
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.makePatternSet(patternBase)
|
||||
let parser = (s:forPath
|
||||
\ ? 's:interpretPrimaryPatternForPath'
|
||||
\ : 's:interpretPrimaryPatternForNonPath')
|
||||
return fuf#makePatternSet(a:patternBase, parser, self.partialMatching)
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.makePreviewLines(word, count)
|
||||
if s:forPath
|
||||
return fuf#makePreviewLinesForFile(a:word, a:count, self.getPreviewHeight())
|
||||
endif
|
||||
return []
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getCompleteItems(patternPrimary)
|
||||
return s:items
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onOpen(word, mode)
|
||||
call s:listener.onComplete(a:word, a:mode)
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeEnterPre()
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeEnterPost()
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeLeavePost(opened)
|
||||
if !a:opened && exists('s:listener.onAbort()')
|
||||
call s:listener.onAbort()
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" vim: set fdm=marker:
|
||||
172
.vim/bundle/vim-fuzzyfinder/autoload/fuf/changelist.vim
Normal file
172
.vim/bundle/vim-fuzzyfinder/autoload/fuf/changelist.vim
Normal file
|
|
@ -0,0 +1,172 @@
|
|||
"=============================================================================
|
||||
" Copyright (c) 2007-2010 Takeshi NISHIDA
|
||||
"
|
||||
"=============================================================================
|
||||
" LOAD GUARD {{{1
|
||||
|
||||
if !l9#guardScriptLoading(expand('<sfile>:p'), 0, 0, [])
|
||||
finish
|
||||
endif
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" GLOBAL FUNCTIONS {{{1
|
||||
|
||||
"
|
||||
function fuf#changelist#createHandler(base)
|
||||
return a:base.concretize(copy(s:handler))
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#changelist#getSwitchOrder()
|
||||
return g:fuf_changelist_switchOrder
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#changelist#getEditableDataNames()
|
||||
return []
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#changelist#renewCache()
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#changelist#requiresOnCommandPre()
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#changelist#onInit()
|
||||
call fuf#defineLaunchCommand('FufChangeList', s:MODE_NAME, '""', [])
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" LOCAL FUNCTIONS/VARIABLES {{{1
|
||||
|
||||
let s:MODE_NAME = expand('<sfile>:t:r')
|
||||
|
||||
"
|
||||
function s:getChangesLines()
|
||||
redir => result
|
||||
:silent changes
|
||||
redir END
|
||||
return split(result, "\n")
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:parseChangesLine(line)
|
||||
" return matchlist(a:line, '^\(.\)\s\+\(\d\+\)\s\(.*\)$')
|
||||
let elements = matchlist(a:line, '\v^(.)\s*(\d+)\s+(\d+)\s+(\d+)\s*(.*)$')
|
||||
if empty(elements)
|
||||
return {}
|
||||
endif
|
||||
return {
|
||||
\ 'prefix': elements[1],
|
||||
\ 'count' : elements[2],
|
||||
\ 'lnum' : elements[3],
|
||||
\ 'text' : printf('|%d:%d|%s', elements[3], elements[4], elements[5]),
|
||||
\ }
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:makeItem(line)
|
||||
let parsed = s:parseChangesLine(a:line)
|
||||
if empty(parsed)
|
||||
return {}
|
||||
endif
|
||||
let item = fuf#makeNonPathItem(parsed.text, '')
|
||||
let item.abbrPrefix = parsed.prefix
|
||||
let item.lnum = parsed.lnum
|
||||
return item
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" s:handler {{{1
|
||||
|
||||
let s:handler = {}
|
||||
|
||||
"
|
||||
function s:handler.getModeName()
|
||||
return s:MODE_NAME
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getPrompt()
|
||||
return fuf#formatPrompt(g:fuf_changelist_prompt, self.partialMatching, '')
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getPreviewHeight()
|
||||
return g:fuf_previewHeight
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.isOpenable(enteredPattern)
|
||||
return 1
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.makePatternSet(patternBase)
|
||||
return fuf#makePatternSet(a:patternBase, 's:interpretPrimaryPatternForNonPath',
|
||||
\ self.partialMatching)
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.makePreviewLines(word, count)
|
||||
let items = filter(copy(self.items), 'v:val.word ==# a:word')
|
||||
if empty(items)
|
||||
return []
|
||||
endif
|
||||
let lines = fuf#getFileLines(self.bufNrPrev)
|
||||
return fuf#makePreviewLinesAround(
|
||||
\ lines, [items[0].lnum - 1], a:count, self.getPreviewHeight())
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getCompleteItems(patternPrimary)
|
||||
return self.items
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onOpen(word, mode)
|
||||
call fuf#prejump(a:mode)
|
||||
let older = 0
|
||||
for line in reverse(s:getChangesLines())
|
||||
if stridx(line, '>') == 0
|
||||
let older = 1
|
||||
endif
|
||||
let parsed = s:parseChangesLine(line)
|
||||
if !empty(parsed) && parsed.text ==# a:word
|
||||
if parsed.count != 0
|
||||
execute 'normal! ' . parsed.count . (older ? 'g;' : 'g,') . 'zvzz'
|
||||
endif
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeEnterPre()
|
||||
let self.items = s:getChangesLines()
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeEnterPost()
|
||||
call map(self.items, 's:makeItem(v:val)')
|
||||
call filter(self.items, '!empty(v:val)')
|
||||
call reverse(self.items)
|
||||
call fuf#mapToSetSerialIndex(self.items, 1)
|
||||
call map(self.items, 'fuf#setAbbrWithFormattedWord(v:val, 1)')
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeLeavePost(opened)
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" vim: set fdm=marker:
|
||||
|
||||
199
.vim/bundle/vim-fuzzyfinder/autoload/fuf/coveragefile.vim
Normal file
199
.vim/bundle/vim-fuzzyfinder/autoload/fuf/coveragefile.vim
Normal file
|
|
@ -0,0 +1,199 @@
|
|||
"=============================================================================
|
||||
" Copyright (c) 2007-2010 Takeshi NISHIDA
|
||||
"
|
||||
"=============================================================================
|
||||
" LOAD GUARD {{{1
|
||||
|
||||
if !l9#guardScriptLoading(expand('<sfile>:p'), 0, 0, [])
|
||||
finish
|
||||
endif
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" GLOBAL FUNCTIONS {{{1
|
||||
|
||||
"
|
||||
function fuf#coveragefile#createHandler(base)
|
||||
return a:base.concretize(copy(s:handler))
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#coveragefile#getSwitchOrder()
|
||||
return g:fuf_coveragefile_switchOrder
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#coveragefile#getEditableDataNames()
|
||||
return ['coverages']
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#coveragefile#renewCache()
|
||||
let s:cache = {}
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#coveragefile#requiresOnCommandPre()
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#coveragefile#onInit()
|
||||
call fuf#defineLaunchCommand('FufCoverageFile', s:MODE_NAME, '""', [])
|
||||
call l9#defineVariableDefault('g:fuf_coveragefile_name', '') " private option
|
||||
command! -bang -narg=0 FufCoverageFileRegister call s:registerCoverage()
|
||||
command! -bang -narg=? FufCoverageFileChange call s:changeCoverage(<q-args>)
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" LOCAL FUNCTIONS/VARIABLES {{{1
|
||||
|
||||
let s:MODE_NAME = expand('<sfile>:t:r')
|
||||
|
||||
"
|
||||
function s:enumItems()
|
||||
let key = join([getcwd(), g:fuf_ignoreCase, g:fuf_coveragefile_exclude,
|
||||
\ g:fuf_coveragefile_globPatterns], "\n")
|
||||
if !exists('s:cache[key]')
|
||||
let s:cache[key] = l9#concat(map(copy(g:fuf_coveragefile_globPatterns),
|
||||
\ 'fuf#glob(v:val)'))
|
||||
call filter(s:cache[key], 'filereadable(v:val)') " filter out directories
|
||||
call map(s:cache[key], 'fuf#makePathItem(fnamemodify(v:val, ":~:."), "", 0)')
|
||||
if len(g:fuf_coveragefile_exclude)
|
||||
call filter(s:cache[key], 'v:val.word !~ g:fuf_coveragefile_exclude')
|
||||
endif
|
||||
call fuf#mapToSetSerialIndex(s:cache[key], 1)
|
||||
call fuf#mapToSetAbbrWithSnippedWordAsPath(s:cache[key])
|
||||
endif
|
||||
return s:cache[key]
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:registerCoverage()
|
||||
let patterns = []
|
||||
while 1
|
||||
let pattern = l9#inputHl('Question', '[fuf] Glob pattern for coverage (<Esc> and end):',
|
||||
\ '', 'file')
|
||||
if pattern !~ '\S'
|
||||
break
|
||||
endif
|
||||
call add(patterns, pattern)
|
||||
endwhile
|
||||
if empty(patterns)
|
||||
call fuf#echoWarning('Canceled')
|
||||
return
|
||||
endif
|
||||
echo '[fuf] patterns: ' . string(patterns)
|
||||
let name = l9#inputHl('Question', '[fuf] Coverage name:')
|
||||
if name !~ '\S'
|
||||
call fuf#echoWarning('Canceled')
|
||||
return
|
||||
endif
|
||||
let coverages = fuf#loadDataFile(s:MODE_NAME, 'coverages')
|
||||
call insert(coverages, {'name': name, 'patterns': patterns})
|
||||
call fuf#saveDataFile(s:MODE_NAME, 'coverages', coverages)
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:createChangeCoverageListener()
|
||||
let listener = {}
|
||||
|
||||
function listener.onComplete(name, method)
|
||||
call s:changeCoverage(a:name)
|
||||
endfunction
|
||||
|
||||
return listener
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:changeCoverage(name)
|
||||
let coverages = fuf#loadDataFile(s:MODE_NAME, 'coverages')
|
||||
if a:name !~ '\S'
|
||||
let names = map(copy(coverages), 'v:val.name')
|
||||
call fuf#callbackitem#launch('', 0, '>Coverage>', s:createChangeCoverageListener(), names, 0)
|
||||
return
|
||||
else
|
||||
let name = a:name
|
||||
endif
|
||||
call filter(coverages, 'v:val.name ==# name')
|
||||
if empty(coverages)
|
||||
call fuf#echoError('Coverage not found: ' . name)
|
||||
return
|
||||
endif
|
||||
call fuf#setOneTimeVariables(
|
||||
\ ['g:fuf_coveragefile_globPatterns', coverages[0].patterns],
|
||||
\ ['g:fuf_coveragefile_name' , a:name]
|
||||
\ )
|
||||
FufCoverageFile
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" s:handler {{{1
|
||||
|
||||
let s:handler = {}
|
||||
|
||||
"
|
||||
function s:handler.getModeName()
|
||||
return s:MODE_NAME
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getPrompt()
|
||||
let nameString = (empty(g:fuf_coveragefile_name) ? ''
|
||||
\ : '[' . g:fuf_coveragefile_name . ']')
|
||||
return fuf#formatPrompt(g:fuf_coveragefile_prompt, self.partialMatching,
|
||||
\ nameString)
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getPreviewHeight()
|
||||
return g:fuf_previewHeight
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.isOpenable(enteredPattern)
|
||||
return 1
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.makePatternSet(patternBase)
|
||||
return fuf#makePatternSet(a:patternBase, 's:interpretPrimaryPatternForPath',
|
||||
\ self.partialMatching)
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.makePreviewLines(word, count)
|
||||
return fuf#makePreviewLinesForFile(a:word, a:count, self.getPreviewHeight())
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getCompleteItems(patternPrimary)
|
||||
return self.items
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onOpen(word, mode)
|
||||
call fuf#openFile(a:word, a:mode, g:fuf_reuseWindow)
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeEnterPre()
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeEnterPost()
|
||||
" NOTE: Comparing filenames is faster than bufnr('^' . fname . '$')
|
||||
let bufNamePrev = fnamemodify(bufname(self.bufNrPrev), ':~:.')
|
||||
let self.items = copy(s:enumItems())
|
||||
call filter(self.items, 'v:val.word !=# bufNamePrev')
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeLeavePost(opened)
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" vim: set fdm=marker:
|
||||
132
.vim/bundle/vim-fuzzyfinder/autoload/fuf/dir.vim
Normal file
132
.vim/bundle/vim-fuzzyfinder/autoload/fuf/dir.vim
Normal file
|
|
@ -0,0 +1,132 @@
|
|||
"=============================================================================
|
||||
" Copyright (c) 2007-2010 Takeshi NISHIDA
|
||||
"
|
||||
"=============================================================================
|
||||
" LOAD GUARD {{{1
|
||||
|
||||
if !l9#guardScriptLoading(expand('<sfile>:p'), 0, 0, [])
|
||||
finish
|
||||
endif
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" GLOBAL FUNCTIONS {{{1
|
||||
|
||||
"
|
||||
function fuf#dir#createHandler(base)
|
||||
return a:base.concretize(copy(s:handler))
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#dir#getSwitchOrder()
|
||||
return g:fuf_dir_switchOrder
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#dir#getEditableDataNames()
|
||||
return []
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#dir#renewCache()
|
||||
let s:cache = {}
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#dir#requiresOnCommandPre()
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#dir#onInit()
|
||||
call fuf#defineLaunchCommand('FufDir' , s:MODE_NAME, '""', [])
|
||||
call fuf#defineLaunchCommand('FufDirWithFullCwd' , s:MODE_NAME, 'fnamemodify(getcwd(), '':p'')', [])
|
||||
call fuf#defineLaunchCommand('FufDirWithCurrentBufferDir', s:MODE_NAME, 'expand(''%:~:.'')[:-1-len(expand(''%:~:.:t''))]', [])
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" LOCAL FUNCTIONS/VARIABLES {{{1
|
||||
|
||||
let s:MODE_NAME = expand('<sfile>:t:r')
|
||||
|
||||
"
|
||||
function s:enumItems(dir)
|
||||
let key = getcwd() . g:fuf_ignoreCase . g:fuf_dir_exclude . "\n" . a:dir
|
||||
if !exists('s:cache[key]')
|
||||
let s:cache[key] = fuf#enumExpandedDirsEntries(a:dir, g:fuf_dir_exclude)
|
||||
call filter(s:cache[key], 'v:val.word =~# ''[/\\]$''')
|
||||
if isdirectory(a:dir)
|
||||
call insert(s:cache[key], fuf#makePathItem(a:dir . '.', '', 0))
|
||||
endif
|
||||
call fuf#mapToSetSerialIndex(s:cache[key], 1)
|
||||
call fuf#mapToSetAbbrWithSnippedWordAsPath(s:cache[key])
|
||||
endif
|
||||
return s:cache[key]
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" s:handler {{{1
|
||||
|
||||
let s:handler = {}
|
||||
|
||||
"
|
||||
function s:handler.getModeName()
|
||||
return s:MODE_NAME
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getPrompt()
|
||||
return fuf#formatPrompt(g:fuf_dir_prompt, self.partialMatching, '')
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getPreviewHeight()
|
||||
return g:fuf_previewHeight
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.isOpenable(enteredPattern)
|
||||
return a:enteredPattern =~# '[^/\\]$'
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.makePatternSet(patternBase)
|
||||
return fuf#makePatternSet(a:patternBase, 's:interpretPrimaryPatternForPathTail',
|
||||
\ self.partialMatching)
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.makePreviewLines(word, count)
|
||||
return fuf#makePreviewLinesAround(
|
||||
\ fuf#glob(fnamemodify(a:word, ':p') . '*'),
|
||||
\ [], a:count, self.getPreviewHeight())
|
||||
return
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getCompleteItems(patternPrimary)
|
||||
return s:enumItems(fuf#splitPath(a:patternPrimary).head)
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onOpen(word, mode)
|
||||
execute ':cd ' . fnameescape(a:word)
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeEnterPre()
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeEnterPost()
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeLeavePost(opened)
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" vim: set fdm=marker:
|
||||
139
.vim/bundle/vim-fuzzyfinder/autoload/fuf/file.vim
Normal file
139
.vim/bundle/vim-fuzzyfinder/autoload/fuf/file.vim
Normal file
|
|
@ -0,0 +1,139 @@
|
|||
"=============================================================================
|
||||
" Copyright (c) 2007-2010 Takeshi NISHIDA
|
||||
"
|
||||
"=============================================================================
|
||||
" LOAD GUARD {{{1
|
||||
|
||||
if !l9#guardScriptLoading(expand('<sfile>:p'), 0, 0, [])
|
||||
finish
|
||||
endif
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" GLOBAL FUNCTIONS {{{1
|
||||
|
||||
"
|
||||
function fuf#file#createHandler(base)
|
||||
return a:base.concretize(copy(s:handler))
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#file#getSwitchOrder()
|
||||
return g:fuf_file_switchOrder
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#file#getEditableDataNames()
|
||||
return []
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#file#renewCache()
|
||||
let s:cache = {}
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#file#requiresOnCommandPre()
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#file#onInit()
|
||||
call fuf#defineLaunchCommand('FufFile' , s:MODE_NAME, '""', [])
|
||||
call fuf#defineLaunchCommand('FufFileWithFullCwd' , s:MODE_NAME, 'fnamemodify(getcwd(), '':p'')', [])
|
||||
call fuf#defineLaunchCommand('FufFileWithCurrentBufferDir', s:MODE_NAME, 'expand(''%:~:.'')[:-1-len(expand(''%:~:.:t''))]', [])
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" LOCAL FUNCTIONS/VARIABLES {{{1
|
||||
|
||||
let s:MODE_NAME = expand('<sfile>:t:r')
|
||||
|
||||
"
|
||||
function s:enumItems(dir)
|
||||
let key = join([getcwd(), g:fuf_ignoreCase, g:fuf_file_exclude, a:dir], "\n")
|
||||
if !exists('s:cache[key]')
|
||||
let s:cache[key] = fuf#enumExpandedDirsEntries(a:dir, g:fuf_file_exclude)
|
||||
call fuf#mapToSetSerialIndex(s:cache[key], 1)
|
||||
call fuf#mapToSetAbbrWithSnippedWordAsPath(s:cache[key])
|
||||
endif
|
||||
return s:cache[key]
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:enumNonCurrentItems(dir, bufNrPrev, cache)
|
||||
let key = a:dir . 'AVOIDING EMPTY KEY'
|
||||
if !exists('a:cache[key]')
|
||||
" NOTE: Comparing filenames is faster than bufnr('^' . fname . '$')
|
||||
let bufNamePrev = bufname(a:bufNrPrev)
|
||||
let a:cache[key] =
|
||||
\ filter(copy(s:enumItems(a:dir)), 'v:val.word !=# bufNamePrev')
|
||||
endif
|
||||
return a:cache[key]
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" s:handler {{{1
|
||||
|
||||
let s:handler = {}
|
||||
|
||||
"
|
||||
function s:handler.getModeName()
|
||||
return s:MODE_NAME
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getPrompt()
|
||||
return fuf#formatPrompt(g:fuf_file_prompt, self.partialMatching, '')
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getPreviewHeight()
|
||||
return g:fuf_previewHeight
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.isOpenable(enteredPattern)
|
||||
return a:enteredPattern =~# '[^/\\]$'
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.makePatternSet(patternBase)
|
||||
return fuf#makePatternSet(a:patternBase, 's:interpretPrimaryPatternForPathTail',
|
||||
\ self.partialMatching)
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.makePreviewLines(word, count)
|
||||
return fuf#makePreviewLinesForFile(a:word, a:count, self.getPreviewHeight())
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getCompleteItems(patternPrimary)
|
||||
return s:enumNonCurrentItems(
|
||||
\ fuf#splitPath(a:patternPrimary).head, self.bufNrPrev, self.cache)
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onOpen(word, mode)
|
||||
call fuf#openFile(a:word, a:mode, g:fuf_reuseWindow)
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeEnterPre()
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeEnterPost()
|
||||
let self.cache = {}
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeLeavePost(opened)
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" vim: set fdm=marker:
|
||||
123
.vim/bundle/vim-fuzzyfinder/autoload/fuf/givencmd.vim
Normal file
123
.vim/bundle/vim-fuzzyfinder/autoload/fuf/givencmd.vim
Normal file
|
|
@ -0,0 +1,123 @@
|
|||
"=============================================================================
|
||||
" Copyright (c) 2007-2010 Takeshi NISHIDA
|
||||
"
|
||||
"=============================================================================
|
||||
" LOAD GUARD {{{1
|
||||
|
||||
if !l9#guardScriptLoading(expand('<sfile>:p'), 0, 0, [])
|
||||
finish
|
||||
endif
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" GLOBAL FUNCTIONS {{{1
|
||||
|
||||
"
|
||||
function fuf#givencmd#createHandler(base)
|
||||
return a:base.concretize(copy(s:handler))
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#givencmd#getSwitchOrder()
|
||||
return -1
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#givencmd#getEditableDataNames()
|
||||
return []
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#givencmd#renewCache()
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#givencmd#requiresOnCommandPre()
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#givencmd#onInit()
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#givencmd#launch(initialPattern, partialMatching, prompt, items)
|
||||
let s:prompt = (empty(a:prompt) ? '>' : a:prompt)
|
||||
let s:items = copy(a:items)
|
||||
call map(s:items, 'fuf#makeNonPathItem(v:val, "")')
|
||||
call fuf#mapToSetSerialIndex(s:items, 1)
|
||||
call map(s:items, 'fuf#setAbbrWithFormattedWord(v:val, 1)')
|
||||
call fuf#launch(s:MODE_NAME, a:initialPattern, a:partialMatching)
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" LOCAL FUNCTIONS/VARIABLES {{{1
|
||||
|
||||
let s:MODE_NAME = expand('<sfile>:t:r')
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" s:handler {{{1
|
||||
|
||||
let s:handler = {}
|
||||
|
||||
"
|
||||
function s:handler.getModeName()
|
||||
return s:MODE_NAME
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getPrompt()
|
||||
return fuf#formatPrompt(s:prompt, self.partialMatching, '')
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getPreviewHeight()
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.isOpenable(enteredPattern)
|
||||
return 1
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.makePatternSet(patternBase)
|
||||
return fuf#makePatternSet(a:patternBase, 's:interpretPrimaryPatternForNonPath',
|
||||
\ self.partialMatching)
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.makePreviewLines(word, count)
|
||||
return []
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getCompleteItems(patternPrimary)
|
||||
return s:items
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onOpen(word, mode)
|
||||
if a:word[0] =~# '[:/?]'
|
||||
call histadd(a:word[0], a:word[1:])
|
||||
endif
|
||||
call feedkeys(a:word . "\<CR>", 'n')
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeEnterPre()
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeEnterPost()
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeLeavePost(opened)
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" vim: set fdm=marker:
|
||||
123
.vim/bundle/vim-fuzzyfinder/autoload/fuf/givendir.vim
Normal file
123
.vim/bundle/vim-fuzzyfinder/autoload/fuf/givendir.vim
Normal file
|
|
@ -0,0 +1,123 @@
|
|||
"=============================================================================
|
||||
" Copyright (c) 2007-2010 Takeshi NISHIDA
|
||||
"
|
||||
"=============================================================================
|
||||
" LOAD GUARD {{{1
|
||||
|
||||
if !l9#guardScriptLoading(expand('<sfile>:p'), 0, 0, [])
|
||||
finish
|
||||
endif
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" GLOBAL FUNCTIONS {{{1
|
||||
|
||||
"
|
||||
function fuf#givendir#createHandler(base)
|
||||
return a:base.concretize(copy(s:handler))
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#givendir#getSwitchOrder()
|
||||
return -1
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#givendir#getEditableDataNames()
|
||||
return []
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#givendir#renewCache()
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#givendir#requiresOnCommandPre()
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#givendir#onInit()
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#givendir#launch(initialPattern, partialMatching, prompt, items)
|
||||
let s:prompt = (empty(a:prompt) ? '>' : a:prompt)
|
||||
let s:items = map(copy(a:items), 'substitute(v:val, ''[/\\]\?$'', "", "")')
|
||||
let s:items = map(s:items, 'fuf#makePathItem(v:val, "", 0)')
|
||||
call fuf#mapToSetSerialIndex(s:items, 1)
|
||||
call fuf#mapToSetAbbrWithSnippedWordAsPath(s:items)
|
||||
call fuf#launch(s:MODE_NAME, a:initialPattern, a:partialMatching)
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" LOCAL FUNCTIONS/VARIABLES {{{1
|
||||
|
||||
let s:MODE_NAME = expand('<sfile>:t:r')
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" s:handler {{{1
|
||||
|
||||
let s:handler = {}
|
||||
|
||||
"
|
||||
function s:handler.getModeName()
|
||||
return s:MODE_NAME
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getPrompt()
|
||||
return fuf#formatPrompt(s:prompt, self.partialMatching, '')
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getPreviewHeight()
|
||||
return g:fuf_previewHeight
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.isOpenable(enteredPattern)
|
||||
return 1
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.makePatternSet(patternBase)
|
||||
return fuf#makePatternSet(a:patternBase, 's:interpretPrimaryPatternForPath',
|
||||
\ self.partialMatching)
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.makePreviewLines(word, count)
|
||||
return fuf#makePreviewLinesAround(
|
||||
\ fuf#glob(fnamemodify(a:word, ':p') . '*'),
|
||||
\ [], a:count, self.getPreviewHeight())
|
||||
return
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getCompleteItems(patternPrimary)
|
||||
return s:items
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onOpen(word, mode)
|
||||
execute ':cd ' . fnameescape(a:word)
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeEnterPre()
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeEnterPost()
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeLeavePost(opened)
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" vim: set fdm=marker:
|
||||
121
.vim/bundle/vim-fuzzyfinder/autoload/fuf/givenfile.vim
Normal file
121
.vim/bundle/vim-fuzzyfinder/autoload/fuf/givenfile.vim
Normal file
|
|
@ -0,0 +1,121 @@
|
|||
"=============================================================================
|
||||
" Copyright (c) 2007-2010 Takeshi NISHIDA
|
||||
"
|
||||
"=============================================================================
|
||||
" LOAD GUARD {{{1
|
||||
|
||||
if !l9#guardScriptLoading(expand('<sfile>:p'), 0, 0, [])
|
||||
finish
|
||||
endif
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" GLOBAL FUNCTIONS {{{1
|
||||
|
||||
"
|
||||
function fuf#givenfile#createHandler(base)
|
||||
return a:base.concretize(copy(s:handler))
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#givenfile#getSwitchOrder()
|
||||
return -1
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#givenfile#getEditableDataNames()
|
||||
return []
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#givenfile#renewCache()
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#givenfile#requiresOnCommandPre()
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#givenfile#onInit()
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#givenfile#launch(initialPattern, partialMatching, prompt, items)
|
||||
let s:prompt = (empty(a:prompt) ? '>' : a:prompt)
|
||||
let s:items = map(copy(a:items), 'fuf#makePathItem(v:val, "", 0)')
|
||||
call fuf#mapToSetSerialIndex(s:items, 1)
|
||||
call map(s:items, 'fuf#setAbbrWithFormattedWord(v:val, 1)')
|
||||
call fuf#launch(s:MODE_NAME, a:initialPattern, a:partialMatching)
|
||||
endfunction
|
||||
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" LOCAL FUNCTIONS/VARIABLES {{{1
|
||||
|
||||
let s:MODE_NAME = expand('<sfile>:t:r')
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" s:handler {{{1
|
||||
|
||||
let s:handler = {}
|
||||
|
||||
"
|
||||
function s:handler.getModeName()
|
||||
return s:MODE_NAME
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getPrompt()
|
||||
return fuf#formatPrompt(s:prompt, self.partialMatching, '')
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getPreviewHeight()
|
||||
return g:fuf_previewHeight
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.isOpenable(enteredPattern)
|
||||
return 1
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.makePatternSet(patternBase)
|
||||
return fuf#makePatternSet(a:patternBase, 's:interpretPrimaryPatternForPath',
|
||||
\ self.partialMatching)
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.makePreviewLines(word, count)
|
||||
return fuf#makePreviewLinesForFile(a:word, a:count, self.getPreviewHeight())
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getCompleteItems(patternPrimary)
|
||||
return s:items
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onOpen(word, mode)
|
||||
call fuf#openFile(a:word, a:mode, g:fuf_reuseWindow)
|
||||
endfunction
|
||||
|
||||
|
||||
"
|
||||
function s:handler.onModeEnterPre()
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeEnterPost()
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeLeavePost(opened)
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" vim: set fdm=marker:
|
||||
198
.vim/bundle/vim-fuzzyfinder/autoload/fuf/help.vim
Normal file
198
.vim/bundle/vim-fuzzyfinder/autoload/fuf/help.vim
Normal file
|
|
@ -0,0 +1,198 @@
|
|||
"=============================================================================
|
||||
" Copyright (c) 2007-2010 Takeshi NISHIDA
|
||||
"
|
||||
"=============================================================================
|
||||
" LOAD GUARD {{{1
|
||||
|
||||
if !l9#guardScriptLoading(expand('<sfile>:p'), 0, 0, [])
|
||||
finish
|
||||
endif
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" GLOBAL FUNCTIONS {{{1
|
||||
|
||||
"
|
||||
function fuf#help#createHandler(base)
|
||||
return a:base.concretize(copy(s:handler))
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#help#getSwitchOrder()
|
||||
return g:fuf_help_switchOrder
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#help#getEditableDataNames()
|
||||
return []
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#help#renewCache()
|
||||
let s:cache = {}
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#help#requiresOnCommandPre()
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#help#onInit()
|
||||
call fuf#defineLaunchCommand('FufHelp' , s:MODE_NAME, '""', [])
|
||||
call fuf#defineLaunchCommand('FufHelpWithCursorWord', s:MODE_NAME, 'expand(''<cword>'')', [])
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" LOCAL FUNCTIONS/VARIABLES {{{1
|
||||
|
||||
let s:MODE_NAME = expand('<sfile>:t:r')
|
||||
|
||||
"
|
||||
function s:getCurrentHelpTagFiles()
|
||||
let prefix = 'doc' . l9#getPathSeparator()
|
||||
let tagFiles = split(globpath(&runtimepath, prefix . 'tags' ), "\n")
|
||||
\ + split(globpath(&runtimepath, prefix . 'tags-??'), "\n")
|
||||
return sort(map(tagFiles, 'fnamemodify(v:val, ":p")'))
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:parseHelpTagEntry(line, tagFile)
|
||||
let elements = split(a:line, "\t")
|
||||
if len(elements) != 3 || elements[0][0] ==# '!'
|
||||
return {}
|
||||
endif
|
||||
let suffix = matchstr(a:tagFile, '-\zs..$')
|
||||
if empty(suffix)
|
||||
let suffix = '@en'
|
||||
else
|
||||
let suffix = '@' . suffix
|
||||
endif
|
||||
let dir = fnamemodify(a:tagFile, ':h') . l9#getPathSeparator()
|
||||
return {
|
||||
\ 'word' : elements[0] . suffix,
|
||||
\ 'path' : dir . elements[1],
|
||||
\ 'pattern': elements[2][1:],
|
||||
\ }
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:getHelpTagEntries(tagFile)
|
||||
let names = map(l9#readFile(a:tagFile), 's:parseHelpTagEntry(v:val, a:tagFile)')
|
||||
return filter(names, '!empty(v:val)')
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:parseHelpTagFiles(tagFiles, key)
|
||||
let cacheName = 'cache-' . l9#hash224(a:key)
|
||||
let cacheTime = fuf#getDataFileTime(s:MODE_NAME, cacheName)
|
||||
if cacheTime != -1 && fuf#countModifiedFiles(a:tagFiles, cacheTime) == 0
|
||||
return fuf#loadDataFile(s:MODE_NAME, cacheName)
|
||||
endif
|
||||
let items = l9#unique(l9#concat(map(copy(a:tagFiles), 's:getHelpTagEntries(v:val)')))
|
||||
let items = map(items, 'extend(v:val, fuf#makeNonPathItem(v:val.word, ""))')
|
||||
call fuf#mapToSetSerialIndex(items, 1)
|
||||
let items = map(items, 'fuf#setAbbrWithFormattedWord(v:val, 1)')
|
||||
call fuf#saveDataFile(s:MODE_NAME, cacheName, items)
|
||||
return items
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:enumHelpTags(tagFiles)
|
||||
if !len(a:tagFiles)
|
||||
return []
|
||||
endif
|
||||
let key = join([g:fuf_ignoreCase] + a:tagFiles, "\n")
|
||||
if !exists('s:cache[key]') || fuf#countModifiedFiles(a:tagFiles, s:cache[key].time)
|
||||
let s:cache[key] = {
|
||||
\ 'time' : localtime(),
|
||||
\ 'items' : s:parseHelpTagFiles(a:tagFiles, key)
|
||||
\ }
|
||||
endif
|
||||
return s:cache[key].items
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:getMatchingIndex(lines, pattern)
|
||||
if empty(a:pattern)
|
||||
return -1
|
||||
endif
|
||||
for i in range(len(a:lines))
|
||||
if stridx(a:lines[i], a:pattern) >= 0
|
||||
return i
|
||||
endif
|
||||
endfor
|
||||
return -1
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" s:handler {{{1
|
||||
|
||||
let s:handler = {}
|
||||
|
||||
"
|
||||
function s:handler.getModeName()
|
||||
return s:MODE_NAME
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getPrompt()
|
||||
return fuf#formatPrompt(g:fuf_help_prompt, self.partialMatching, '')
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getPreviewHeight()
|
||||
return g:fuf_previewHeight
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.isOpenable(enteredPattern)
|
||||
return 1
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.makePatternSet(patternBase)
|
||||
return fuf#makePatternSet(a:patternBase, 's:interpretPrimaryPatternForNonPath',
|
||||
\ self.partialMatching)
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.makePreviewLines(word, count)
|
||||
let items = filter(copy(s:enumHelpTags(self.tagFiles)), 'v:val.word ==# a:word')
|
||||
if empty(items)
|
||||
return []
|
||||
endif
|
||||
let lines = fuf#getFileLines(items[0].path)
|
||||
let index = s:getMatchingIndex(lines, items[0].pattern)
|
||||
return [items[0].path . ':'] + fuf#makePreviewLinesAround(
|
||||
\ lines, (index < 0 ? [] : [index]), a:count, self.getPreviewHeight() - 1)
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getCompleteItems(patternPrimary)
|
||||
return s:enumHelpTags(self.tagFiles)
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onOpen(word, mode)
|
||||
call fuf#openHelp(a:word, a:mode)
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeEnterPre()
|
||||
let self.tagFiles = s:getCurrentHelpTagFiles()
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeEnterPost()
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeLeavePost(opened)
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" vim: set fdm=marker:
|
||||
182
.vim/bundle/vim-fuzzyfinder/autoload/fuf/jumplist.vim
Normal file
182
.vim/bundle/vim-fuzzyfinder/autoload/fuf/jumplist.vim
Normal file
|
|
@ -0,0 +1,182 @@
|
|||
"=============================================================================
|
||||
" Copyright (c) 2007-2010 Takeshi NISHIDA
|
||||
"
|
||||
"=============================================================================
|
||||
" LOAD GUARD {{{1
|
||||
|
||||
if !l9#guardScriptLoading(expand('<sfile>:p'), 0, 0, [])
|
||||
finish
|
||||
endif
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" GLOBAL FUNCTIONS {{{1
|
||||
|
||||
"
|
||||
function fuf#jumplist#createHandler(base)
|
||||
return a:base.concretize(copy(s:handler))
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#jumplist#getSwitchOrder()
|
||||
return g:fuf_jumplist_switchOrder
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#jumplist#getEditableDataNames()
|
||||
return []
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#jumplist#renewCache()
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#jumplist#requiresOnCommandPre()
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#jumplist#onInit()
|
||||
call fuf#defineLaunchCommand('FufJumpList', s:MODE_NAME, '""', [])
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" LOCAL FUNCTIONS/VARIABLES {{{1
|
||||
|
||||
let s:MODE_NAME = expand('<sfile>:t:r')
|
||||
|
||||
"
|
||||
function s:getJumpsLines()
|
||||
redir => result
|
||||
:silent jumps
|
||||
redir END
|
||||
return split(result, "\n")
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:parseJumpsLine(line, bufnrPrev)
|
||||
"return matchlist(a:line, '^\(.\)\s\+\(\d\+\)\s\(.*\)$')
|
||||
let elements = matchlist(a:line, '\v^(.)\s*(\d+)\s+(\d+)\s+(\d+)\s*(.*)$')
|
||||
if empty(elements)
|
||||
return {}
|
||||
endif
|
||||
let linePrevBuffer = join(getbufline(a:bufnrPrev, elements[3]))
|
||||
if stridx(linePrevBuffer, elements[5]) >= 0
|
||||
let fname = bufname(a:bufnrPrev)
|
||||
let text = elements[5]
|
||||
else
|
||||
let fname = elements[5]
|
||||
let text = join(getbufline('^' . elements[5] . '$', elements[3]))
|
||||
endif
|
||||
return {
|
||||
\ 'prefix': elements[1],
|
||||
\ 'count' : elements[2],
|
||||
\ 'lnum' : elements[3],
|
||||
\ 'fname' : fname,
|
||||
\ 'text' : printf('%s|%d:%d|%s', fname, elements[3], elements[4], text),
|
||||
\ }
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:makeItem(line, bufnrPrev)
|
||||
let parsed = s:parseJumpsLine(a:line, a:bufnrPrev)
|
||||
if empty(parsed)
|
||||
return {}
|
||||
endif
|
||||
let item = fuf#makeNonPathItem(parsed.text, '')
|
||||
let item.abbrPrefix = parsed.prefix
|
||||
let item.lnum = parsed.lnum
|
||||
let item.fname = parsed.fname
|
||||
return item
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" s:handler {{{1
|
||||
|
||||
let s:handler = {}
|
||||
|
||||
"
|
||||
function s:handler.getModeName()
|
||||
return s:MODE_NAME
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getPrompt()
|
||||
return fuf#formatPrompt(g:fuf_jumplist_prompt, self.partialMatching, '')
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getPreviewHeight()
|
||||
return g:fuf_previewHeight
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.isOpenable(enteredPattern)
|
||||
return 1
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.makePatternSet(patternBase)
|
||||
return fuf#makePatternSet(a:patternBase, 's:interpretPrimaryPatternForNonPath',
|
||||
\ self.partialMatching)
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.makePreviewLines(word, count)
|
||||
let items = filter(copy(self.items), 'v:val.word ==# a:word')
|
||||
if empty(items)
|
||||
return []
|
||||
endif
|
||||
let lines = fuf#getFileLines(items[0].fname)
|
||||
return fuf#makePreviewLinesAround(
|
||||
\ lines, [items[0].lnum - 1], a:count, self.getPreviewHeight())
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getCompleteItems(patternPrimary)
|
||||
return self.items
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onOpen(word, mode)
|
||||
call fuf#prejump(a:mode)
|
||||
let older = 0
|
||||
for line in reverse(s:getJumpsLines())
|
||||
if stridx(line, '>') == 0
|
||||
let older = 1
|
||||
endif
|
||||
let parsed = s:parseJumpsLine(line, self.bufNrPrev)
|
||||
if !empty(parsed) && parsed.text ==# a:word
|
||||
if parsed.count != 0
|
||||
execute 'normal! ' . parsed.count . (older ? "\<C-o>" : "\<C-i>") . 'zvzz'
|
||||
endif
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeEnterPre()
|
||||
let self.items = s:getJumpsLines()
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeEnterPost()
|
||||
call map(self.items, 's:makeItem(v:val, self.bufNrPrev)')
|
||||
call filter(self.items, '!empty(v:val)')
|
||||
call reverse(self.items)
|
||||
call fuf#mapToSetSerialIndex(self.items, 1)
|
||||
call map(self.items, 'fuf#setAbbrWithFormattedWord(v:val, 1)')
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeLeavePost(opened)
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" vim: set fdm=marker:
|
||||
|
||||
135
.vim/bundle/vim-fuzzyfinder/autoload/fuf/line.vim
Normal file
135
.vim/bundle/vim-fuzzyfinder/autoload/fuf/line.vim
Normal file
|
|
@ -0,0 +1,135 @@
|
|||
"=============================================================================
|
||||
" Copyright (c) 2007-2010 Takeshi NISHIDA
|
||||
"
|
||||
"=============================================================================
|
||||
" LOAD GUARD {{{1
|
||||
|
||||
if !l9#guardScriptLoading(expand('<sfile>:p'), 0, 0, [])
|
||||
finish
|
||||
endif
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" GLOBAL FUNCTIONS {{{1
|
||||
|
||||
"
|
||||
function fuf#line#createHandler(base)
|
||||
return a:base.concretize(copy(s:handler))
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#line#getSwitchOrder()
|
||||
return g:fuf_line_switchOrder
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#line#getEditableDataNames()
|
||||
return []
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#line#renewCache()
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#line#requiresOnCommandPre()
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#line#onInit()
|
||||
call fuf#defineLaunchCommand('FufLine', s:MODE_NAME, '""', [])
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" LOCAL FUNCTIONS/VARIABLES {{{1
|
||||
|
||||
let s:MODE_NAME = expand('<sfile>:t:r')
|
||||
let s:OPEN_TYPE_DELETE = -1
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" s:handler {{{1
|
||||
|
||||
let s:handler = {}
|
||||
|
||||
"
|
||||
function s:handler.getModeName()
|
||||
return s:MODE_NAME
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getPrompt()
|
||||
return fuf#formatPrompt(g:fuf_line_prompt, self.partialMatching, '')
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getPreviewHeight()
|
||||
return g:fuf_previewHeight
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.isOpenable(enteredPattern)
|
||||
return 1
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.makePatternSet(patternBase)
|
||||
return fuf#makePatternSet(a:patternBase, 's:interpretPrimaryPatternForNonPath',
|
||||
\ self.partialMatching)
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.makePreviewLines(word, count)
|
||||
let items = filter(copy(self.items), 'v:val.word ==# a:word')
|
||||
if empty(items)
|
||||
return []
|
||||
endif
|
||||
let lines = fuf#getFileLines(self.bufNrPrev)
|
||||
return fuf#makePreviewLinesAround(
|
||||
\ lines, [items[0].index - 1], a:count, self.getPreviewHeight())
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getCompleteItems(patternPrimary)
|
||||
return self.items
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onOpen(word, mode)
|
||||
call fuf#prejump(a:mode)
|
||||
call filter(self.items, 'v:val.word ==# a:word')
|
||||
if empty(self.items)
|
||||
return
|
||||
execute 'cc ' . self.items[0].index
|
||||
endif
|
||||
call cursor(self.items[0].index, 0)
|
||||
normal! zvzz
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeEnterPre()
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeEnterPost()
|
||||
let tab = repeat(' ', getbufvar(self.bufNrPrev, '&tabstop'))
|
||||
let self.items = getbufline(self.bufNrPrev, 1, '$')
|
||||
let lnumFormat = '%' . len(string(len(self.items) + 1)) . 'd|'
|
||||
for i in range(len(self.items))
|
||||
let self.items[i] = printf(lnumFormat, i + 1)
|
||||
\ . substitute(self.items[i], "\t", tab, 'g')
|
||||
endfor
|
||||
call map(self.items, 'fuf#makeNonPathItem(v:val, "")')
|
||||
call fuf#mapToSetSerialIndex(self.items, 1)
|
||||
call map(self.items, 'fuf#setAbbrWithFormattedWord(v:val, 0)')
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeLeavePost(opened)
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" vim: set fdm=marker:
|
||||
134
.vim/bundle/vim-fuzzyfinder/autoload/fuf/mrucmd.vim
Normal file
134
.vim/bundle/vim-fuzzyfinder/autoload/fuf/mrucmd.vim
Normal file
|
|
@ -0,0 +1,134 @@
|
|||
"=============================================================================
|
||||
" Copyright (c) 2007-2010 Takeshi NISHIDA
|
||||
"
|
||||
"=============================================================================
|
||||
" LOAD GUARD {{{1
|
||||
|
||||
if !l9#guardScriptLoading(expand('<sfile>:p'), 0, 0, [])
|
||||
finish
|
||||
endif
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" GLOBAL FUNCTIONS {{{1
|
||||
|
||||
"
|
||||
function fuf#mrucmd#createHandler(base)
|
||||
return a:base.concretize(copy(s:handler))
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#mrucmd#getSwitchOrder()
|
||||
return g:fuf_mrucmd_switchOrder
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#mrucmd#getEditableDataNames()
|
||||
return ['items']
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#mrucmd#renewCache()
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#mrucmd#requiresOnCommandPre()
|
||||
return 1
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#mrucmd#onInit()
|
||||
call fuf#defineLaunchCommand('FufMruCmd', s:MODE_NAME, '""', [])
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#mrucmd#onCommandPre(cmd)
|
||||
if getcmdtype() =~# '^[:/?]'
|
||||
call s:updateInfo(a:cmd)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" LOCAL FUNCTIONS/VARIABLES {{{1
|
||||
|
||||
let s:MODE_NAME = expand('<sfile>:t:r')
|
||||
|
||||
"
|
||||
function s:updateInfo(cmd)
|
||||
let items = fuf#loadDataFile(s:MODE_NAME, 'items')
|
||||
let items = fuf#updateMruList(
|
||||
\ items, { 'word' : a:cmd, 'time' : localtime() },
|
||||
\ g:fuf_mrucmd_maxItem, g:fuf_mrucmd_exclude)
|
||||
call fuf#saveDataFile(s:MODE_NAME, 'items', items)
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" s:handler {{{1
|
||||
|
||||
let s:handler = {}
|
||||
|
||||
"
|
||||
function s:handler.getModeName()
|
||||
return s:MODE_NAME
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getPrompt()
|
||||
return fuf#formatPrompt(g:fuf_mrucmd_prompt, self.partialMatching, '')
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getPreviewHeight()
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.isOpenable(enteredPattern)
|
||||
return 1
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.makePatternSet(patternBase)
|
||||
return fuf#makePatternSet(a:patternBase, 's:interpretPrimaryPatternForNonPath',
|
||||
\ self.partialMatching)
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.makePreviewLines(word, count)
|
||||
return []
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getCompleteItems(patternPrimary)
|
||||
return self.items
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onOpen(word, mode)
|
||||
call s:updateInfo(a:word)
|
||||
call histadd(a:word[0], a:word[1:])
|
||||
call feedkeys(a:word . "\<CR>", 'n')
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeEnterPre()
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeEnterPost()
|
||||
let self.items = fuf#loadDataFile(s:MODE_NAME, 'items')
|
||||
call map(self.items, 'fuf#makeNonPathItem(v:val.word, strftime(g:fuf_timeFormat, v:val.time))')
|
||||
call fuf#mapToSetSerialIndex(self.items, 1)
|
||||
call map(self.items, 'fuf#setAbbrWithFormattedWord(v:val, 1)')
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeLeavePost(opened)
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" vim: set fdm=marker:
|
||||
234
.vim/bundle/vim-fuzzyfinder/autoload/fuf/mrufile.vim
Normal file
234
.vim/bundle/vim-fuzzyfinder/autoload/fuf/mrufile.vim
Normal file
|
|
@ -0,0 +1,234 @@
|
|||
"=============================================================================
|
||||
" Copyright (c) 2007-2010 Takeshi NISHIDA
|
||||
"
|
||||
"=============================================================================
|
||||
" LOAD GUARD {{{1
|
||||
|
||||
if !l9#guardScriptLoading(expand('<sfile>:p'), 0, 0, [])
|
||||
finish
|
||||
endif
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" GLOBAL FUNCTIONS {{{1
|
||||
|
||||
"
|
||||
function fuf#mrufile#createHandler(base)
|
||||
return a:base.concretize(copy(s:handler))
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#mrufile#getSwitchOrder()
|
||||
return g:fuf_mrufile_switchOrder
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#mrufile#getEditableDataNames()
|
||||
return ['items', 'itemdirs']
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#mrufile#renewCache()
|
||||
let s:cache = {}
|
||||
let s:aroundCache = {}
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#mrufile#requiresOnCommandPre()
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#mrufile#onInit()
|
||||
call fuf#defineLaunchCommand('FufMruFile', s:MODE_NAME, '""', [])
|
||||
call fuf#defineLaunchCommand('FufMruFileInCwd', s:MODE_NAME,
|
||||
\ '""', [['g:fuf_mrufile_underCwd', 1]])
|
||||
call l9#defineVariableDefault('g:fuf_mrufile_underCwd', 0) " private option
|
||||
call l9#defineVariableDefault('g:fuf_mrufile_searchAroundLevel', -1) " private option
|
||||
augroup fuf#mrufile
|
||||
autocmd!
|
||||
autocmd BufEnter * call s:updateData()
|
||||
autocmd BufWritePost * call s:updateData()
|
||||
augroup END
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" LOCAL FUNCTIONS/VARIABLES {{{1
|
||||
|
||||
let s:MODE_NAME = expand('<sfile>:t:r')
|
||||
let s:OPEN_TYPE_EXPAND = -1
|
||||
|
||||
"
|
||||
function s:updateData()
|
||||
if !empty(&buftype) || !filereadable(expand('%'))
|
||||
return
|
||||
endif
|
||||
let items = fuf#loadDataFile(s:MODE_NAME, 'items')
|
||||
let items = fuf#updateMruList(
|
||||
\ items, { 'word' : expand('%:p'), 'time' : localtime() },
|
||||
\ g:fuf_mrufile_maxItem, g:fuf_mrufile_exclude)
|
||||
call fuf#saveDataFile(s:MODE_NAME, 'items', items)
|
||||
call s:removeItemFromCache(expand('%:p'))
|
||||
let itemDirs = fuf#loadDataFile(s:MODE_NAME, 'itemdirs')
|
||||
let itemDirs = fuf#updateMruList(
|
||||
\ itemDirs, { 'word' : expand('%:p:h') },
|
||||
\ g:fuf_mrufile_maxItemDir, g:fuf_mrufile_exclude)
|
||||
call fuf#saveDataFile(s:MODE_NAME, 'itemdirs', itemDirs)
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:removeItemFromCache(word)
|
||||
for items in values(s:cache)
|
||||
if exists('items[a:word]')
|
||||
unlet items[a:word]
|
||||
endif
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
" returns empty value if invalid item
|
||||
function s:formatItemUsingCache(item)
|
||||
if a:item.word !~ '\S'
|
||||
return {}
|
||||
endif
|
||||
if !exists('s:cache[a:item.word]')
|
||||
if filereadable(a:item.word)
|
||||
let s:cache[a:item.word] = fuf#makePathItem(
|
||||
\ fnamemodify(a:item.word, ':p:~'), strftime(g:fuf_timeFormat, a:item.time), 0)
|
||||
else
|
||||
let s:cache[a:item.word] = {}
|
||||
endif
|
||||
endif
|
||||
return s:cache[a:item.word]
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:expandSearchDir(dir, level)
|
||||
let dirs = [a:dir]
|
||||
let dirPrev = a:dir
|
||||
for i in range(a:level)
|
||||
let dirPrev = l9#concatPaths([dirPrev, '*'])
|
||||
call add(dirs, dirPrev)
|
||||
endfor
|
||||
let dirPrev = a:dir
|
||||
for i in range(a:level)
|
||||
let dirPrevPrev = dirPrev
|
||||
let dirPrev = fnamemodify(dirPrev, ':h')
|
||||
if dirPrevPrev ==# dirPrev
|
||||
break
|
||||
endif
|
||||
call add(dirs, dirPrev)
|
||||
endfor
|
||||
return dirs
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:listAroundFiles(dir)
|
||||
if !exists('s:aroundCache[a:dir]')
|
||||
let s:aroundCache[a:dir] = [a:dir] +
|
||||
\ fuf#glob(l9#concatPaths([a:dir, '*' ])) +
|
||||
\ fuf#glob(l9#concatPaths([a:dir, '.*']))
|
||||
call filter(s:aroundCache[a:dir], 'filereadable(v:val)')
|
||||
call map(s:aroundCache[a:dir], 'fuf#makePathItem(fnamemodify(v:val, ":~"), "", 0)')
|
||||
if len(g:fuf_mrufile_exclude)
|
||||
call filter(s:aroundCache[a:dir], 'v:val.word !~ g:fuf_mrufile_exclude')
|
||||
endif
|
||||
endif
|
||||
return s:aroundCache[a:dir]
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" s:handler {{{1
|
||||
|
||||
let s:handler = {}
|
||||
|
||||
"
|
||||
function s:handler.getModeName()
|
||||
return s:MODE_NAME
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getPrompt()
|
||||
let cwdString = (g:fuf_mrufile_underCwd ? '[CWD]' : '')
|
||||
let levelString = (g:fuf_mrufile_searchAroundLevel < 0 ? ''
|
||||
\ : '[Around:' . g:fuf_mrufile_searchAroundLevel . ']')
|
||||
return fuf#formatPrompt(g:fuf_mrufile_prompt, self.partialMatching, cwdString . levelString)
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getPreviewHeight()
|
||||
return g:fuf_previewHeight
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.isOpenable(enteredPattern)
|
||||
return 1
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.makePatternSet(patternBase)
|
||||
return fuf#makePatternSet(a:patternBase, 's:interpretPrimaryPatternForPath',
|
||||
\ self.partialMatching)
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.makePreviewLines(word, count)
|
||||
return fuf#makePreviewLinesForFile(a:word, a:count, self.getPreviewHeight())
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getCompleteItems(patternPrimary)
|
||||
return self.items
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onOpen(word, mode)
|
||||
if a:mode ==# s:OPEN_TYPE_EXPAND
|
||||
let nextLevel = (self.searchAroundLevel < 0 ? 0 : self.searchAroundLevel + 1)
|
||||
call fuf#setOneTimeVariables(['g:fuf_mrufile_searchAroundLevel', nextLevel])
|
||||
let self.reservedMode = self.getModeName()
|
||||
return
|
||||
else
|
||||
call fuf#openFile(a:word, a:mode, g:fuf_reuseWindow)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeEnterPre()
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeEnterPost()
|
||||
let self.searchAroundLevel = g:fuf_mrufile_searchAroundLevel
|
||||
call fuf#defineKeyMappingInHandler(g:fuf_mrufile_keyExpand,
|
||||
\ 'onCr(' . s:OPEN_TYPE_EXPAND . ')')
|
||||
if self.searchAroundLevel < 0
|
||||
let self.items = fuf#loadDataFile(s:MODE_NAME, 'items')
|
||||
call map(self.items, 's:formatItemUsingCache(v:val)')
|
||||
else
|
||||
let self.items = fuf#loadDataFile(s:MODE_NAME, 'itemdirs')
|
||||
call map(self.items, 's:expandSearchDir(v:val.word, g:fuf_mrufile_searchAroundLevel)')
|
||||
let self.items = l9#concat(self.items)
|
||||
let self.items = l9#unique(self.items)
|
||||
call map(self.items, 's:listAroundFiles(v:val)')
|
||||
let self.items = l9#concat(self.items)
|
||||
endif
|
||||
" NOTE: Comparing filenames is faster than bufnr('^' . fname . '$')
|
||||
let bufNamePrev = fnamemodify(bufname(self.bufNrPrev), ':p:~')
|
||||
call filter(self.items, '!empty(v:val) && v:val.word !=# bufNamePrev')
|
||||
if g:fuf_mrufile_underCwd
|
||||
let cwd = fnamemodify(getcwd(), ':p:~')
|
||||
call filter(self.items, 'stridx(v:val.word, cwd) == 0')
|
||||
endif
|
||||
call fuf#mapToSetSerialIndex(self.items, 1)
|
||||
call fuf#mapToSetAbbrWithSnippedWordAsPath(self.items)
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeLeavePost(opened)
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" vim: set fdm=marker:
|
||||
154
.vim/bundle/vim-fuzzyfinder/autoload/fuf/quickfix.vim
Normal file
154
.vim/bundle/vim-fuzzyfinder/autoload/fuf/quickfix.vim
Normal file
|
|
@ -0,0 +1,154 @@
|
|||
"=============================================================================
|
||||
" Copyright (c) 2007-2010 Takeshi NISHIDA
|
||||
"
|
||||
"=============================================================================
|
||||
" LOAD GUARD {{{1
|
||||
|
||||
if !l9#guardScriptLoading(expand('<sfile>:p'), 0, 0, [])
|
||||
finish
|
||||
endif
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" GLOBAL FUNCTIONS {{{1
|
||||
|
||||
"
|
||||
function fuf#quickfix#createHandler(base)
|
||||
return a:base.concretize(copy(s:handler))
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#quickfix#getSwitchOrder()
|
||||
return g:fuf_quickfix_switchOrder
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#quickfix#getEditableDataNames()
|
||||
return []
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#quickfix#renewCache()
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#quickfix#requiresOnCommandPre()
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#quickfix#onInit()
|
||||
call fuf#defineLaunchCommand('FufQuickfix', s:MODE_NAME, '""', [])
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" LOCAL FUNCTIONS/VARIABLES {{{1
|
||||
|
||||
let s:MODE_NAME = expand('<sfile>:t:r')
|
||||
|
||||
"
|
||||
function s:getJumpsLines()
|
||||
redir => result
|
||||
:silent jumps
|
||||
redir END
|
||||
return split(result, "\n")
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:parseJumpsLine(line)
|
||||
return matchlist(a:line, '^\(.\)\s\+\(\d\+\)\s\(.*\)$')
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:makeItem(qfItem)
|
||||
if !a:qfItem.valid
|
||||
return {}
|
||||
endif
|
||||
let item = fuf#makeNonPathItem(
|
||||
\ printf('%s|%d:%d|%s', bufname(a:qfItem.bufnr), a:qfItem.lnum,
|
||||
\ a:qfItem.col, matchstr(a:qfItem.text, '\s*\zs.*\S'))
|
||||
\ , '')
|
||||
let item.bufnr = a:qfItem.bufnr
|
||||
let item.lnum = a:qfItem.lnum
|
||||
return item
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" s:handler {{{1
|
||||
|
||||
let s:handler = {}
|
||||
|
||||
"
|
||||
function s:handler.getModeName()
|
||||
return s:MODE_NAME
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getPrompt()
|
||||
return fuf#formatPrompt(g:fuf_quickfix_prompt, self.partialMatching, '')
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getPreviewHeight()
|
||||
return g:fuf_previewHeight
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.isOpenable(enteredPattern)
|
||||
return 1
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.makePatternSet(patternBase)
|
||||
return fuf#makePatternSet(a:patternBase, 's:interpretPrimaryPatternForNonPath',
|
||||
\ self.partialMatching)
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.makePreviewLines(word, count)
|
||||
let items = filter(copy(self.items), 'v:val.word ==# a:word')
|
||||
if empty(items)
|
||||
return []
|
||||
endif
|
||||
let lines = fuf#getFileLines(items[0].bufnr)
|
||||
return fuf#makePreviewLinesAround(
|
||||
\ lines, [items[0].lnum - 1], a:count, self.getPreviewHeight())
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getCompleteItems(patternPrimary)
|
||||
return self.items
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onOpen(word, mode)
|
||||
call fuf#prejump(a:mode)
|
||||
call filter(self.items, 'v:val.word ==# a:word')
|
||||
if !empty(self.items)
|
||||
execute 'cc ' . self.items[0].index
|
||||
endif
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeEnterPre()
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeEnterPost()
|
||||
let self.items = getqflist()
|
||||
call map(self.items, 's:makeItem(v:val)')
|
||||
call fuf#mapToSetSerialIndex(self.items, 1)
|
||||
call filter(self.items, 'exists("v:val.word")')
|
||||
call map(self.items, 'fuf#setAbbrWithFormattedWord(v:val, 1)')
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeLeavePost(opened)
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" vim: set fdm=marker:
|
||||
|
||||
178
.vim/bundle/vim-fuzzyfinder/autoload/fuf/tag.vim
Normal file
178
.vim/bundle/vim-fuzzyfinder/autoload/fuf/tag.vim
Normal file
|
|
@ -0,0 +1,178 @@
|
|||
"=============================================================================
|
||||
" Copyright (c) 2007-2010 Takeshi NISHIDA
|
||||
"
|
||||
"=============================================================================
|
||||
" LOAD GUARD {{{1
|
||||
|
||||
if !l9#guardScriptLoading(expand('<sfile>:p'), 0, 0, [])
|
||||
finish
|
||||
endif
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" GLOBAL FUNCTIONS {{{1
|
||||
|
||||
"
|
||||
function fuf#tag#createHandler(base)
|
||||
return a:base.concretize(copy(s:handler))
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#tag#getSwitchOrder()
|
||||
return g:fuf_tag_switchOrder
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#tag#getEditableDataNames()
|
||||
return []
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#tag#renewCache()
|
||||
let s:cache = {}
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#tag#requiresOnCommandPre()
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#tag#onInit()
|
||||
call fuf#defineLaunchCommand('FufTag' , s:MODE_NAME, '""', [])
|
||||
call fuf#defineLaunchCommand('FufTagWithCursorWord', s:MODE_NAME, 'expand(''<cword>'')', [])
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" LOCAL FUNCTIONS/VARIABLES {{{1
|
||||
|
||||
let s:MODE_NAME = expand('<sfile>:t:r')
|
||||
|
||||
"
|
||||
function s:getTagNames(tagFile)
|
||||
let names = map(l9#readFile(a:tagFile), 'matchstr(v:val, ''^[^!\t][^\t]*'')')
|
||||
return filter(names, 'v:val =~# ''\S''')
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:parseTagFiles(tagFiles, key)
|
||||
let cacheName = 'cache-' . l9#hash224(a:key)
|
||||
let cacheTime = fuf#getDataFileTime(s:MODE_NAME, cacheName)
|
||||
if cacheTime != -1 && fuf#countModifiedFiles(a:tagFiles, cacheTime) == 0
|
||||
return fuf#loadDataFile(s:MODE_NAME, cacheName)
|
||||
endif
|
||||
let items = l9#unique(l9#concat(map(copy(a:tagFiles), 's:getTagNames(v:val)')))
|
||||
let items = map(items, 'fuf#makeNonPathItem(v:val, "")')
|
||||
call fuf#mapToSetSerialIndex(items, 1)
|
||||
let items = map(items, 'fuf#setAbbrWithFormattedWord(v:val, 1)')
|
||||
call fuf#saveDataFile(s:MODE_NAME, cacheName, items)
|
||||
return items
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:enumTags(tagFiles)
|
||||
if !len(a:tagFiles)
|
||||
return []
|
||||
endif
|
||||
let key = join([g:fuf_ignoreCase] + a:tagFiles, "\n")
|
||||
if !exists('s:cache[key]') || fuf#countModifiedFiles(a:tagFiles, s:cache[key].time)
|
||||
let s:cache[key] = {
|
||||
\ 'time' : localtime(),
|
||||
\ 'items' : s:parseTagFiles(a:tagFiles, key)
|
||||
\ }
|
||||
endif
|
||||
return s:cache[key].items
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:getMatchingIndex(lines, cmd)
|
||||
if a:cmd !~# '\D'
|
||||
return str2nr(a:cmd)
|
||||
endif
|
||||
let pattern = matchstr(a:cmd, '^\/\^\zs.*\ze\$\/$')
|
||||
if empty(pattern)
|
||||
return -1
|
||||
endif
|
||||
for i in range(len(a:lines))
|
||||
if a:lines[i] ==# pattern
|
||||
return i
|
||||
endif
|
||||
endfor
|
||||
return -1
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" s:handler {{{1
|
||||
|
||||
let s:handler = {}
|
||||
|
||||
"
|
||||
function s:handler.getModeName()
|
||||
return s:MODE_NAME
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getPrompt()
|
||||
return fuf#formatPrompt(g:fuf_tag_prompt, self.partialMatching, '')
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getPreviewHeight()
|
||||
return g:fuf_previewHeight
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.isOpenable(enteredPattern)
|
||||
return 1
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.makePatternSet(patternBase)
|
||||
return fuf#makePatternSet(a:patternBase, 's:interpretPrimaryPatternForNonPath',
|
||||
\ self.partialMatching)
|
||||
endfunction
|
||||
|
||||
" 'cmd' is '/^hoge hoge$/' or line number
|
||||
function s:handler.makePreviewLines(word, count)
|
||||
let tags = taglist('^' . a:word . '$')
|
||||
if empty(tags)
|
||||
return []
|
||||
endif
|
||||
let i = a:count % len(tags)
|
||||
let title = printf('(%d/%d) %s', i + 1, len(tags), tags[i].filename)
|
||||
let lines = fuf#getFileLines(tags[i].filename)
|
||||
let index = s:getMatchingIndex(lines, tags[i].cmd)
|
||||
return [title] + fuf#makePreviewLinesAround(
|
||||
\ lines, (index < 0 ? [] : [index]), 0, self.getPreviewHeight() - 1)
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getCompleteItems(patternPrimary)
|
||||
return s:enumTags(self.tagFiles)
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onOpen(word, mode)
|
||||
call fuf#openTag(a:word, a:mode)
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeEnterPre()
|
||||
let self.tagFiles = fuf#getCurrentTagFiles()
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeEnterPost()
|
||||
let &l:tags = join(self.tagFiles, ',')
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeLeavePost(opened)
|
||||
let &l:tags = ''
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" vim: set fdm=marker:
|
||||
159
.vim/bundle/vim-fuzzyfinder/autoload/fuf/taggedfile.vim
Normal file
159
.vim/bundle/vim-fuzzyfinder/autoload/fuf/taggedfile.vim
Normal file
|
|
@ -0,0 +1,159 @@
|
|||
"=============================================================================
|
||||
" Copyright (c) 2007-2010 Takeshi NISHIDA
|
||||
"
|
||||
"=============================================================================
|
||||
" LOAD GUARD {{{1
|
||||
|
||||
if !l9#guardScriptLoading(expand('<sfile>:p'), 0, 0, [])
|
||||
finish
|
||||
endif
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" GLOBAL FUNCTIONS {{{1
|
||||
|
||||
"
|
||||
function fuf#taggedfile#createHandler(base)
|
||||
return a:base.concretize(copy(s:handler))
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#taggedfile#getSwitchOrder()
|
||||
return g:fuf_taggedfile_switchOrder
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#taggedfile#getEditableDataNames()
|
||||
return []
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#taggedfile#renewCache()
|
||||
let s:cache = {}
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#taggedfile#requiresOnCommandPre()
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
"
|
||||
function fuf#taggedfile#onInit()
|
||||
call fuf#defineLaunchCommand('FufTaggedFile', s:MODE_NAME, '""', [])
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" LOCAL FUNCTIONS/VARIABLES {{{1
|
||||
|
||||
let s:MODE_NAME = expand('<sfile>:t:r')
|
||||
|
||||
"
|
||||
function s:getTaggedFileList(tagfile)
|
||||
execute 'cd ' . fnamemodify(a:tagfile, ':h')
|
||||
let result = map(l9#readFile(a:tagfile), 'matchstr(v:val, ''^[^!\t][^\t]*\t\zs[^\t]\+'')')
|
||||
call map(l9#readFile(a:tagfile), 'fnamemodify(v:val, ":p")')
|
||||
cd -
|
||||
call map(l9#readFile(a:tagfile), 'fnamemodify(v:val, ":~:.")')
|
||||
return filter(result, 'v:val =~# ''[^/\\ ]$''')
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:parseTagFiles(tagFiles, key)
|
||||
let cacheName = 'cache-' . l9#hash224(a:key)
|
||||
let cacheTime = fuf#getDataFileTime(s:MODE_NAME, cacheName)
|
||||
if cacheTime != -1 && fuf#countModifiedFiles(a:tagFiles, cacheTime) == 0
|
||||
return fuf#loadDataFile(s:MODE_NAME, cacheName)
|
||||
endif
|
||||
let items = l9#unique(l9#concat(map(copy(a:tagFiles), 's:getTaggedFileList(v:val)')))
|
||||
call map(items, 'fuf#makePathItem(v:val, "", 0)')
|
||||
call fuf#mapToSetSerialIndex(items, 1)
|
||||
call fuf#mapToSetAbbrWithSnippedWordAsPath(items)
|
||||
call fuf#saveDataFile(s:MODE_NAME, cacheName, items)
|
||||
return items
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:enumTaggedFiles(tagFiles)
|
||||
if !len(a:tagFiles)
|
||||
return []
|
||||
endif
|
||||
let key = join([getcwd(), g:fuf_ignoreCase] + a:tagFiles, "\n")
|
||||
if !exists('s:cache[key]') || fuf#countModifiedFiles(a:tagFiles, s:cache[key].time)
|
||||
let s:cache[key] = {
|
||||
\ 'time' : localtime(),
|
||||
\ 'items' : s:parseTagFiles(a:tagFiles, key)
|
||||
\ }
|
||||
endif
|
||||
return s:cache[key].items
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" s:handler {{{1
|
||||
|
||||
let s:handler = {}
|
||||
|
||||
"
|
||||
function s:handler.getModeName()
|
||||
return s:MODE_NAME
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getPrompt()
|
||||
return fuf#formatPrompt(g:fuf_taggedfile_prompt, self.partialMatching, '')
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getPreviewHeight()
|
||||
return g:fuf_previewHeight
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.isOpenable(enteredPattern)
|
||||
return 1
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.makePatternSet(patternBase)
|
||||
return fuf#makePatternSet(a:patternBase, 's:interpretPrimaryPatternForPath',
|
||||
\ self.partialMatching)
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.makePreviewLines(word, count)
|
||||
return fuf#makePreviewLinesForFile(a:word, a:count, self.getPreviewHeight())
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.getCompleteItems(patternPrimary)
|
||||
return self.items
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onOpen(word, mode)
|
||||
call fuf#openFile(a:word, a:mode, g:fuf_reuseWindow)
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeEnterPre()
|
||||
let self.tagFiles = fuf#getCurrentTagFiles()
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeEnterPost()
|
||||
" NOTE: Comparing filenames is faster than bufnr('^' . fname . '$')
|
||||
let bufNamePrev = fnamemodify(bufname(self.bufNrPrev), ':p:~:.')
|
||||
" NOTE: Don't do this in onModeEnterPre()
|
||||
" because that should return in a short time.
|
||||
let self.items = copy(s:enumTaggedFiles(self.tagFiles))
|
||||
call filter(self.items, 'v:val.word !=# bufNamePrev')
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:handler.onModeLeavePost(opened)
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" vim: set fdm=marker:
|
||||
1405
.vim/bundle/vim-fuzzyfinder/doc/fuf.jax
Normal file
1405
.vim/bundle/vim-fuzzyfinder/doc/fuf.jax
Normal file
File diff suppressed because it is too large
Load diff
1883
.vim/bundle/vim-fuzzyfinder/doc/fuf.txt
Normal file
1883
.vim/bundle/vim-fuzzyfinder/doc/fuf.txt
Normal file
File diff suppressed because it is too large
Load diff
158
.vim/bundle/vim-fuzzyfinder/plugin/fuf.vim
Normal file
158
.vim/bundle/vim-fuzzyfinder/plugin/fuf.vim
Normal file
|
|
@ -0,0 +1,158 @@
|
|||
"=============================================================================
|
||||
" Copyright (c) 2007-2010 Takeshi NISHIDA
|
||||
"
|
||||
" GetLatestVimScripts: 1984 1 :AutoInstall: FuzzyFinder
|
||||
"=============================================================================
|
||||
" LOAD GUARD {{{1
|
||||
|
||||
try
|
||||
if !l9#guardScriptLoading(expand('<sfile>:p'), 702, 101, [])
|
||||
finish
|
||||
endif
|
||||
catch /E117/
|
||||
echoerr '***** L9 library must be installed! *****'
|
||||
finish
|
||||
endtry
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" LOCAL FUNCTIONS {{{1
|
||||
|
||||
"
|
||||
function s:initialize()
|
||||
"---------------------------------------------------------------------------
|
||||
call l9#defineVariableDefault('g:fuf_modesDisable' , [ 'mrufile', 'mrucmd', ])
|
||||
call l9#defineVariableDefault('g:fuf_keyOpen' , '<CR>')
|
||||
call l9#defineVariableDefault('g:fuf_keyOpenSplit' , '<C-j>')
|
||||
call l9#defineVariableDefault('g:fuf_keyOpenVsplit' , '<C-k>')
|
||||
call l9#defineVariableDefault('g:fuf_keyOpenTabpage' , '<C-l>')
|
||||
call l9#defineVariableDefault('g:fuf_keyPreview' , '<C-@>')
|
||||
call l9#defineVariableDefault('g:fuf_keyNextMode' , '<C-t>')
|
||||
call l9#defineVariableDefault('g:fuf_keyPrevMode' , '<C-y>')
|
||||
call l9#defineVariableDefault('g:fuf_keyPrevPattern' , '<C-s>')
|
||||
call l9#defineVariableDefault('g:fuf_keyNextPattern' , '<C-_>')
|
||||
call l9#defineVariableDefault('g:fuf_keySwitchMatching', '<C-\><C-\>')
|
||||
call l9#defineVariableDefault('g:fuf_dataDir' , '~/.vim-fuf-data')
|
||||
call l9#defineVariableDefault('g:fuf_abbrevMap' , {})
|
||||
call l9#defineVariableDefault('g:fuf_patternSeparator' , ';')
|
||||
call l9#defineVariableDefault('g:fuf_promptHighlight' , 'Question')
|
||||
call l9#defineVariableDefault('g:fuf_ignoreCase' , 1)
|
||||
call l9#defineVariableDefault('g:fuf_splitPathMatching', 1)
|
||||
call l9#defineVariableDefault('g:fuf_fuzzyRefining' , 0)
|
||||
call l9#defineVariableDefault('g:fuf_smartBs' , 1)
|
||||
call l9#defineVariableDefault('g:fuf_reuseWindow' , 1)
|
||||
call l9#defineVariableDefault('g:fuf_timeFormat' , '(%Y-%m-%d %H:%M:%S)')
|
||||
call l9#defineVariableDefault('g:fuf_learningLimit' , 100)
|
||||
call l9#defineVariableDefault('g:fuf_enumeratingLimit' , 50)
|
||||
call l9#defineVariableDefault('g:fuf_maxMenuWidth' , 78)
|
||||
call l9#defineVariableDefault('g:fuf_previewHeight' , 0)
|
||||
call l9#defineVariableDefault('g:fuf_autoPreview' , 0)
|
||||
call l9#defineVariableDefault('g:fuf_useMigemo' , 0)
|
||||
"---------------------------------------------------------------------------
|
||||
call l9#defineVariableDefault('g:fuf_buffer_prompt' , '>Buffer[]>')
|
||||
call l9#defineVariableDefault('g:fuf_buffer_switchOrder', 10)
|
||||
call l9#defineVariableDefault('g:fuf_buffer_mruOrder' , 1)
|
||||
call l9#defineVariableDefault('g:fuf_buffer_keyDelete' , '<C-]>')
|
||||
"---------------------------------------------------------------------------
|
||||
call l9#defineVariableDefault('g:fuf_file_prompt' , '>File[]>')
|
||||
call l9#defineVariableDefault('g:fuf_file_switchOrder', 20)
|
||||
call l9#defineVariableDefault('g:fuf_file_exclude' , '\v\~$|\.(o|exe|dll|bak|orig|sw[po])$|(^|[/\\])\.(hg|git|bzr)($|[/\\])')
|
||||
"---------------------------------------------------------------------------
|
||||
call l9#defineVariableDefault('g:fuf_coveragefile_prompt' , '>CoverageFile[]>')
|
||||
call l9#defineVariableDefault('g:fuf_coveragefile_switchOrder', 30)
|
||||
call l9#defineVariableDefault('g:fuf_coveragefile_exclude' , '\v\~$|\.(o|exe|dll|bak|orig|sw[po])$|(^|[/\\])\.(hg|git|bzr)($|[/\\])')
|
||||
call l9#defineVariableDefault('g:fuf_coveragefile_globPatterns', ['**/.*', '**/*'])
|
||||
"---------------------------------------------------------------------------
|
||||
call l9#defineVariableDefault('g:fuf_dir_prompt' , '>Dir[]>')
|
||||
call l9#defineVariableDefault('g:fuf_dir_switchOrder', 40)
|
||||
call l9#defineVariableDefault('g:fuf_dir_exclude' , '\v(^|[/\\])\.(hg|git|bzr)($|[/\\])')
|
||||
"---------------------------------------------------------------------------
|
||||
call l9#defineVariableDefault('g:fuf_mrufile_prompt' , '>MRU-File[]>')
|
||||
call l9#defineVariableDefault('g:fuf_mrufile_switchOrder', 50)
|
||||
call l9#defineVariableDefault('g:fuf_mrufile_exclude' , '\v\~$|\.(o|exe|dll|bak|orig|sw[po])$|^(\/\/|\\\\|\/mnt\/|\/media\/)')
|
||||
call l9#defineVariableDefault('g:fuf_mrufile_maxItem' , 200)
|
||||
call l9#defineVariableDefault('g:fuf_mrufile_maxItemDir' , 50)
|
||||
call l9#defineVariableDefault('g:fuf_mrufile_keyExpand' , '<C-]>')
|
||||
"---------------------------------------------------------------------------
|
||||
call l9#defineVariableDefault('g:fuf_mrucmd_prompt' , '>MRU-Cmd[]>')
|
||||
call l9#defineVariableDefault('g:fuf_mrucmd_switchOrder', 60)
|
||||
call l9#defineVariableDefault('g:fuf_mrucmd_exclude' , '^$')
|
||||
call l9#defineVariableDefault('g:fuf_mrucmd_maxItem' , 200)
|
||||
"---------------------------------------------------------------------------
|
||||
call l9#defineVariableDefault('g:fuf_bookmarkfile_prompt' , '>Bookmark-File[]>')
|
||||
call l9#defineVariableDefault('g:fuf_bookmarkfile_switchOrder', 70)
|
||||
call l9#defineVariableDefault('g:fuf_bookmarkfile_searchRange', 400)
|
||||
call l9#defineVariableDefault('g:fuf_bookmarkfile_keyDelete' , '<C-]>')
|
||||
"---------------------------------------------------------------------------
|
||||
call l9#defineVariableDefault('g:fuf_bookmarkdir_prompt' , '>Bookmark-Dir[]>')
|
||||
call l9#defineVariableDefault('g:fuf_bookmarkdir_switchOrder', 80)
|
||||
call l9#defineVariableDefault('g:fuf_bookmarkdir_keyDelete' , '<C-]>')
|
||||
"---------------------------------------------------------------------------
|
||||
call l9#defineVariableDefault('g:fuf_tag_prompt' , '>Tag[]>')
|
||||
call l9#defineVariableDefault('g:fuf_tag_switchOrder', 90)
|
||||
"---------------------------------------------------------------------------
|
||||
call l9#defineVariableDefault('g:fuf_buffertag_prompt' , '>Buffer-Tag[]>')
|
||||
call l9#defineVariableDefault('g:fuf_buffertag_switchOrder', 100)
|
||||
call l9#defineVariableDefault('g:fuf_buffertag_ctagsPath' , 'ctags')
|
||||
"---------------------------------------------------------------------------
|
||||
call l9#defineVariableDefault('g:fuf_taggedfile_prompt' , '>Tagged-File[]>')
|
||||
call l9#defineVariableDefault('g:fuf_taggedfile_switchOrder', 110)
|
||||
"---------------------------------------------------------------------------
|
||||
call l9#defineVariableDefault('g:fuf_jumplist_prompt' , '>Jump-List[]>')
|
||||
call l9#defineVariableDefault('g:fuf_jumplist_switchOrder', 120)
|
||||
"---------------------------------------------------------------------------
|
||||
call l9#defineVariableDefault('g:fuf_changelist_prompt' , '>Change-List[]>')
|
||||
call l9#defineVariableDefault('g:fuf_changelist_switchOrder', 130)
|
||||
"---------------------------------------------------------------------------
|
||||
call l9#defineVariableDefault('g:fuf_quickfix_prompt' , '>Quickfix[]>')
|
||||
call l9#defineVariableDefault('g:fuf_quickfix_switchOrder', 140)
|
||||
"---------------------------------------------------------------------------
|
||||
call l9#defineVariableDefault('g:fuf_line_prompt' , '>Line[]>')
|
||||
call l9#defineVariableDefault('g:fuf_line_switchOrder', 150)
|
||||
"---------------------------------------------------------------------------
|
||||
call l9#defineVariableDefault('g:fuf_help_prompt' , '>Help[]>')
|
||||
call l9#defineVariableDefault('g:fuf_help_switchOrder', 160)
|
||||
"---------------------------------------------------------------------------
|
||||
command! -bang -narg=0 FufEditDataFile call fuf#editDataFile()
|
||||
command! -bang -narg=0 FufRenewCache call s:renewCachesOfAllModes()
|
||||
"---------------------------------------------------------------------------
|
||||
call fuf#addMode('buffer')
|
||||
call fuf#addMode('file')
|
||||
call fuf#addMode('coveragefile')
|
||||
call fuf#addMode('dir')
|
||||
call fuf#addMode('mrufile')
|
||||
call fuf#addMode('mrucmd')
|
||||
call fuf#addMode('bookmarkfile')
|
||||
call fuf#addMode('bookmarkdir')
|
||||
call fuf#addMode('tag')
|
||||
call fuf#addMode('buffertag')
|
||||
call fuf#addMode('taggedfile')
|
||||
call fuf#addMode('jumplist')
|
||||
call fuf#addMode('changelist')
|
||||
call fuf#addMode('quickfix')
|
||||
call fuf#addMode('line')
|
||||
call fuf#addMode('help')
|
||||
call fuf#addMode('givenfile')
|
||||
call fuf#addMode('givendir')
|
||||
call fuf#addMode('givencmd')
|
||||
call fuf#addMode('callbackfile')
|
||||
call fuf#addMode('callbackitem')
|
||||
"---------------------------------------------------------------------------
|
||||
endfunction
|
||||
|
||||
"
|
||||
function s:renewCachesOfAllModes()
|
||||
for m in fuf#getModeNames()
|
||||
call fuf#{m}#renewCache()
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" INITIALIZATION {{{1
|
||||
|
||||
call s:initialize()
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" vim: set fdm=marker:
|
||||
BIN
.vim/bundle/vim-l9/.hg/00changelog.i
Normal file
BIN
.vim/bundle/vim-l9/.hg/00changelog.i
Normal file
Binary file not shown.
1
.vim/bundle/vim-l9/.hg/branch
Normal file
1
.vim/bundle/vim-l9/.hg/branch
Normal file
|
|
@ -0,0 +1 @@
|
|||
default
|
||||
2
.vim/bundle/vim-l9/.hg/branchheads.cache
Normal file
2
.vim/bundle/vim-l9/.hg/branchheads.cache
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
3bb534a720fa762aa01d2df2d5d41bd3c4122169 16
|
||||
3bb534a720fa762aa01d2df2d5d41bd3c4122169 default
|
||||
BIN
.vim/bundle/vim-l9/.hg/dirstate
Normal file
BIN
.vim/bundle/vim-l9/.hg/dirstate
Normal file
Binary file not shown.
2
.vim/bundle/vim-l9/.hg/hgrc
Normal file
2
.vim/bundle/vim-l9/.hg/hgrc
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
[paths]
|
||||
default = https://bitbucket.org/ns9tks/vim-l9
|
||||
3
.vim/bundle/vim-l9/.hg/requires
Normal file
3
.vim/bundle/vim-l9/.hg/requires
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
revlogv1
|
||||
store
|
||||
fncache
|
||||
BIN
.vim/bundle/vim-l9/.hg/store/00changelog.i
Normal file
BIN
.vim/bundle/vim-l9/.hg/store/00changelog.i
Normal file
Binary file not shown.
BIN
.vim/bundle/vim-l9/.hg/store/00manifest.i
Normal file
BIN
.vim/bundle/vim-l9/.hg/store/00manifest.i
Normal file
Binary file not shown.
BIN
.vim/bundle/vim-l9/.hg/store/data/.hgtags.i
Normal file
BIN
.vim/bundle/vim-l9/.hg/store/data/.hgtags.i
Normal file
Binary file not shown.
BIN
.vim/bundle/vim-l9/.hg/store/data/autoload/l9.vim.i
Normal file
BIN
.vim/bundle/vim-l9/.hg/store/data/autoload/l9.vim.i
Normal file
Binary file not shown.
BIN
.vim/bundle/vim-l9/.hg/store/data/autoload/l9/async.py.i
Normal file
BIN
.vim/bundle/vim-l9/.hg/store/data/autoload/l9/async.py.i
Normal file
Binary file not shown.
BIN
.vim/bundle/vim-l9/.hg/store/data/autoload/l9/async.vim.i
Normal file
BIN
.vim/bundle/vim-l9/.hg/store/data/autoload/l9/async.vim.i
Normal file
Binary file not shown.
BIN
.vim/bundle/vim-l9/.hg/store/data/autoload/l9/quickfix.vim.i
Normal file
BIN
.vim/bundle/vim-l9/.hg/store/data/autoload/l9/quickfix.vim.i
Normal file
Binary file not shown.
BIN
.vim/bundle/vim-l9/.hg/store/data/autoload/l9/tempbuffer.vim.i
Normal file
BIN
.vim/bundle/vim-l9/.hg/store/data/autoload/l9/tempbuffer.vim.i
Normal file
Binary file not shown.
Binary file not shown.
BIN
.vim/bundle/vim-l9/.hg/store/data/doc/l9.jax.i
Normal file
BIN
.vim/bundle/vim-l9/.hg/store/data/doc/l9.jax.i
Normal file
Binary file not shown.
BIN
.vim/bundle/vim-l9/.hg/store/data/doc/l9.txt.i
Normal file
BIN
.vim/bundle/vim-l9/.hg/store/data/doc/l9.txt.i
Normal file
Binary file not shown.
BIN
.vim/bundle/vim-l9/.hg/store/data/plugin/l9.vim.i
Normal file
BIN
.vim/bundle/vim-l9/.hg/store/data/plugin/l9.vim.i
Normal file
Binary file not shown.
10
.vim/bundle/vim-l9/.hg/store/fncache
Normal file
10
.vim/bundle/vim-l9/.hg/store/fncache
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
data/.hgtags.i
|
||||
data/autoload/l9.vim.i
|
||||
data/autoload/l9/async.py.i
|
||||
data/autoload/l9/async.vim.i
|
||||
data/autoload/l9/quickfix.vim.i
|
||||
data/autoload/l9/tempbuffer.vim.i
|
||||
data/autoload/l9/tempvariables.vim.i
|
||||
data/doc/l9.jax.i
|
||||
data/doc/l9.txt.i
|
||||
data/plugin/l9.vim.i
|
||||
BIN
.vim/bundle/vim-l9/.hg/store/undo
Normal file
BIN
.vim/bundle/vim-l9/.hg/store/undo
Normal file
Binary file not shown.
5
.vim/bundle/vim-l9/.hg/tags.cache
Normal file
5
.vim/bundle/vim-l9/.hg/tags.cache
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
16 3bb534a720fa762aa01d2df2d5d41bd3c4122169 6aa7a3368a9c199331687b5b0603428056527248
|
||||
|
||||
f6420a42fc69dd7fc08aa5426c4b3fb10e78020d 1.0
|
||||
f6f3e9bae8770abb41259d42ab65721f6915fe22 1.0.1
|
||||
c3f242518bd4b8131a2c277a7f8c492b56375dff 1.1
|
||||
1
.vim/bundle/vim-l9/.hg/undo.branch
Normal file
1
.vim/bundle/vim-l9/.hg/undo.branch
Normal file
|
|
@ -0,0 +1 @@
|
|||
default
|
||||
0
.vim/bundle/vim-l9/.hg/undo.dirstate
Normal file
0
.vim/bundle/vim-l9/.hg/undo.dirstate
Normal file
3
.vim/bundle/vim-l9/.hgtags
Normal file
3
.vim/bundle/vim-l9/.hgtags
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
f6420a42fc69dd7fc08aa5426c4b3fb10e78020d 1.0
|
||||
f6f3e9bae8770abb41259d42ab65721f6915fe22 1.0.1
|
||||
c3f242518bd4b8131a2c277a7f8c492b56375dff 1.1
|
||||
570
.vim/bundle/vim-l9/autoload/l9.vim
Normal file
570
.vim/bundle/vim-l9/autoload/l9.vim
Normal file
File diff suppressed because it is too large
Load diff
92
.vim/bundle/vim-l9/autoload/l9/async.py
Normal file
92
.vim/bundle/vim-l9/autoload/l9/async.py
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
from __future__ import with_statement
|
||||
import vim
|
||||
import os
|
||||
import subprocess
|
||||
import threading
|
||||
import Queue
|
||||
|
||||
|
||||
class Asyncer:
|
||||
|
||||
def __init__(self):
|
||||
self._workers = {}
|
||||
|
||||
def execute(self, var_key, var_command, var_cwd, var_input, var_appends):
|
||||
key = vim.eval(var_key)
|
||||
command = vim.eval(var_command)
|
||||
cwd = vim.eval(var_cwd)
|
||||
input = vim.eval(var_input)
|
||||
appends = vim.eval(var_appends)
|
||||
if key not in self._workers:
|
||||
self._workers[key] = Worker()
|
||||
self._workers[key].start()
|
||||
self._workers[key].put(Executor(command, cwd, input, appends))
|
||||
|
||||
def print_output(self, var_key):
|
||||
key = vim.eval(var_key)
|
||||
if key not in self._workers:
|
||||
return
|
||||
for l in self._workers[key].copy_outputs():
|
||||
print l,
|
||||
|
||||
def print_worker_keys(self):
|
||||
for k in self._workers.keys():
|
||||
print k
|
||||
|
||||
def print_active_worker_keys(self):
|
||||
for k in self._workers.keys():
|
||||
print k
|
||||
|
||||
|
||||
class Worker(threading.Thread):
|
||||
|
||||
def __init__(self):
|
||||
threading.Thread.__init__(self)
|
||||
self._queue = Queue.Queue()
|
||||
self._lines = []
|
||||
self._lock = threading.Lock()
|
||||
|
||||
def run(self):
|
||||
while True:
|
||||
self._queue.get().execute(self)
|
||||
self._queue.task_done()
|
||||
|
||||
def put(self, executor):
|
||||
self._queue.put(executor)
|
||||
|
||||
def clear_outputs(self):
|
||||
with self._lock:
|
||||
self._lines = []
|
||||
|
||||
def record_output(self, line):
|
||||
with self._lock:
|
||||
self._lines.append(line)
|
||||
|
||||
def copy_outputs(self):
|
||||
with self._lock:
|
||||
return self._lines[:]
|
||||
|
||||
|
||||
class Executor:
|
||||
|
||||
def __init__(self, command, cwd, input, appends):
|
||||
self._command = command
|
||||
self._cwd = cwd
|
||||
self._input = input
|
||||
self._appends = appends
|
||||
|
||||
def execute(self, worker):
|
||||
if not self._appends:
|
||||
worker.clear_outputs()
|
||||
os.chdir(self._cwd)
|
||||
p = subprocess.Popen(self._command, shell=True, stdin=subprocess.PIPE,
|
||||
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||
p.stdin.write(self._input)
|
||||
line = p.stdout.readline()
|
||||
while line:
|
||||
worker.record_output(line)
|
||||
line = p.stdout.readline()
|
||||
|
||||
|
||||
67
.vim/bundle/vim-l9/autoload/l9/async.vim
Normal file
67
.vim/bundle/vim-l9/autoload/l9/async.vim
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
"=============================================================================
|
||||
" Copyright (C) 2009-2010 Takeshi NISHIDA
|
||||
"
|
||||
"=============================================================================
|
||||
" LOAD GUARD {{{1
|
||||
|
||||
if !l9#guardScriptLoading(expand('<sfile>:p'), 0, 0, ['has("python")'])
|
||||
finish
|
||||
endif
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" ASYNC EXECUTE {{{1
|
||||
|
||||
"
|
||||
function s:checkKey(key)
|
||||
if a:key =~ '\n' || a:key !~ '\S'
|
||||
throw "Asyncer: Invalid key: " . a:key
|
||||
endif
|
||||
endfunction
|
||||
|
||||
"
|
||||
function l9#async#execute(key, cmd, cwd, input, appends)
|
||||
call s:checkKey(a:key)
|
||||
python asyncer.execute('a:key', 'a:cmd', 'a:cwd', 'a:input', 'a:appends')
|
||||
endfunction
|
||||
|
||||
"
|
||||
function l9#async#read(key)
|
||||
call s:checkKey(a:key)
|
||||
redir => result
|
||||
silent python asyncer.print_output('a:key')
|
||||
redir END
|
||||
" NOTE: "\n" is somehow inserted by redir.
|
||||
return (result[0] ==# "\n" ? result[1:] : result)
|
||||
endfunction
|
||||
|
||||
"
|
||||
function l9#async#listWorkers()
|
||||
redir => result
|
||||
silent python asyncer.print_worker_keys()
|
||||
redir END
|
||||
return split(result, "\n")
|
||||
endfunction
|
||||
|
||||
"
|
||||
function l9#async#listActiveWorkers()
|
||||
redir => result
|
||||
silent python asyncer.print_active_worker_keys()
|
||||
redir END
|
||||
return split(result, "\n")
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" INITIALIZATION {{{1
|
||||
|
||||
let s:ASYNC_PY_PATH = fnamemodify(expand('<sfile>:p:h'), ':p') . 'async.py'
|
||||
|
||||
pyfile `=s:ASYNC_PY_PATH`
|
||||
python asyncer = Asyncer()
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" vim: set fdm=marker:
|
||||
|
||||
|
||||
107
.vim/bundle/vim-l9/autoload/l9/quickfix.vim
Normal file
107
.vim/bundle/vim-l9/autoload/l9/quickfix.vim
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
"=============================================================================
|
||||
" Copyright (C) 2009-2010 Takeshi NISHIDA
|
||||
"
|
||||
"=============================================================================
|
||||
" LOAD GUARD {{{1
|
||||
|
||||
if !l9#guardScriptLoading(expand('<sfile>:p'), 0, 0, [])
|
||||
finish
|
||||
endif
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" QUICKFIX {{{1
|
||||
|
||||
" Returns non-zero if quickfix window is opened.
|
||||
function l9#quickfix#isWindowOpened()
|
||||
return count(map(range(1, winnr('$')), 'getwinvar(v:val, "&buftype")'), 'quickfix') > 0
|
||||
endfunction
|
||||
|
||||
" Opens quickfix window if quickfix is not empty, and echo the number of errors.
|
||||
"
|
||||
" a:onlyRecognized: if non-zero, opens only if quickfix has recognized errors.
|
||||
" a:holdCursor: if non-zero, the cursor won't move to quickfix window.
|
||||
function l9#quickfix#openIfNotEmpty(onlyRecognized, holdCursor)
|
||||
let numErrors = len(filter(getqflist(), 'v:val.valid'))
|
||||
let numOthers = len(getqflist()) - numErrors
|
||||
if numErrors > 0 || (!a:onlyRecognized && numOthers > 0)
|
||||
copen
|
||||
if a:holdCursor
|
||||
wincmd p
|
||||
endif
|
||||
else
|
||||
cclose
|
||||
endif
|
||||
redraw
|
||||
if numOthers > 0
|
||||
echo printf('Quickfix: %d(+%d)', numErrors, numOthers)
|
||||
else
|
||||
echo printf('Quickfix: %d', numErrors)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Toggles Quickfix window
|
||||
function l9#quickfix#toggleWindow()
|
||||
if l9#quickfix#isWindowOpened()
|
||||
cclose
|
||||
else
|
||||
call l9#quickfix#openIfNotEmpty(0, 0)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Creates quickfix list form given lines and opens the quickfix window if
|
||||
" errors exists.
|
||||
"
|
||||
" a:lines:
|
||||
" a:jump: if non-zero, jump to the first error.
|
||||
function l9#quickfix#setMakeResult(lines)
|
||||
cexpr a:lines
|
||||
call l9#quickfix#openIfNotEmpty(0, 1)
|
||||
endfunction
|
||||
|
||||
" Compares quickfix entries for sorting.
|
||||
function l9#quickfix#compareEntries(e0, e1)
|
||||
if a:e0.bufnr != a:e1.bufnr
|
||||
let i0 = bufname(a:e0.bufnr)
|
||||
let i1 = bufname(a:e1.bufnr)
|
||||
elseif a:e0.lnum != a:e1.lnum
|
||||
let i0 = a:e0.lnum
|
||||
let i1 = a:e1.lnum
|
||||
elseif a:e0.col != a:e1.col
|
||||
let i0 = a:e0.col
|
||||
let i1 = a:e1.col
|
||||
else
|
||||
return 0
|
||||
endif
|
||||
return (i0 > i1 ? +1 : -1)
|
||||
endfunction
|
||||
|
||||
" Sorts quickfix
|
||||
function l9#quickfix#sort()
|
||||
call setqflist(sort(getqflist(), 'l9#quickfix#compareEntries'), 'r')
|
||||
endfunction
|
||||
|
||||
" Highlights Quickfix lines by :sign.
|
||||
" Inspired by errormarker plugin.
|
||||
"
|
||||
" You can customize the highlighting via L9ErrorLine and L9WarningLine
|
||||
" highlight groups.
|
||||
function l9#quickfix#placeSign()
|
||||
let warnings = []
|
||||
let errors = []
|
||||
for e in filter(getqflist(), 'v:val.valid')
|
||||
let warning = (e.type ==? 'w' || e.text =~? '^\s*warning:')
|
||||
call add((warning ? warnings : errors), [e.bufnr, e.lnum])
|
||||
endfor
|
||||
sign unplace *
|
||||
call l9#placeSign('L9WarningLine', '>>', '', warnings)
|
||||
call l9#placeSign('L9ErrorLine', '>>', '', errors)
|
||||
endfunction
|
||||
|
||||
highlight default L9ErrorLine ctermfg=white ctermbg=52 guibg=#5F0000
|
||||
highlight default L9WarningLine ctermfg=white ctermbg=17 guibg=#00005F
|
||||
|
||||
" }}}1
|
||||
"=============================================================================
|
||||
" vim: set fdm=marker:
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue