summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitmodules36
-rw-r--r--gitignore3
-rw-r--r--vim/after/plugin/snipMate.vim35
-rw-r--r--vim/autoload/fuf.vim1046
-rw-r--r--vim/autoload/fuf/bookmarkdir.vim163
-rw-r--r--vim/autoload/fuf/bookmarkfile.vim199
-rw-r--r--vim/autoload/fuf/buffer.vim189
-rw-r--r--vim/autoload/fuf/buffertag.vim300
-rw-r--r--vim/autoload/fuf/callbackfile.vim137
-rw-r--r--vim/autoload/fuf/callbackitem.vim139
-rw-r--r--vim/autoload/fuf/changelist.vim172
-rw-r--r--vim/autoload/fuf/coveragefile.vim199
-rw-r--r--vim/autoload/fuf/dir.vim132
-rw-r--r--vim/autoload/fuf/file.vim139
-rw-r--r--vim/autoload/fuf/givencmd.vim123
-rw-r--r--vim/autoload/fuf/givendir.vim123
-rw-r--r--vim/autoload/fuf/givenfile.vim121
-rw-r--r--vim/autoload/fuf/help.vim198
-rw-r--r--vim/autoload/fuf/jumplist.vim182
-rw-r--r--vim/autoload/fuf/line.vim135
-rw-r--r--vim/autoload/fuf/mrucmd.vim134
-rw-r--r--vim/autoload/fuf/mrufile.vim234
-rw-r--r--vim/autoload/fuf/quickfix.vim154
-rw-r--r--vim/autoload/fuf/tag.vim178
-rw-r--r--vim/autoload/fuf/taggedfile.vim159
-rw-r--r--vim/autoload/l9.vim570
-rw-r--r--vim/autoload/l9/async.py92
-rw-r--r--vim/autoload/l9/async.vim67
-rw-r--r--vim/autoload/l9/quickfix.vim107
-rw-r--r--vim/autoload/l9/tempbuffer.vim112
-rw-r--r--vim/autoload/l9/tempvariables.vim60
-rw-r--r--vim/autoload/snipMate.vim433
-rw-r--r--vim/autoload/tcomment.vim981
-rw-r--r--vim/autoload/zencoding.vim2069
m---------vim/bundle/foldtext0
m---------vim/bundle/fuzzyfinder0
m---------vim/bundle/git0
m---------vim/bundle/l90
m---------vim/bundle/pathogen0
m---------vim/bundle/perl0
m---------vim/bundle/snipmate0
m---------vim/bundle/supertab0
m---------vim/bundle/tcomment0
m---------vim/bundle/textobj0
m---------vim/bundle/yankring0
m---------vim/bundle/zencoding0
-rw-r--r--vim/doc/ft-gitcommit-plugin.txt5
-rw-r--r--vim/doc/fuf.jax1405
-rw-r--r--vim/doc/fuf.txt1883
-rw-r--r--vim/doc/l9.jax55
-rw-r--r--vim/doc/l9.txt73
-rw-r--r--vim/doc/matchit.txt406
-rw-r--r--vim/doc/snipMate.txt286
-rw-r--r--vim/doc/tags382
-rw-r--r--vim/doc/tags-ja182
-rw-r--r--vim/doc/tcomment.txt342
-rw-r--r--vim/doc/yankring.txt1467
-rw-r--r--vim/doc/zencoding.txt383
-rw-r--r--vim/ftdetect/git.vim18
-rw-r--r--vim/ftdetect/tt2.vim9
-rw-r--r--vim/ftplugin/git.vim37
-rw-r--r--vim/ftplugin/html_snip_helper.vim10
-rw-r--r--vim/ftplugin/ocaml_enhcomm.vim1
-rw-r--r--vim/ftplugin/php_enhcomm.vim6
-rw-r--r--vim/plugin/foldtext.vim308
-rw-r--r--vim/plugin/fuf.vim158
-rw-r--r--vim/plugin/l9.vim108
-rw-r--r--vim/plugin/matchit.vim812
-rw-r--r--vim/plugin/snipMate.vim247
-rw-r--r--vim/plugin/supertab.vim572
-rw-r--r--vim/plugin/tcomment.vim143
-rw-r--r--vim/plugin/textobj.vim239
-rw-r--r--vim/plugin/yankring.vim2499
-rw-r--r--vim/plugin/zencoding.vim137
-rw-r--r--vim/snippets/_.snippets7
-rw-r--r--vim/snippets/autoit.snippets66
-rw-r--r--vim/snippets/c.snippets107
-rw-r--r--vim/snippets/cpp.snippets37
-rw-r--r--vim/snippets/html.snippets190
-rw-r--r--vim/snippets/java.snippets78
-rw-r--r--vim/snippets/javascript.snippets74
-rw-r--r--vim/snippets/mako.snippets54
-rw-r--r--vim/snippets/objc.snippets184
-rw-r--r--vim/snippets/perl.snippets47
-rw-r--r--vim/snippets/php.snippets216
-rw-r--r--vim/snippets/python.snippets86
-rw-r--r--vim/snippets/ruby.snippets420
-rw-r--r--vim/snippets/sh.snippets28
-rw-r--r--vim/snippets/snippet.snippets7
-rw-r--r--vim/snippets/tcl.snippets92
-rw-r--r--vim/snippets/tex.snippets115
-rw-r--r--vim/snippets/vim.snippets32
-rw-r--r--vim/snippets/zsh.snippets58
-rw-r--r--vim/syntax/git.vim67
-rw-r--r--vim/syntax/gitcommit.vim73
-rw-r--r--vim/syntax/perl.vim536
-rw-r--r--vim/syntax/snippet.vim19
-rwxr-xr-xvim/syntax/tt2.vim213
-rwxr-xr-xvim/syntax/tt2html.vim12
-rw-r--r--vimrc7
100 files changed, 46 insertions, 24073 deletions
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..a71a997
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,36 @@
+[submodule "vim/bundle/pathogen"]
+ path = vim/bundle/pathogen
+ url = git://github.com/tpope/vim-pathogen.git
+[submodule "vim/bundle/snipmate"]
+ path = vim/bundle/snipmate
+ url = git://github.com/msanders/snipmate.vim
+[submodule "vim/bundle/supertab"]
+ path = vim/bundle/supertab
+ url = git://github.com/ervandew/supertab.git
+[submodule "vim/bundle/zencoding"]
+ path = vim/bundle/zencoding
+ url = git://github.com/mattn/zencoding-vim.git
+[submodule "vim/bundle/tcomment"]
+ path = vim/bundle/tcomment
+ url = git://github.com/tomtom/tcomment_vim.git
+[submodule "vim/bundle/git"]
+ path = vim/bundle/git
+ url = git://github.com/tpope/vim-git.git
+[submodule "vim/bundle/yankring"]
+ path = vim/bundle/yankring
+ url = git://github.com/vim-scripts/YankRing.vim.git
+[submodule "vim/bundle/fuzzyfinder"]
+ path = vim/bundle/fuzzyfinder
+ url = git://github.com/vim-scripts/FuzzyFinder.git
+[submodule "vim/bundle/l9"]
+ path = vim/bundle/l9
+ url = git://github.com/vim-scripts/L9.git
+[submodule "vim/bundle/perl"]
+ path = vim/bundle/perl
+ url = git://github.com/petdance/vim-perl.git
+[submodule "vim/bundle/textobj"]
+ path = vim/bundle/textobj
+ url = git://github.com/doy/vim-textobj.git
+[submodule "vim/bundle/foldtext"]
+ path = vim/bundle/foldtext
+ url = git://github.com/doy/vim-foldtext.git
diff --git a/gitignore b/gitignore
index 41e0291..5e8de53 100644
--- a/gitignore
+++ b/gitignore
@@ -2,3 +2,6 @@
.*.sw?
# prove state files
.prove
+# ctags files
+tags
+tags-ja
diff --git a/vim/after/plugin/snipMate.vim b/vim/after/plugin/snipMate.vim
deleted file mode 100644
index 03e79ae..0000000
--- a/vim/after/plugin/snipMate.vim
+++ /dev/null
@@ -1,35 +0,0 @@
-" These are the mappings for snipMate.vim. Putting it here ensures that it
-" will be mapped after other plugins such as supertab.vim.
-if !exists('loaded_snips') || exists('s:did_snips_mappings')
- finish
-endif
-let s:did_snips_mappings = 1
-
-ino <silent> <tab> <c-r>=TriggerSnippet()<cr>
-snor <silent> <tab> <esc>i<right><c-r>=TriggerSnippet()<cr>
-ino <silent> <s-tab> <c-r>=BackwardsSnippet()<cr>
-snor <silent> <s-tab> <esc>i<right><c-r>=BackwardsSnippet()<cr>
-ino <silent> <c-r><tab> <c-r>=ShowAvailableSnips()<cr>
-
-" The default mappings for these are annoying & sometimes break snipMate.
-" You can change them back if you want, I've put them here for convenience.
-snor <bs> b<bs>
-snor <right> <esc>a
-snor <left> <esc>bi
-snor ' b<bs>'
-snor ` b<bs>`
-snor % b<bs>%
-snor U b<bs>U
-snor ^ b<bs>^
-snor \ b<bs>\
-snor <c-x> b<bs><c-x>
-
-" By default load snippets in snippets_dir
-if empty(snippets_dir)
- finish
-endif
-
-call GetSnippets(snippets_dir, '_') " Get global snippets
-
-au FileType * if &ft != 'help' | call GetSnippets(snippets_dir, &ft) | endif
-" vim:noet:sw=4:ts=4:ft=vim
diff --git a/vim/autoload/fuf.vim b/vim/autoload/fuf.vim
deleted file mode 100644
index fe9e6eb..0000000
--- a/vim/autoload/fuf.vim
+++ /dev/null
@@ -1,1046 +0,0 @@
-"=============================================================================
-" Copyright (c) 2007-2010 Takeshi NISHIDA
-"
-"=============================================================================
-" LOAD GUARD {{{1
-
-if !l9#guardScriptLoading(expand('<sfile>:p'), 0, 0, [])
- finish
-endif
-
-" }}}1
-"=============================================================================
-" GLOBAL FUNCTIONS {{{1
-
-
-" returns list of paths.
-" An argument for glob() is normalized in order to avoid a bug on Windows.
-function fuf#glob(expr)
- " Substitutes "\", because on Windows, "**\" doesn't include ".\",
- " but "**/" include "./". I don't know why.
- return split(glob(substitute(a:expr, '\', '/', 'g')), "\n")
-endfunction
-
-"
-function fuf#countModifiedFiles(files, time)
- return len(filter(copy(a:files), 'getftime(expand(v:val)) > a:time'))
-endfunction
-
-"
-function fuf#getCurrentTagFiles()
- return sort(filter(map(tagfiles(), 'fnamemodify(v:val, '':p'')'), 'filereadable(v:val)'))
-endfunction
-
-"
-function fuf#mapToSetSerialIndex(in, offset)
- for i in range(len(a:in))
- let a:in[i].index = i + a:offset
- endfor
- return a:in
-endfunction
-
-"
-function fuf#updateMruList(mrulist, newItem, maxItem, exclude)
- let result = copy(a:mrulist)
- let result = filter(result,'v:val.word !=# a:newItem.word')
- let result = insert(result, a:newItem)
- if len(a:exclude)
- let result = filter(result, 'v:val.word !~ a:exclude')
- endif
- return result[0 : a:maxItem - 1]
-endfunction
-
-" takes suffix number. if no digits, returns -1
-function fuf#suffixNumber(str)
- let s = matchstr(a:str, '\d\+$')
- return (len(s) ? str2nr(s) : -1)
-endfunction
-
-" "foo/bar/buz/hoge" -> { head: "foo/bar/buz/", tail: "hoge" }
-function fuf#splitPath(path)
- let head = matchstr(a:path, '^.*[/\\]')
- return {
- \ 'head' : head,
- \ 'tail' : a:path[strlen(head):]
- \ }
-endfunction
-
-" "foo/.../bar/...hoge" -> "foo/.../bar/../../hoge"
-function fuf#expandTailDotSequenceToParentDir(pattern)
- return substitute(a:pattern, '^\(.*[/\\]\)\?\zs\.\(\.\+\)\ze[^/\\]*$',
- \ '\=repeat(".." . l9#getPathSeparator(), len(submatch(2)))', '')
-endfunction
-
-"
-function fuf#formatPrompt(prompt, partialMatching, otherString)
- let indicator = escape((a:partialMatching ? '!' : '') . a:otherString, '\')
- return substitute(a:prompt, '[]', indicator, 'g')
-endfunction
-
-"
-function fuf#getFileLines(file)
- let bufnr = (type(a:file) ==# type(0) ? a:file : bufnr('^' . a:file . '$'))
- let lines = getbufline(bufnr, 1, '$')
- if !empty(lines)
- return lines
- endif
- return l9#readFile(a:file)
-endfunction
-
-"
-function fuf#makePreviewLinesAround(lines, indices, page, maxHeight)
- let index = ((empty(a:indices) ? 0 : a:indices[0])
- \ + a:page * a:maxHeight) % len(a:lines)
- if empty(a:lines) || a:maxHeight <= 0
- return []
- endif
- let beg = max([0, index - a:maxHeight / 2])
- let end = min([beg + a:maxHeight, len(a:lines)])
- let beg = max([0, end - a:maxHeight])
- let lines = []
- for i in range(beg, end - 1)
- let mark = (count(a:indices, i) ? '>' : ' ')
- call add(lines, printf('%s%4d ', mark, i + 1) . a:lines[i])
- endfor
- return lines
-endfunction
-
-" a:file: a path string or a buffer number
-function fuf#makePreviewLinesForFile(file, count, maxHeight)
- let lines = fuf#getFileLines(a:file)
- if empty(lines)
- return []
- endif
- let bufnr = (type(a:file) ==# type(0) ? a:file : bufnr('^' . a:file . '$'))
- if exists('s:bufferCursorPosMap[bufnr]')
- let indices = [s:bufferCursorPosMap[bufnr][1] - 1]
- else
- let indices = []
- endif
- return fuf#makePreviewLinesAround(
- \ lines, indices, a:count, a:maxHeight)
-endfunction
-
-"
-function fuf#echoWarning(msg)
- call l9#echoHl('WarningMsg', a:msg, '[fuf] ', 1)
-endfunction
-
-"
-function fuf#echoError(msg)
- call l9#echoHl('ErrorMsg', a:msg, '[fuf] ', 1)
-endfunction
-
-"
-function fuf#openBuffer(bufNr, mode, reuse)
- if a:reuse && ((a:mode ==# s:OPEN_TYPE_SPLIT &&
- \ l9#moveToBufferWindowInCurrentTabpage(a:bufNr)) ||
- \ (a:mode ==# s:OPEN_TYPE_VSPLIT &&
- \ l9#moveToBufferWindowInCurrentTabpage(a:bufNr)) ||
- \ (a:mode ==# s:OPEN_TYPE_TAB &&
- \ l9#moveToBufferWindowInOtherTabpage(a:bufNr)))
- return
- endif
- execute printf({
- \ s:OPEN_TYPE_CURRENT : '%sbuffer' ,
- \ s:OPEN_TYPE_SPLIT : '%ssbuffer' ,
- \ s:OPEN_TYPE_VSPLIT : 'vertical %ssbuffer',
- \ s:OPEN_TYPE_TAB : 'tab %ssbuffer' ,
- \ }[a:mode], a:bufNr)
-endfunction
-
-"
-function fuf#openFile(path, mode, reuse)
- let bufNr = bufnr('^' . a:path . '$')
- if bufNr > -1
- call fuf#openBuffer(bufNr, a:mode, a:reuse)
- else
- execute {
- \ s:OPEN_TYPE_CURRENT : 'edit ' ,
- \ s:OPEN_TYPE_SPLIT : 'split ' ,
- \ s:OPEN_TYPE_VSPLIT : 'vsplit ' ,
- \ s:OPEN_TYPE_TAB : 'tabedit ',
- \ }[a:mode] . fnameescape(fnamemodify(a:path, ':~:.'))
- endif
-endfunction
-
-"
-function fuf#openTag(tag, mode)
- execute {
- \ s:OPEN_TYPE_CURRENT : 'tjump ' ,
- \ s:OPEN_TYPE_SPLIT : 'stjump ' ,
- \ s:OPEN_TYPE_VSPLIT : 'vertical stjump ',
- \ s:OPEN_TYPE_TAB : 'tab stjump ' ,
- \ }[a:mode] . a:tag
-endfunction
-
-"
-function fuf#openHelp(tag, mode)
- execute {
- \ s:OPEN_TYPE_CURRENT : 'help ' ,
- \ s:OPEN_TYPE_SPLIT : 'help ' ,
- \ s:OPEN_TYPE_VSPLIT : 'vertical help ',
- \ s:OPEN_TYPE_TAB : 'tab help ' ,
- \ }[a:mode] . a:tag
-endfunction
-
-"
-function fuf#prejump(mode)
- execute {
- \ s:OPEN_TYPE_CURRENT : '' ,
- \ s:OPEN_TYPE_SPLIT : 'split' ,
- \ s:OPEN_TYPE_VSPLIT : 'vsplit' ,
- \ s:OPEN_TYPE_TAB : 'tab split',
- \ }[a:mode]
-endfunction
-
-"
-function fuf#compareRanks(i1, i2)
- if exists('a:i1.ranks') && exists('a:i2.ranks')
- for i in range(min([len(a:i1.ranks), len(a:i2.ranks)]))
- if a:i1.ranks[i] > a:i2.ranks[i]
- return +1
- elseif a:i1.ranks[i] < a:i2.ranks[i]
- return -1
- endif
- endfor
- endif
- return 0
-endfunction
-
-"
-function fuf#makePathItem(fname, menu, appendsDirSuffix)
- let pathPair = fuf#splitPath(a:fname)
- let dirSuffix = (a:appendsDirSuffix && isdirectory(expand(a:fname))
- \ ? l9#getPathSeparator()
- \ : '')
- return {
- \ 'word' : a:fname . dirSuffix,
- \ 'wordForPrimaryHead': s:toLowerForIgnoringCase(pathPair.head),
- \ 'wordForPrimaryTail': s:toLowerForIgnoringCase(pathPair.tail),
- \ 'wordForBoundary' : s:toLowerForIgnoringCase(s:getWordBoundaries(pathPair.tail)),
- \ 'wordForRefining' : s:toLowerForIgnoringCase(a:fname . dirSuffix),
- \ 'wordForRank' : s:toLowerForIgnoringCase(pathPair.tail),
- \ 'menu' : a:menu,
- \ }
-endfunction
-
-"
-function fuf#makeNonPathItem(word, menu)
- let wordL = s:toLowerForIgnoringCase(a:word)
- return {
- \ 'word' : a:word,
- \ 'wordForPrimary' : wordL,
- \ 'wordForBoundary': s:toLowerForIgnoringCase(s:getWordBoundaries(a:word)),
- \ 'wordForRefining': wordL,
- \ 'wordForRank' : wordL,
- \ 'menu' : a:menu,
- \ }
-endfunction
-
-"
-function fuf#makePatternSet(patternBase, interpreter, partialMatching)
- let MakeMatchingExpr = function(a:partialMatching
- \ ? 's:makePartialMatchingExpr'
- \ : 's:makeFuzzyMatchingExpr')
- let [primary; refinings] = split(a:patternBase, g:fuf_patternSeparator, 1)
- let elements = call(a:interpreter, [primary])
- let primaryExprs = map(elements.matchingPairs, 'MakeMatchingExpr(v:val[0], v:val[1])')
- let refiningExprs = map(refinings, 's:makeRefiningExpr(v:val)')
- return {
- \ 'primary' : elements.primary,
- \ 'primaryForRank': elements.primaryForRank,
- \ 'filteringExpr' : join(primaryExprs + refiningExprs, ' && '),
- \ }
-endfunction
-
-"
-function fuf#enumExpandedDirsEntries(dir, exclude)
- let entries = fuf#glob(a:dir . '*') + fuf#glob(a:dir . '.*')
- " removes "*/." and "*/.."
- call filter(entries, 'v:val !~ ''\v(^|[/\\])\.\.?$''')
- call map(entries, 'fuf#makePathItem(v:val, "", 1)')
- if len(a:exclude)
- call filter(entries, 'v:val.word !~ a:exclude')
- endif
- return entries
-endfunction
-
-"
-function fuf#mapToSetAbbrWithSnippedWordAsPath(items)
- let maxLenStats = {}
- call map(a:items, 's:makeFileAbbrInfo(v:val, maxLenStats)')
- let snippedHeads =
- \ map(maxLenStats, 's:getSnippedHead(v:key[: -2], v:val)')
- return map(a:items, 's:setAbbrWithFileAbbrData(v:val, snippedHeads)')
-endfunction
-
-"
-function fuf#setAbbrWithFormattedWord(item, abbrIndex)
- let lenMenu = (exists('a:item.menu') ? len(a:item.menu) + 2 : 0)
- let abbrPrefix = (exists('a:item.abbrPrefix') ? a:item.abbrPrefix : '')
- let a:item.abbr = abbrPrefix . a:item.word
- if a:abbrIndex
- let a:item.abbr = printf('%4d: ', a:item.index) . a:item.abbr
- endif
- let a:item.abbr = l9#snipTail(a:item.abbr, g:fuf_maxMenuWidth - lenMenu, s:ABBR_SNIP_MASK)
- return a:item
-endfunction
-
-"
-function s:onCommandPre()
- for m in filter(copy(fuf#getModeNames()), 'fuf#{v:val}#requiresOnCommandPre()')
- call fuf#{m}#onCommandPre(getcmdtype() . getcmdline())
- endfor
- " lets last entry become the newest in the history
- call histadd(getcmdtype(), getcmdline())
- " this is not mapped again (:help recursive_mapping)
- return "\<CR>"
-endfunction
-
-"
-let s:modeNames = []
-
-"
-function fuf#addMode(modeName)
- if count(g:fuf_modesDisable, a:modeName) > 0
- return
- endif
- call add(s:modeNames, a:modeName)
- call fuf#{a:modeName}#renewCache()
- call fuf#{a:modeName}#onInit()
- if fuf#{a:modeName}#requiresOnCommandPre()
- " cnoremap has a problem, which doesn't expand cabbrev.
- cmap <silent> <expr> <CR> <SID>onCommandPre()
- endif
-endfunction
-
-"
-function fuf#getModeNames()
- return s:modeNames
-endfunction
-
-"
-function fuf#defineLaunchCommand(CmdName, modeName, prefixInitialPattern, tempVars)
- if empty(a:tempVars)
- let preCmd = ''
- else
- let preCmd = printf('call l9#tempvariables#setList(%s, %s) | ',
- \ string(s:TEMP_VARIABLES_GROUP), string(a:tempVars))
- endif
- execute printf('command! -range -bang -narg=? %s %s call fuf#launch(%s, %s . <q-args>, len(<q-bang>))',
- \ a:CmdName, preCmd, string(a:modeName), a:prefixInitialPattern)
-endfunction
-
-"
-function fuf#defineKeyMappingInHandler(key, func)
- " hacks to be able to use feedkeys().
- execute printf(
- \ 'inoremap <buffer> <silent> %s <C-r>=fuf#getRunningHandler().%s ? "" : ""<CR>',
- \ a:key, a:func)
-endfunction
-
-"
-let s:oneTimeVariables = []
-
-"
-function fuf#setOneTimeVariables(...)
- let s:oneTimeVariables += a:000
-endfunction
-
-"
-function fuf#launch(modeName, initialPattern, partialMatching)
- if exists('s:runningHandler')
- call fuf#echoWarning('FuzzyFinder is running.')
- endif
- if count(fuf#getModeNames(), a:modeName) == 0
- echoerr 'This mode is not available: ' . a:modeName
- return
- endif
- let s:runningHandler = fuf#{a:modeName}#createHandler(copy(s:handlerBase))
- let s:runningHandler.stats = fuf#loadDataFile(s:runningHandler.getModeName(), 'stats')
- let s:runningHandler.partialMatching = a:partialMatching
- let s:runningHandler.bufNrPrev = bufnr('%')
- let s:runningHandler.lastCol = -1
- let s:runningHandler.windowRestoringCommand = winrestcmd()
- call s:runningHandler.onModeEnterPre()
- " NOTE: updatetime is set, because in Buffer-Tag mode on Vim 7.3 on Windows,
- " Vim keeps from triggering CursorMovedI for updatetime after system() is
- " called. I don't know why.
- call fuf#setOneTimeVariables(
- \ ['&completeopt', 'menuone'],
- \ ['&ignorecase', 0],
- \ ['&updatetime', 10],
- \ )
- if s:runningHandler.getPreviewHeight() > 0
- call fuf#setOneTimeVariables(
- \ ['&cmdheight', s:runningHandler.getPreviewHeight() + 1])
- endif
- call l9#tempvariables#setList(s:TEMP_VARIABLES_GROUP, s:oneTimeVariables)
- let s:oneTimeVariables = []
- call s:activateFufBuffer()
- augroup FufLocal
- autocmd!
- autocmd CursorMovedI <buffer> call s:runningHandler.onCursorMovedI()
- autocmd InsertLeave <buffer> nested call s:runningHandler.onInsertLeave()
- augroup END
- for [key, func] in [
- \ [ g:fuf_keyOpen , 'onCr(' . s:OPEN_TYPE_CURRENT . ')' ],
- \ [ g:fuf_keyOpenSplit , 'onCr(' . s:OPEN_TYPE_SPLIT . ')' ],
- \ [ g:fuf_keyOpenVsplit , 'onCr(' . s:OPEN_TYPE_VSPLIT . ')' ],
- \ [ g:fuf_keyOpenTabpage , 'onCr(' . s:OPEN_TYPE_TAB . ')' ],
- \ [ '<BS>' , 'onBs()' ],
- \ [ '<C-h>' , 'onBs()' ],
- \ [ '<C-w>' , 'onDeleteWord()' ],
- \ [ g:fuf_keyPreview , 'onPreviewBase(1)' ],
- \ [ g:fuf_keyNextMode , 'onSwitchMode(+1)' ],
- \ [ g:fuf_keyPrevMode , 'onSwitchMode(-1)' ],
- \ [ g:fuf_keySwitchMatching, 'onSwitchMatching()' ],
- \ [ g:fuf_keyPrevPattern , 'onRecallPattern(+1)' ],
- \ [ g:fuf_keyNextPattern , 'onRecallPattern(-1)' ],
- \ ]
- call fuf#defineKeyMappingInHandler(key, func)
- endfor
- " Starts Insert mode and makes CursorMovedI event now. Command prompt is
- " needed to forces a completion menu to update every typing.
- call setline(1, s:runningHandler.getPrompt() . a:initialPattern)
- call s:runningHandler.onModeEnterPost()
- call feedkeys("A", 'n') " startinsert! does not work in InsertLeave event handler
- redraw
-endfunction
-
-"
-function fuf#loadDataFile(modeName, dataName)
- if !s:dataFileAvailable
- return []
- endif
- let lines = l9#readFile(l9#concatPaths([g:fuf_dataDir, a:modeName, a:dataName]))
- return map(lines, 'eval(v:val)')
-endfunction
-
-"
-function fuf#saveDataFile(modeName, dataName, items)
- if !s:dataFileAvailable
- return -1
- endif
- let lines = map(copy(a:items), 'string(v:val)')
- return l9#writeFile(lines, l9#concatPaths([g:fuf_dataDir, a:modeName, a:dataName]))
-endfunction
-
-"
-function fuf#getDataFileTime(modeName, dataName)
- if !s:dataFileAvailable
- return -1
- endif
- return getftime(expand(l9#concatPaths([g:fuf_dataDir, a:modeName, a:dataName])))
-endfunction
-
-"
-function s:createDataBufferListener(dataFile)
- let listener = { 'dataFile': a:dataFile }
-
- function listener.onWrite(lines)
- let [modeName, dataName] = split(self.dataFile, l9#getPathSeparator())
- let items = map(filter(a:lines, '!empty(v:val)'), 'eval(v:val)')
- call fuf#saveDataFile(modeName, dataName, items)
- echo "Data files updated"
- return 1
- endfunction
-
- return listener
-endfunction
-
-"
-function s:createEditDataListener()
- let listener = {}
-
- function listener.onComplete(dataFile, method)
- let bufName = '[fuf-info]'
- let lines = l9#readFile(l9#concatPaths([g:fuf_dataDir, a:dataFile]))
- call l9#tempbuffer#openWritable(bufName, 'vim', lines, 0, 0, 0,
- \ s:createDataBufferListener(a:dataFile))
- endfunction
-
- return listener
-endfunction
-
-"
-function s:getEditableDataFiles(modeName)
- let dataFiles = fuf#{a:modeName}#getEditableDataNames()
- call filter(dataFiles, 'fuf#getDataFileTime(a:modeName, v:val) != -1')
- return map(dataFiles, 'l9#concatPaths([a:modeName, v:val])')
-endfunction
-
-"
-function fuf#editDataFile()
- let dataFiles = map(copy(fuf#getModeNames()), 's:getEditableDataFiles(v:val)')
- let dataFiles = l9#concat(dataFiles)
- call fuf#callbackitem#launch('', 0, '>Mode>', s:createEditDataListener(), dataFiles, 0)
-endfunction
-
-"
-function fuf#getRunningHandler()
- return s:runningHandler
-endfunction
-
-"
-function fuf#onComplete(findstart, base)
- return s:runningHandler.onComplete(a:findstart, a:base)
-endfunction
-
-" }}}1
-"=============================================================================
-" LOCAL FUNCTIONS/VARIABLES {{{1
-
-let s:TEMP_VARIABLES_GROUP = expand('<sfile>:p')
-let s:ABBR_SNIP_MASK = '...'
-let s:OPEN_TYPE_CURRENT = 1
-let s:OPEN_TYPE_SPLIT = 2
-let s:OPEN_TYPE_VSPLIT = 3
-let s:OPEN_TYPE_TAB = 4
-
-" a:pattern: 'str' -> '\V\.\*s\.\*t\.\*r\.\*'
-function s:makeFuzzyMatchingExpr(target, pattern)
- let wi = ''
- for c in split(a:pattern, '\zs')
- if wi =~# '[^*?]$' && c !~ '[*?]'
- let wi .= '*'
- endif
- let wi .= c
- endfor
- return s:makePartialMatchingExpr(a:target, wi)
-endfunction
-
-" a:pattern: 'str' -> '\Vstr'
-" 'st*r' -> '\Vst\.\*r'
-function s:makePartialMatchingExpr(target, pattern)
- let patternMigemo = s:makeAdditionalMigemoPattern(a:pattern)
- if a:pattern !~ '[*?]' && empty(patternMigemo)
- " NOTE: stridx is faster than regexp matching
- return 'stridx(' . a:target . ', ' . string(a:pattern) . ') >= 0'
- endif
- return a:target . ' =~# ' .
- \ string(l9#convertWildcardToRegexp(a:pattern)) . patternMigemo
-endfunction
-
-"
-function s:makeRefiningExpr(pattern)
- if g:fuf_fuzzyRefining
- let expr = s:makeFuzzyMatchingExpr('v:val.wordForRefining', a:pattern)
- else
- let expr = s:makePartialMatchingExpr('v:val.wordForRefining', a:pattern)
- endif
- if a:pattern =~# '\D'
- return expr
- else
- return '(' . expr . ' || v:val.index == ' . string(a:pattern) . ')'
- endif
-endfunction
-
-"
-function s:makeAdditionalMigemoPattern(pattern)
- if !g:fuf_useMigemo || a:pattern =~# '[^\x01-\x7e]'
- return ''
- endif
- return '\|\m' . substitute(migemo(a:pattern), '\\_s\*', '.*', 'g')
-endfunction
-
-"
-function s:interpretPrimaryPatternForPathTail(pattern)
- let pattern = fuf#expandTailDotSequenceToParentDir(a:pattern)
- let pairL = fuf#splitPath(s:toLowerForIgnoringCase(pattern))
- return {
- \ 'primary' : pattern,
- \ 'primaryForRank': pairL.tail,
- \ 'matchingPairs' : [['v:val.wordForPrimaryTail', pairL.tail],],
- \ }
-endfunction
-
-"
-function s:interpretPrimaryPatternForPath(pattern)
- let pattern = fuf#expandTailDotSequenceToParentDir(a:pattern)
- let patternL = s:toLowerForIgnoringCase(pattern)
- let pairL = fuf#splitPath(patternL)
- if g:fuf_splitPathMatching
- let matches = [
- \ ['v:val.wordForPrimaryHead', pairL.head],
- \ ['v:val.wordForPrimaryTail', pairL.tail],
- \ ]
- else
- let matches = [
- \ ['v:val.wordForPrimaryHead . v:val.wordForPrimaryTail', patternL],
- \ ]
- endif
- return {
- \ 'primary' : pattern,
- \ 'primaryForRank': pairL.tail,
- \ 'matchingPairs' : matches,
- \ }
-endfunction
-
-"
-function s:interpretPrimaryPatternForNonPath(pattern)
- let patternL = s:toLowerForIgnoringCase(a:pattern)
- return {
- \ 'primary' : a:pattern,
- \ 'primaryForRank': patternL,
- \ 'matchingPairs' : [['v:val.wordForPrimary', patternL],],
- \ }
-endfunction
-
-"
-function s:getWordBoundaries(word)
- return substitute(a:word, '\a\zs\l\+\|\zs\A', '', 'g')
-endfunction
-
-"
-function s:toLowerForIgnoringCase(str)
- return (g:fuf_ignoreCase ? tolower(a:str) : a:str)
-endfunction
-
-"
-function s:setRanks(item, pattern, exprBoundary, stats)
- "let word2 = substitute(a:eval_word, '\a\zs\l\+\|\zs\A', '', 'g')
- let a:item.ranks = [
- \ s:evaluateLearningRank(a:item.word, a:stats),
- \ -s:scoreSequentialMatching(a:item.wordForRank, a:pattern),
- \ -s:scoreBoundaryMatching(a:item.wordForBoundary,
- \ a:pattern, a:exprBoundary),
- \ a:item.index,
- \ ]
- return a:item
-endfunction
-
-"
-function s:evaluateLearningRank(word, stats)
- for i in range(len(a:stats))
- if a:stats[i].word ==# a:word
- return i
- endif
- endfor
- return len(a:stats)
-endfunction
-
-" range of return value is [0.0, 1.0]
-function s:scoreSequentialMatching(word, pattern)
- if empty(a:pattern)
- return str2float('0.0')
- endif
- let pos = stridx(a:word, a:pattern)
- if pos < 0
- return str2float('0.0')
- endif
- let lenRest = len(a:word) - len(a:pattern) - pos
- return str2float(pos == 0 ? '0.5' : '0.0') + str2float('0.5') / (lenRest + 1)
-endfunction
-
-" range of return value is [0.0, 1.0]
-function s:scoreBoundaryMatching(wordForBoundary, pattern, exprBoundary)
- if empty(a:pattern)
- return str2float('0.0')
- endif
- if !eval(a:exprBoundary)
- return 0
- endif
- return (s:scoreSequentialMatching(a:wordForBoundary, a:pattern) + 1) / 2
-endfunction
-
-"
-function s:highlightPrompt(prompt)
- syntax clear
- execute printf('syntax match %s /^\V%s/', g:fuf_promptHighlight, escape(a:prompt, '\/'))
-endfunction
-
-"
-function s:highlightError()
- syntax clear
- syntax match Error /^.*$/
-endfunction
-
-"
-function s:expandAbbrevMap(pattern, abbrevMap)
- let result = [a:pattern]
- for [pattern, subs] in items(a:abbrevMap)
- let exprs = result
- let result = []
- for expr in exprs
- let result += map(copy(subs), 'substitute(expr, pattern, escape(v:val, ''\''), "g")')
- endfor
- endfor
- return l9#unique(result)
-endfunction
-
-"
-function s:makeFileAbbrInfo(item, maxLenStats)
- let head = matchstr(a:item.word, '^.*[/\\]\ze.')
- let a:item.abbr = { 'head' : head,
- \ 'tail' : a:item.word[strlen(head):],
- \ 'key' : head . '.',
- \ 'prefix' : printf('%4d: ', a:item.index), }
- if exists('a:item.abbrPrefix')
- let a:item.abbr.prefix .= a:item.abbrPrefix
- endif
- let len = len(a:item.abbr.prefix) + len(a:item.word) +
- \ (exists('a:item.menu') ? len(a:item.menu) + 2 : 0)
- if !exists('a:maxLenStats[a:item.abbr.key]') || len > a:maxLenStats[a:item.abbr.key]
- let a:maxLenStats[a:item.abbr.key] = len
- endif
- return a:item
-endfunction
-
-"
-function s:getSnippedHead(head, baseLen)
- return l9#snipMid(a:head, len(a:head) + g:fuf_maxMenuWidth - a:baseLen, s:ABBR_SNIP_MASK)
-endfunction
-
-"
-function s:setAbbrWithFileAbbrData(item, snippedHeads)
- let lenMenu = (exists('a:item.menu') ? len(a:item.menu) + 2 : 0)
- let abbr = a:item.abbr.prefix . a:snippedHeads[a:item.abbr.key] . a:item.abbr.tail
- let a:item.abbr = l9#snipTail(abbr, g:fuf_maxMenuWidth - lenMenu, s:ABBR_SNIP_MASK)
- return a:item
-endfunction
-
-"
-let s:FUF_BUF_NAME = '[fuf]'
-
-"
-function s:activateFufBuffer()
- " lcd . : To avoid the strange behavior that unnamed buffer changes its cwd
- " if 'autochdir' was set on.
- lcd .
- let cwd = getcwd()
- call l9#tempbuffer#openScratch(s:FUF_BUF_NAME, 'fuf', [], 1, 0, 1, {})
- resize 1 " for issue #21
- " lcd ... : countermeasure against auto-cd script
- lcd `=cwd`
- setlocal nocursorline " for highlighting
- setlocal nocursorcolumn " for highlighting
- setlocal omnifunc=fuf#onComplete
- redraw " for 'lazyredraw'
- if exists(':AcpLock')
- AcpLock
- elseif exists(':AutoComplPopLock')
- AutoComplPopLock
- endif
-endfunction
-
-"
-function s:deactivateFufBuffer()
- if exists(':AcpUnlock')
- AcpUnlock
- elseif exists(':AutoComplPopUnlock')
- AutoComplPopUnlock
- endif
- call l9#tempbuffer#close(s:FUF_BUF_NAME)
-endfunction
-
-" }}}1
-"=============================================================================
-" s:handlerBase {{{1
-
-let s:handlerBase = {}
-
-"-----------------------------------------------------------------------------
-" PURE VIRTUAL FUNCTIONS {{{2
-"
-" "
-" s:handler.getModeName()
-"
-" "
-" s:handler.getPrompt()
-"
-" "
-" s:handler.getCompleteItems(patternSet)
-"
-" "
-" s:handler.onOpen(word, mode)
-"
-" " Before entering FuzzyFinder buffer. This function should return in a short time.
-" s:handler.onModeEnterPre()
-"
-" " After entering FuzzyFinder buffer.
-" s:handler.onModeEnterPost()
-"
-" " After leaving FuzzyFinder buffer.
-" s:handler.onModeLeavePost(opened)
-"
-" }}}2
-"-----------------------------------------------------------------------------
-
-"
-function s:handlerBase.concretize(deriv)
- call extend(self, a:deriv, 'error')
- return self
-endfunction
-
-"
-function s:handlerBase.addStat(pattern, word)
- let stat = { 'pattern' : a:pattern, 'word' : a:word }
- call filter(self.stats, 'v:val !=# stat')
- call insert(self.stats, stat)
- let self.stats = self.stats[0 : g:fuf_learningLimit - 1]
-endfunction
-
-"
-function s:handlerBase.getMatchingCompleteItems(patternBase)
- let MakeMatchingExpr = function(self.partialMatching
- \ ? 's:makePartialMatchingExpr'
- \ : 's:makeFuzzyMatchingExpr')
- let patternSet = self.makePatternSet(a:patternBase)
- let exprBoundary = s:makeFuzzyMatchingExpr('a:wordForBoundary', patternSet.primaryForRank)
- let stats = filter(
- \ copy(self.stats), 'v:val.pattern ==# patternSet.primaryForRank')
- let items = self.getCompleteItems(patternSet.primary)
- " NOTE: In order to know an excess, plus 1 to limit number
- let items = l9#filterWithLimit(
- \ items, patternSet.filteringExpr, g:fuf_enumeratingLimit + 1)
- return map(items,
- \ 's:setRanks(v:val, patternSet.primaryForRank, exprBoundary, stats)')
-endfunction
-
-"
-function s:handlerBase.onComplete(findstart, base)
- if a:findstart
- return 0
- elseif !self.existsPrompt(a:base)
- return []
- endif
- call s:highlightPrompt(self.getPrompt())
- let items = []
- for patternBase in s:expandAbbrevMap(self.removePrompt(a:base), g:fuf_abbrevMap)
- let items += self.getMatchingCompleteItems(patternBase)
- if len(items) > g:fuf_enumeratingLimit
- let items = items[ : g:fuf_enumeratingLimit - 1]
- call s:highlightError()
- break
- endif
- endfor
- if empty(items)
- call s:highlightError()
- else
- call sort(items, 'fuf#compareRanks')
- if g:fuf_autoPreview
- call feedkeys("\<C-p>\<Down>\<C-r>=fuf#getRunningHandler().onPreviewBase(0) ? '' : ''\<CR>", 'n')
- else
- call feedkeys("\<C-p>\<Down>", 'n')
- endif
- let self.lastFirstWord = items[0].word
- endif
- return items
-endfunction
-
-"
-function s:handlerBase.existsPrompt(line)
- return strlen(a:line) >= strlen(self.getPrompt()) &&
- \ a:line[:strlen(self.getPrompt()) -1] ==# self.getPrompt()
-endfunction
-
-"
-function s:handlerBase.removePrompt(line)
- return a:line[(self.existsPrompt(a:line) ? strlen(self.getPrompt()) : 0):]
-endfunction
-
-"
-function s:handlerBase.restorePrompt(line)
- let i = 0
- while i < len(self.getPrompt()) && i < len(a:line) && self.getPrompt()[i] ==# a:line[i]
- let i += 1
- endwhile
- return self.getPrompt() . a:line[i : ]
-endfunction
-
-"
-function s:handlerBase.onCursorMovedI()
- if !self.existsPrompt(getline('.'))
- call setline('.', self.restorePrompt(getline('.')))
- call feedkeys("\<End>", 'n')
- elseif col('.') <= len(self.getPrompt())
- " if the cursor is moved before command prompt
- call feedkeys(repeat("\<Right>", len(self.getPrompt()) - col('.') + 1), 'n')
- elseif col('.') > strlen(getline('.')) && col('.') != self.lastCol
- " if the cursor is placed on the end of the line and has been actually moved.
- let self.lastCol = col('.')
- let self.lastPattern = self.removePrompt(getline('.'))
- call feedkeys("\<C-x>\<C-o>", 'n')
- endif
-endfunction
-
-"
-function s:handlerBase.onInsertLeave()
- unlet s:runningHandler
- let tempVars = l9#tempvariables#getList(s:TEMP_VARIABLES_GROUP)
- call l9#tempvariables#end(s:TEMP_VARIABLES_GROUP)
- call s:deactivateFufBuffer()
- call fuf#saveDataFile(self.getModeName(), 'stats', self.stats)
- execute self.windowRestoringCommand
- let fOpen = exists('s:reservedCommand')
- if fOpen
- call self.onOpen(s:reservedCommand[0], s:reservedCommand[1])
- unlet s:reservedCommand
- endif
- call self.onModeLeavePost(fOpen)
- if exists('self.reservedMode')
- call l9#tempvariables#setList(s:TEMP_VARIABLES_GROUP, tempVars)
- call fuf#launch(self.reservedMode, self.lastPattern, self.partialMatching)
- endif
-endfunction
-
-"
-function s:handlerBase.onCr(openType)
- if pumvisible()
- call feedkeys(printf("\<C-y>\<C-r>=fuf#getRunningHandler().onCr(%d) ? '' : ''\<CR>",
- \ a:openType), 'n')
- return
- endif
- if !empty(self.lastPattern)
- call self.addStat(self.lastPattern, self.removePrompt(getline('.')))
- endif
- if !self.isOpenable(getline('.'))
- " To clear i_<C-r> expression (fuf#getRunningHandler().onCr...)
- echo ''
- return
- endif
- let s:reservedCommand = [self.removePrompt(getline('.')), a:openType]
- call feedkeys("\<Esc>", 'n') " stopinsert behavior is strange...
-endfunction
-
-"
-function s:handlerBase.onBs()
- call feedkeys((pumvisible() ? "\<C-e>\<BS>" : "\<BS>"), 'n')
-endfunction
-
-"
-function s:getLastBlockLength(pattern, patternIsPath)
- let separatorPos = strridx(a:pattern, g:fuf_patternSeparator)
- if separatorPos >= 0
- return len(a:pattern) - separatorPos
- endif
- if a:patternIsPath && a:pattern =~# '[/\\].'
- return len(matchstr(a:pattern, '[^/\\]*.$'))
- endif
- return len(a:pattern)
-endfunction
-
-"
-function s:handlerBase.onDeleteWord()
- let pattern = self.removePrompt(getline('.')[ : col('.') - 2])
- let numBs = s:getLastBlockLength(pattern, 1)
- call feedkeys((pumvisible() ? "\<C-e>" : "") . repeat("\<BS>", numBs), 'n')
-endfunction
-
-"
-function s:handlerBase.onPreviewBase(repeatable)
- if self.getPreviewHeight() <= 0
- return
- elseif !pumvisible()
- return
- elseif !self.existsPrompt(getline('.'))
- let word = self.removePrompt(getline('.'))
- elseif !exists('self.lastFirstWord')
- return
- else
- let word = self.lastFirstWord
- endif
- redraw
- if a:repeatable && exists('self.lastPreviewInfo') && self.lastPreviewInfo.word ==# word
- let self.lastPreviewInfo.count += 1
- else
- let self.lastPreviewInfo = {'word': word, 'count': 0}
- endif
- let lines = self.makePreviewLines(word, self.lastPreviewInfo.count)
- let lines = lines[: self.getPreviewHeight() - 1]
- call map(lines, 'substitute(v:val, "\t", repeat(" ", &tabstop), "g")')
- call map(lines, 'strtrans(v:val)')
- call map(lines, 'l9#snipTail(v:val, &columns - 1, s:ABBR_SNIP_MASK)')
- echo join(lines, "\n")
-endfunction
-
-"
-function s:handlerBase.onSwitchMode(shift)
- let modes = copy(fuf#getModeNames())
- call map(modes, '{ "ranks": [ fuf#{v:val}#getSwitchOrder(), v:val ] }')
- call filter(modes, 'v:val.ranks[0] >= 0')
- call sort(modes, 'fuf#compareRanks')
- let self.reservedMode = self.getModeName()
- for i in range(len(modes))
- if modes[i].ranks[1] ==# self.getModeName()
- let self.reservedMode = modes[(i + a:shift) % len(modes)].ranks[1]
- break
- endif
- endfor
- call feedkeys("\<Esc>", 'n') " stopinsert doesn't work.
-endfunction
-
-"
-function s:handlerBase.onSwitchMatching()
- let self.partialMatching = !self.partialMatching
- let self.lastCol = -1
- call setline('.', self.restorePrompt(self.lastPattern))
- call feedkeys("\<End>", 'n')
- "call self.onCursorMovedI()
-endfunction
-
-"
-function s:handlerBase.onRecallPattern(shift)
- let patterns = map(copy(self.stats), 'v:val.pattern')
- if !exists('self.indexRecall')
- let self.indexRecall = -1
- endif
- let self.indexRecall += a:shift
- if self.indexRecall < 0
- let self.indexRecall = -1
- elseif self.indexRecall >= len(patterns)
- let self.indexRecall = len(patterns) - 1
- else
- call setline('.', self.getPrompt() . patterns[self.indexRecall])
- call feedkeys("\<End>", 'n')
- endif
-endfunction
-
-" }}}1
-"=============================================================================
-" INITIALIZATION {{{1
-
-augroup FufGlobal
- autocmd!
- autocmd BufLeave * let s:bufferCursorPosMap[bufnr('')] = getpos('.')
-augroup END
-
-let s:bufferCursorPosMap = {}
-
-"
-let s:DATA_FILE_VERSION = 400
-
-"
-function s:checkDataFileCompatibility()
- if empty(g:fuf_dataDir)
- let s:dataFileAvailable = 0
- return
- endif
- let versionPath = l9#concatPaths([g:fuf_dataDir, 'VERSION'])
- let lines = l9#readFile(versionPath)
- if empty(lines)
- call l9#writeFile([s:DATA_FILE_VERSION], versionPath)
- let s:dataFileAvailable = 1
- elseif str2nr(lines[0]) == s:DATA_FILE_VERSION
- let s:dataFileAvailable = 1
- else
- call fuf#echoWarning(printf(
- \ "=======================================================\n" .
- \ " Existing data files for FuzzyFinder is no longer \n" .
- \ " compatible with this version of FuzzyFinder. Remove \n" .
- \ " %-53s\n" .
- \ "=======================================================\n" ,
- \ string(g:fuf_dataDir)))
- call l9#inputHl('Question', 'Press Enter')
- let s:dataFileAvailable = 0
- endif
-endfunction
-
-call s:checkDataFileCompatibility()
-
-" }}}1
-"=============================================================================
-" vim: set fdm=marker:
-
diff --git a/vim/autoload/fuf/bookmarkdir.vim b/vim/autoload/fuf/bookmarkdir.vim
deleted file mode 100644
index 01585ff..0000000
--- a/vim/autoload/fuf/bookmarkdir.vim
+++ /dev/null
@@ -1,163 +0,0 @@
-"=============================================================================
-" 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:
diff --git a/vim/autoload/fuf/bookmarkfile.vim b/vim/autoload/fuf/bookmarkfile.vim
deleted file mode 100644
index 12ac80f..0000000
--- a/vim/autoload/fuf/bookmarkfile.vim
+++ /dev/null
@@ -1,199 +0,0 @@
-"=============================================================================
-" 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:
diff --git a/vim/autoload/fuf/buffer.vim b/vim/autoload/fuf/buffer.vim
deleted file mode 100644
index 08b954a..0000000
--- a/vim/autoload/fuf/buffer.vim
+++ /dev/null
@@ -1,189 +0,0 @@
-"=============================================================================
-" 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:
diff --git a/vim/autoload/fuf/buffertag.vim b/vim/autoload/fuf/buffertag.vim
deleted file mode 100644
index 392b996..0000000
--- a/vim/autoload/fuf/buffertag.vim
+++ /dev/null
@@ -1,300 +0,0 @@
-"=============================================================================
-" 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:
diff --git a/vim/autoload/fuf/callbackfile.vim b/vim/autoload/fuf/callbackfile.vim
deleted file mode 100644
index fedf0cf..0000000
--- a/vim/autoload/fuf/callbackfile.vim
+++ /dev/null
@@ -1,137 +0,0 @@
-"=============================================================================
-" 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:
diff --git a/vim/autoload/fuf/callbackitem.vim b/vim/autoload/fuf/callbackitem.vim
deleted file mode 100644
index 118ee08..0000000
--- a/vim/autoload/fuf/callbackitem.vim
+++ /dev/null
@@ -1,139 +0,0 @@
-"=============================================================================
-" 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:
diff --git a/vim/autoload/fuf/changelist.vim b/vim/autoload/fuf/changelist.vim
deleted file mode 100644
index 545f6ca..0000000
--- a/vim/autoload/fuf/changelist.vim
+++ /dev/null
@@ -1,172 +0,0 @@
-"=============================================================================
-" 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:
-
diff --git a/vim/autoload/fuf/coveragefile.vim b/vim/autoload/fuf/coveragefile.vim
deleted file mode 100644
index 1471ef8..0000000
--- a/vim/autoload/fuf/coveragefile.vim
+++ /dev/null
@@ -1,199 +0,0 @@
-"=============================================================================
-" 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:
diff --git a/vim/autoload/fuf/dir.vim b/vim/autoload/fuf/dir.vim
deleted file mode 100644
index 5316093..0000000
--- a/vim/autoload/fuf/dir.vim
+++ /dev/null
@@ -1,132 +0,0 @@
-"=============================================================================
-" 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:
diff --git a/vim/autoload/fuf/file.vim b/vim/autoload/fuf/file.vim
deleted file mode 100644
index 1569192..0000000
--- a/vim/autoload/fuf/file.vim
+++ /dev/null
@@ -1,139 +0,0 @@
-"=============================================================================
-" 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:
diff --git a/vim/autoload/fuf/givencmd.vim b/vim/autoload/fuf/givencmd.vim
deleted file mode 100644
index d59178c..0000000
--- a/vim/autoload/fuf/givencmd.vim
+++ /dev/null
@@ -1,123 +0,0 @@
-"=============================================================================
-" 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:
diff --git a/vim/autoload/fuf/givendir.vim b/vim/autoload/fuf/givendir.vim
deleted file mode 100644
index e654d85..0000000
--- a/vim/autoload/fuf/givendir.vim
+++ /dev/null
@@ -1,123 +0,0 @@
-"=============================================================================
-" 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:
diff --git a/vim/autoload/fuf/givenfile.vim b/vim/autoload/fuf/givenfile.vim
deleted file mode 100644
index 5419ff8..0000000
--- a/vim/autoload/fuf/givenfile.vim
+++ /dev/null
@@ -1,121 +0,0 @@
-"=============================================================================
-" 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:
diff --git a/vim/autoload/fuf/help.vim b/vim/autoload/fuf/help.vim
deleted file mode 100644
index 8f03e36..0000000
--- a/vim/autoload/fuf/help.vim
+++ /dev/null
@@ -1,198 +0,0 @@
-"=============================================================================
-" 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:
diff --git a/vim/autoload/fuf/jumplist.vim b/vim/autoload/fuf/jumplist.vim
deleted file mode 100644
index ddbb1ab..0000000
--- a/vim/autoload/fuf/jumplist.vim
+++ /dev/null
@@ -1,182 +0,0 @@
-"=============================================================================
-" 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:
-
diff --git a/vim/autoload/fuf/line.vim b/vim/autoload/fuf/line.vim
deleted file mode 100644
index 60447b5..0000000
--- a/vim/autoload/fuf/line.vim
+++ /dev/null
@@ -1,135 +0,0 @@
-"=============================================================================
-" 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:
diff --git a/vim/autoload/fuf/mrucmd.vim b/vim/autoload/fuf/mrucmd.vim
deleted file mode 100644
index 58632ce..0000000
--- a/vim/autoload/fuf/mrucmd.vim
+++ /dev/null
@@ -1,134 +0,0 @@
-"=============================================================================
-" 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:
diff --git a/vim/autoload/fuf/mrufile.vim b/vim/autoload/fuf/mrufile.vim
deleted file mode 100644
index f90b9e3..0000000
--- a/vim/autoload/fuf/mrufile.vim
+++ /dev/null
@@ -1,234 +0,0 @@
-"=============================================================================
-" 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:
diff --git a/vim/autoload/fuf/quickfix.vim b/vim/autoload/fuf/quickfix.vim
deleted file mode 100644
index dd5d67c..0000000
--- a/vim/autoload/fuf/quickfix.vim
+++ /dev/null
@@ -1,154 +0,0 @@
-"=============================================================================
-" 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:
-
diff --git a/vim/autoload/fuf/tag.vim b/vim/autoload/fuf/tag.vim
deleted file mode 100644
index 362cabf..0000000
--- a/vim/autoload/fuf/tag.vim
+++ /dev/null
@@ -1,178 +0,0 @@
-"=============================================================================
-" 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:
diff --git a/vim/autoload/fuf/taggedfile.vim b/vim/autoload/fuf/taggedfile.vim
deleted file mode 100644
index 74652fc..0000000
--- a/vim/autoload/fuf/taggedfile.vim
+++ /dev/null
@@ -1,159 +0,0 @@
-"=============================================================================
-" 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:
diff --git a/vim/autoload/l9.vim b/vim/autoload/l9.vim
deleted file mode 100644
index b6a0ae7..0000000
--- a/vim/autoload/l9.vim
+++ /dev/null
@@ -1,570 +0,0 @@
-"=============================================================================
-" Copyright (c) 2009-2010 Takeshi NISHIDA
-"
-"=============================================================================
-" LOAD GUARD {{{1
-
-if exists('g:loaded_autoload_l9')
- finish
-endif
-let g:loaded_autoload_l9 = 1
-
-" }}}1
-"=============================================================================
-" COMPATIBILITY TEST {{{1
-
-"
-let s:L9_VERSION_CURRENT = 101
-let s:L9_VERSION_PASSABLE = 101
-
-" returns true if given version is compatible.
-function l9#isCompatible(ver)
- return
-endfunction
-
-let s:VERSION_FACTOR = str2float('0.01')
-
-" returns false if the caller script should finish.
-" a:vimVersion: if 0, don't check vim version
-" a:l9Version: same rule as v:version
-function l9#guardScriptLoading(path, vimVersion, l9Version, exprs)
- let loadedVarName = 'g:loaded_' . substitute(a:path, '\W', '_', 'g')
- if exists(loadedVarName)
- return 0
- elseif a:vimVersion > 0 && a:vimVersion > v:version
- echoerr a:path . ' requires Vim version ' . string(a:vimVersion * s:VERSION_FACTOR)
- return 0
- elseif a:l9Version > 0 && (a:l9Version > s:L9_VERSION_CURRENT ||
- \ a:l9Version < s:L9_VERSION_PASSABLE)
- echoerr a:path . ' requires L9 library version ' . string(a:l9Version * s:VERSION_FACTOR)
- return 0
- endif
- for expr in a:exprs
- if !eval(expr)
- echoerr a:path . ' requires: ' . expr
- return 0
- endif
- endfor
- let {loadedVarName} = 1
- return 1
-endfunction
-
-"
-function l9#getVersion()
- return s:L9_VERSION_CURRENT
-endfunction
-
-" }}}1
-"=============================================================================
-" LIST {{{1
-
-" Removes duplicates (unstable)
-" This function doesn't change the list of argument.
-function l9#unique(items)
- let sorted = sort(a:items)
- if len(sorted) < 2
- return sorted
- endif
- let last = remove(sorted, 0)
- let result = [last]
- for item in sorted
- if item != last
- call add(result, item)
- let last = item
- endif
- endfor
- return result
-endfunction
-
-" Removes duplicates (stable)
-" This function doesn't change the list of argument.
-function l9#uniqueStably(items)
- let result = []
- for item in a:items
- if count(result, item, &ignorecase) == 0
- call add(result, item)
- endif
- endfor
- return result
-endfunction
-
-" [ [0], [1,2], [3] ] -> [ 0, 1, 2, 3 ]
-" This function doesn't change the list of argument.
-function l9#concat(items)
- let result = []
- for l in a:items
- let result += l
- endfor
- return result
-endfunction
-
-" [ [0,1,2], [3,4], [5,6,7,8] ] -> [ [0,3,5],[1,4,6] ]
-" This function doesn't change the list of argument.
-function l9#zip(items)
- let result = []
- for i in range(min(map(copy(a:items), 'len(v:val)')))
- call add(result, map(copy(a:items), 'v:val[i]'))
- endfor
- return result
-endfunction
-
-" filter() with the maximum number of items
-" This function doesn't change the list of argument.
-function l9#filterWithLimit(items, expr, limit)
- if a:limit <= 0
- return filter(copy(a:items), a:expr)
- endif
- let result = []
- let stride = a:limit * 3 / 2 " x1.5
- for i in range(0, len(a:items) - 1, stride)
- let result += filter(a:items[i : i + stride - 1], a:expr)
- if len(result) >= a:limit
- return remove(result, 0, a:limit - 1)
- endif
- endfor
- return result
-endfunction
-
-" Removes if a:expr is evaluated as non-zero and returns removed items.
-" This function change the list of argument.
-function l9#removeIf(items, expr)
- let removed = filter(copy(a:items), a:expr)
- call filter(a:items, '!( ' . a:expr . ')')
- return removed
-endfunction
-
-" }}}1
-"=============================================================================
-" NUMERIC {{{1
-
-" }}}1
-"=============================================================================
-" STRING {{{1
-
-" Snips a:str and add a:mask if the length of a:str is more than a:len
-function l9#snipHead(str, len, mask)
- if a:len >= len(a:str)
- return a:str
- elseif a:len <= len(a:mask)
- return a:mask
- endif
- return a:mask . a:str[-a:len + len(a:mask):]
-endfunction
-
-" Snips a:str and add a:mask if the length of a:str is more than a:len
-function l9#snipTail(str, len, mask)
- if a:len >= len(a:str)
- return a:str
- elseif a:len <= len(a:mask)
- return a:mask
- endif
- return a:str[:a:len - 1 - len(a:mask)] . a:mask
-endfunction
-
-" Snips a:str and add a:mask if the length of a:str is more than a:len
-function l9#snipMid(str, len, mask)
- if a:len >= len(a:str)
- return a:str
- elseif a:len <= len(a:mask)
- return a:mask
- endif
- let len_head = (a:len - len(a:mask)) / 2
- let len_tail = a:len - len(a:mask) - len_head
- return (len_head > 0 ? a:str[: len_head - 1] : '') . a:mask .
- \ (len_tail > 0 ? a:str[-len_tail :] : '')
-endfunction
-
-"
-function l9#hash224(str)
- let a = 0x00000800 " shift 11 bit (if unsigned)
- let b = 0x001fffff " extract 11 bit (if unsigned)
- let nHash = 7
- let hashes = repeat([0], nHash)
- for i in range(len(a:str))
- let iHash = i % nHash
- let hashes[iHash] = hashes[iHash] * a + hashes[iHash] / b
- let hashes[iHash] += char2nr(a:str[i])
- endfor
- return join(map(hashes, 'printf("%08x", v:val)'), '')
-endfunction
-
-" wildcard -> regexp
-function l9#convertWildcardToRegexp(expr)
- let re = escape(a:expr, '\')
- for [pat, sub] in [ [ '*', '\\.\\*' ], [ '?', '\\.' ], [ '[', '\\[' ], ]
- let re = substitute(re, pat, sub, 'g')
- endfor
- return '\V' . re
-endfunction
-
-" }}}1
-"=============================================================================
-" LINES {{{1
-
-" Removes from the line matching with a:begin first to the line matching with
-" a:end next and returns removed lines.
-" If matching range is not found, returns []
-function l9#removeLinesBetween(lines, begin, end)
- for i in range(len(a:lines) - 1)
- if a:lines[i] =~ a:begin
- break
- endif
- endfor
- for j in range(i + 1, len(a:lines) - 1)
- if a:lines[j] =~ a:end
- let g:l0 += [a:lines[i : j]]
- return remove(a:lines, i, j)
- endif
- endfor
- return []
-endfunction
-
-" }}}1
-"=============================================================================
-" PATH {{{1
-
-" returns the path separator charactor.
-function l9#getPathSeparator()
- return (!&shellslash && (has('win32') || has('win64')) ? '\' : '/')
-endfunction
-
-" [ 'a', 'b/', '/c' ] -> 'a/b/c'
-function l9#concatPaths(paths)
- let result = ''
- for p in a:paths
- if empty(p)
- continue
- elseif empty(result)
- let result = p
- else
- let result = substitute(result, '[/\\]$', '', '') . l9#getPathSeparator()
- \ . substitute(p, '^[/\\]', '', '')
- endif
- endfor
- return result
-endfunction
-
-" path: '/a/b/c/d', dir: '/a/b' => 'c/d'
-function l9#modifyPathRelativeToDir(path, dir)
- let pathFull = fnamemodify(a:path, ':p')
- let dirFull = fnamemodify(a:dir, ':p')
- if len(pathFull) < len(dirFull) || pathFull[:len(dirFull) - 1] !=# dirFull
- return pathFull
- endif
- return pathFull[len(dirFull):]
-endfunction
-
-" }}}1
-"=============================================================================
-" FILE {{{1
-
-" Almost same as readfile().
-function l9#readFile(...)
- let args = copy(a:000)
- let args[0] = expand(args[0])
- try
- return call('readfile', args)
- catch
- endtry
- return []
-endfunction
-
-" Almost same as writefile().
-function l9#writeFile(...)
- let args = copy(a:000)
- let args[1] = expand(args[1])
- let dir = fnamemodify(args[1], ':h')
- try
- if !isdirectory(dir)
- call mkdir(dir, 'p')
- endif
- return call('writefile', args)
- catch
- endtry
- return -1 " -1 is error code.
-endfunction
-
-" }}}1
-"=============================================================================
-" BUFFER {{{1
-
-" :wall/:wall! wrapper. Useful for writing readonly buffers.
-function l9#writeAll()
- try
- silent update " NOTE: avoiding a problem with a buftype=acwrite buffer.
- silent wall
- catch /^Vim/ " E45, E505
- if l9#inputHl('Question', v:exception . "\nWrite readonly files? (Y/N) : ", 'Y') ==? 'y'
- redraw
- :wall!
- endif
- endtry
-endfunction
-
-" Loads given files with :edit command
-function l9#loadFilesToBuffers(files)
- for file in filter(copy(a:files), '!bufloaded(v:val)')
- execute 'edit ' . fnameescape(file)
- if !exists('bufNrFirst')
- let bufNrFirst = bufnr('%')
- endif
- endfor
- if exists('bufNrFirst')
- execute bufNrFirst . 'buffer'
- endif
-endfunction
-
-" Deletes all buffers except given files with :bdelete command
-function l9#deleteAllBuffersExcept(files)
- let bufNrExcepts = map(copy(a:files), 'bufnr("^" . v:val . "$")')
- for bufNr in filter(range(1, bufnr('$')), 'bufloaded(v:val)')
- if count(bufNrExcepts, bufNr) == 0
- execute bufNr . 'bdelete'
- endif
- endfor
-endfunction
-
-" }}}1
-"=============================================================================
-" WINDOW {{{1
-
-" move current window to next tabpage.
-function l9#shiftWinNextTabpage()
- if tabpagenr('$') < 2
- return
- endif
- let bufnr = bufnr('%')
- tabnext
- execute bufnr . 'sbuffer'
- tabprevious
- if winnr('$') > 1
- close
- tabnext
- else
- close " if tabpage is closed, next tabpage will become current
- endif
-endfunction
-
-" move current window to previous tabpage.
-function l9#shiftWinPrevTabpage()
- if tabpagenr('$') < 2
- return
- endif
- let bufnr = bufnr('%')
- tabprevious
- execute bufnr . 'sbuffer'
- tabnext
- close
- tabprevious
-endfunction
-
-" move to a window containing specified buffer.
-" returns 0 if the buffer is not found.
-function l9#moveToBufferWindowInCurrentTabpage(bufNr)
- if bufnr('%') == a:bufNr
- return 1
- elseif count(tabpagebuflist(), a:bufNr) == 0
- return 0
- endif
- execute bufwinnr(a:bufNr) . 'wincmd w'
- return 1
-endfunction
-
-" returns 0 if the buffer is not found.
-function s:moveToOtherTabpageOpeningBuffer(bufNr)
- for tabNr in range(1, tabpagenr('$'))
- if tabNr != tabpagenr() && count(tabpagebuflist(tabNr), a:bufNr) > 0
- execute 'tabnext ' . tabNr
- return 1
- endif
- endfor
- return 0
-endfunction
-
-" move to a window containing specified buffer.
-" returns 0 if the buffer is not found.
-function l9#moveToBufferWindowInOtherTabpage(bufNr)
- if !s:moveToOtherTabpageOpeningBuffer(a:bufNr)
- return 0
- endif
- return l9#moveToBufferWindowInCurrentTabpage(a:bufNr)
-endfunction
-
-" }}}1
-"=============================================================================
-" COMMAND LINE {{{1
-
-" echo/echomsg with highlighting.
-function l9#echoHl(hl, msg, prefix, addingHistory)
- let echoCmd = (a:addingHistory ? 'echomsg' : 'echo')
- execute "echohl " . a:hl
- try
- for l in (type(a:msg) == type([]) ? a:msg : split(a:msg, "\n"))
- execute echoCmd . ' a:prefix . l'
- endfor
- finally
- echohl None
- endtry
-endfunction
-
-" input() with highlighting.
-" This function can take list as {completion} argument.
-function l9#inputHl(hl, ...)
- execute "echohl " . a:hl
- try
- let args = copy(a:000)
- if len(args) > 2 && type(args[2]) == type([])
- let s:candidatesForInputHl = args[2]
- let args[2] = 'custom,l9#completeForInputHl'
- endif
- let s = call('input', args)
- unlet! s:candidatesForInputHl
- finally
- echohl None
- endtry
- redraw " needed to show following echo to next line.
- return s
-endfunction
-
-" only called by l9#inputHl() for completion.
-function l9#completeForInputHl(lead, line, pos)
- return join(s:candidatesForInputHl, "\n")
-endfunction
-
-" }}}1
-"=============================================================================
-" VISUAL MODE {{{1
-
-" returns last selected text in Visual mode.
-function l9#getSelectedText()
- let reg_ = [@", getregtype('"')]
- let regA = [@a, getregtype('a')]
- if mode() =~# "[vV\<C-v>]"
- silent normal! "aygv
- else
- let pos = getpos('.')
- silent normal! gv"ay
- call setpos('.', pos)
- endif
- let text = @a
- call setreg('"', reg_[0], reg_[1])
- call setreg('a', regA[0], regA[1])
- return text
-endfunction
-
-
-" }}}1
-"=============================================================================
-" EVAL {{{1
-
-" loads given text as Vim script with :source command
-function l9#loadScript(text)
- let lines = (type(a:text) == type([]) ? a:text : split(a:text, "\n"))
- let fname = tempname()
- call writefile(lines, fname)
- source `=fname`
- call delete(fname)
-endfunction
-
-
-" }}}1
-"=============================================================================
-" VARIABLES {{{1
-
-"
-function l9#defineVariableDefault(name, default)
- if !exists(a:name)
- let {a:name} = a:default
- endif
-endfunction
-
-" }}}1
-"=============================================================================
-" GREP {{{1
-
-" Execute :vimgrep and opens the quickfix window if matches are found.
-"
-" a:pattern: search pattern. If ommitted, last search pattern (@/) is used.
-" a:files: List of files
-function l9#grepFiles(pattern, files)
- let target = join(map(a:files, 'escape(v:val, " ")'), ' ')
- let pattern = (a:pattern[0] ==# '/' ? a:pattern[1:] : a:pattern)
- let pattern = (empty(pattern) ? @/ : pattern)
- try
- execute printf('vimgrep/%s/j %s', pattern, target)
- catch /^Vim/
- call setqflist([])
- endtry
- call l9#quickfix#sort()
- call l9#quickfix#openIfNotEmpty(1, 0)
-endfunction
-
-" Execute :vimgrep for buffers using l9#grepFiles()
-" See also: :L9GrepBuffer :L9GrepBufferAll
-function l9#grepBuffers(pattern, bufNrs)
- let files = map(filter(a:bufNrs, 'bufloaded(v:val)'), 'bufname(v:val)')
- call l9#grepFiles(a:pattern, files)
-endfunction
-
-" }}}1
-"=============================================================================
-" SIGN {{{1
-
-" Highlights lines using :sign define and :sign place.
-"
-" a:linehl, a:text, a:texthl: See |signs|. Ignored if empty string.
-" a:locations: List of [{buffer number}, {line number}] for highlighting
-function l9#placeSign(linehl, text, texthl, locations)
- let argLinehl = (empty(a:linehl) ? '' : 'linehl=' . a:linehl)
- let argText = (empty(a:text) ? '' : 'text=' . a:text)
- let argTexthl = (empty(a:texthl) ? '' : 'texthl=' . a:texthl)
- let name = 'l9--' . a:linehl . '--' . a:text . '--' . a:texthl
- execute printf('sign define %s linehl=%s text=%s texthl=%s',
- \ name, a:linehl, a:text, a:texthl)
- for [bufNr, lnum] in a:locations
- execute printf('sign place 1 line=%d name=%s buffer=%d', lnum, name, bufNr)
- endfor
-endfunction
-
-" }}}1
-"=============================================================================
-" NOTIFY EXTERNALLY {{{1
-
-" Notify a message using an external program.
-" Currently supports Balloonly, Screen, and Tmux.
-function l9#notifyExternally(msg)
- return l9#notifyBalloonly(a:msg)
- \ || l9#notifyScreen(a:msg)
- \ || l9#notifyTmux(a:msg)
-endfunction
-
-"
-function l9#notifyBalloonly(msg)
- if !(has('win32') || has('win64')) || !executable(g:l9_balloonly)
- return 0
- endif
- execute 'silent !start ' . shellescape(g:l9_balloonly) . ' 4000 "l9" ' . shellescape(a:msg)
- return 1
-endfunction
-
-"
-function l9#notifyScreen(msg)
- if !has('unix') || has('gui_running') || $WINDOW !~ '\d' || !executable('screen')
- return 0
- endif
- call system('screen -X wall ' . shellescape('l9: ' . a:msg))
- return 1
-endfunction
-
-"
-function l9#notifyTmux(msg)
- if !has('unix') || has('gui_running') || empty($TMUX) || !executable('tmux')
- return 0
- endif
- call system('tmux display-message ' . shellescape('l9: ' . a:msg))
- return 1
-endfunction
-
-" }}}1
-"=============================================================================
-" vim: set fdm=marker:
diff --git a/vim/autoload/l9/async.py b/vim/autoload/l9/async.py
deleted file mode 100644
index eeb0cc3..0000000
--- a/vim/autoload/l9/async.py
+++ /dev/null
@@ -1,92 +0,0 @@
-#!/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()
-
-
diff --git a/vim/autoload/l9/async.vim b/vim/autoload/l9/async.vim
deleted file mode 100644
index fa66e9f..0000000
--- a/vim/autoload/l9/async.vim
+++ /dev/null
@@ -1,67 +0,0 @@
-"=============================================================================
-" 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:
-
-
diff --git a/vim/autoload/l9/quickfix.vim b/vim/autoload/l9/quickfix.vim
deleted file mode 100644
index 1758b39..0000000
--- a/vim/autoload/l9/quickfix.vim
+++ /dev/null
@@ -1,107 +0,0 @@
-"=============================================================================
-" 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:
-
diff --git a/vim/autoload/l9/tempbuffer.vim b/vim/autoload/l9/tempbuffer.vim
deleted file mode 100644
index 6f11a78..0000000
--- a/vim/autoload/l9/tempbuffer.vim
+++ /dev/null
@@ -1,112 +0,0 @@
-"=============================================================================
-" Copyright (C) 2009-2010 Takeshi NISHIDA
-"
-"=============================================================================
-" LOAD GUARD {{{1
-
-if !l9#guardScriptLoading(expand('<sfile>:p'), 0, 0, [])
- finish
-endif
-
-" }}}1
-"=============================================================================
-" TEMPORARY BUFFER {{{1
-
-" each key is a buffer name.
-let s:dataMap = {}
-
-"
-function s:onBufDelete(bufname)
- if exists('s:dataMap[a:bufname].listener.onClose')
- call s:dataMap[a:bufname].listener.onClose(s:dataMap[a:bufname].written)
- endif
- if bufnr('%') == s:dataMap[a:bufname].bufNr && winnr('#') != 0
- " if winnr('#') returns 0, "wincmd p" causes ringing the bell.
- wincmd p
- endif
-endfunction
-
-"
-function s:onBufWriteCmd(bufname)
- if !exists('s:dataMap[a:bufname].listener.onWrite') ||
- \ s:dataMap[a:bufname].listener.onWrite(getline(1, '$'))
- setlocal nomodified
- let s:dataMap[a:bufname].written = 1
- call l9#tempbuffer#close(a:bufname)
- else
- endif
-endfunction
-
-" a:bufname:
-" a:height: Window height. If 0, default height is used.
-" If less than 0, the window becomes full-screen.
-" a:listener:
-" a:listener.onClose(written)
-function l9#tempbuffer#openScratch(bufname, filetype, lines, topleft, vertical, height, listener)
- let openCmdPrefix = (a:topleft ? 'topleft ' : '')
- \ . (a:vertical ? 'vertical ' : '')
- \ . (a:height > 0 ? a:height : '')
- if !exists('s:dataMap[a:bufname]') || !bufexists(s:dataMap[a:bufname].bufNr)
- execute openCmdPrefix . 'new'
- else
- call l9#tempbuffer#close(a:bufname)
- execute openCmdPrefix . 'split'
- execute 'silent ' . s:dataMap[a:bufname].bufNr . 'buffer'
- endif
- if a:height < 0
- only
- endif
- setlocal buflisted noswapfile bufhidden=delete modifiable noreadonly buftype=nofile
- let &l:filetype = a:filetype
- silent file `=a:bufname`
- call setline(1, a:lines)
- setlocal nomodified
- augroup L9TempBuffer
- autocmd! * <buffer>
- execute printf('autocmd BufDelete <buffer> call s:onBufDelete (%s)', string(a:bufname))
- execute printf('autocmd BufWriteCmd <buffer> nested call s:onBufWriteCmd(%s)', string(a:bufname))
- augroup END
- let s:dataMap[a:bufname] = {
- \ 'bufNr': bufnr('%'),
- \ 'written': 0,
- \ 'listener': a:listener,
- \ }
-endfunction
-
-"
-function l9#tempbuffer#openReadOnly(bufname, filetype, lines, topleft, vertical, height, listener)
- call l9#tempbuffer#openScratch(a:bufname, a:filetype, a:lines, a:topleft, a:vertical, a:height, a:listener)
- setlocal nomodifiable readonly
-endfunction
-
-" a:listener:
-" a:listener.onClose(written)
-" a:listener.onWrite(lines)
-function l9#tempbuffer#openWritable(bufname, filetype, lines, topleft, vertical, height, listener)
- call l9#tempbuffer#openScratch(a:bufname, a:filetype, a:lines, a:topleft, a:vertical, a:height, a:listener)
- setlocal buftype=acwrite
-endfunction
-
-" makes specified temp buffer current.
-function l9#tempbuffer#moveTo(bufname)
- return l9#moveToBufferWindowInCurrentTabpage(s:dataMap[a:bufname].bufNr) ||
- \ l9#moveToBufferWindowInOtherTabpage(s:dataMap[a:bufname].bufNr)
-endfunction
-
-"
-function l9#tempbuffer#close(bufname)
- if !l9#tempbuffer#isOpen(a:bufname)
- return
- endif
- execute printf('%dbdelete!', s:dataMap[a:bufname].bufNr)
-endfunction
-
-"
-function l9#tempbuffer#isOpen(bufname)
- return exists('s:dataMap[a:bufname]') && bufloaded(s:dataMap[a:bufname].bufNr)
-endfunction
-
-" }}}1
-"=============================================================================
-" vim: set fdm=marker:
-
diff --git a/vim/autoload/l9/tempvariables.vim b/vim/autoload/l9/tempvariables.vim
deleted file mode 100644
index ee847ee..0000000
--- a/vim/autoload/l9/tempvariables.vim
+++ /dev/null
@@ -1,60 +0,0 @@
-"=============================================================================
-" Copyright (C) 2010 Takeshi NISHIDA
-"
-"=============================================================================
-" LOAD GUARD {{{1
-
-if !l9#guardScriptLoading(expand('<sfile>:p'), 0, 0, [])
- finish
-endif
-
-" }}}1
-"=============================================================================
-" TEMPORARY VARIABLES {{{1
-
-"
-let s:origMap = {}
-
-" set temporary variables
-function l9#tempvariables#set(group, name, value)
- if !exists('s:origMap[a:group]')
- let s:origMap[a:group] = {}
- endif
- if !exists('s:origMap[a:group][a:name]')
- let s:origMap[a:group][a:name] = eval(a:name)
- endif
- execute 'let ' . a:name . ' = a:value'
-endfunction
-
-" set temporary variables
-function l9#tempvariables#setList(group, variables)
- for [name, value] in a:variables
- call l9#tempvariables#set(a:group, name, value)
- unlet value " to avoid E706
- endfor
-endfunction
-
-" get temporary variables
-function l9#tempvariables#getList(group)
- if !exists('s:origMap[a:group]')
- return []
- endif
- return map(keys(s:origMap[a:group]), '[v:val, eval(v:val)]')
-endfunction
-
-" restore original variables and clean up.
-function l9#tempvariables#end(group)
- if !exists('s:origMap[a:group]')
- return
- endif
- for [name, value] in items(s:origMap[a:group])
- execute 'let ' . name . ' = value'
- unlet value " to avoid E706
- endfor
- unlet s:origMap[a:group]
-endfunction
-
-" }}}1
-"=============================================================================
-" vim: set fdm=marker:
-
diff --git a/vim/autoload/snipMate.vim b/vim/autoload/snipMate.vim
deleted file mode 100644
index dcd28f6..0000000
--- a/vim/autoload/snipMate.vim
+++ /dev/null
@@ -1,433 +0,0 @@
-fun! Filename(...)
- let filename = expand('%:t:r')
- if filename == '' | return a:0 == 2 ? a:2 : '' | endif
- return !a:0 || a:1 == '' ? filename : substitute(a:1, '$1', filename, 'g')
-endf
-
-fun s:RemoveSnippet()
- unl! g:snipPos s:curPos s:snipLen s:endCol s:endLine s:prevLen
- \ s:lastBuf s:oldWord
- if exists('s:update')
- unl s:startCol s:origWordLen s:update
- if exists('s:oldVars') | unl s:oldVars s:oldEndCol | endif
- endif
- aug! snipMateAutocmds
-endf
-
-fun snipMate#expandSnip(snip, col)
- let lnum = line('.') | let col = a:col
-
- let snippet = s:ProcessSnippet(a:snip)
- " Avoid error if eval evaluates to nothing
- if snippet == '' | return '' | endif
-
- " Expand snippet onto current position with the tab stops removed
- let snipLines = split(substitute(snippet, '$\d\+\|${\d\+.\{-}}', '', 'g'), "\n", 1)
-
- let line = getline(lnum)
- let afterCursor = strpart(line, col - 1)
- " Keep text after the cursor
- if afterCursor != "\t" && afterCursor != ' '
- let line = strpart(line, 0, col - 1)
- let snipLines[-1] .= afterCursor
- else
- let afterCursor = ''
- " For some reason the cursor needs to move one right after this
- if line != '' && col == 1 && &ve != 'all' && &ve != 'onemore'
- let col += 1
- endif
- endif
-
- call setline(lnum, line.snipLines[0])
-
- " Autoindent snippet according to previous indentation
- let indent = matchend(line, '^.\{-}\ze\(\S\|$\)') + 1
- call append(lnum, map(snipLines[1:], "'".strpart(line, 0, indent - 1)."'.v:val"))
-
- " Open any folds snippet expands into
- if &fen | sil! exe lnum.','.(lnum + len(snipLines) - 1).'foldopen' | endif
-
- let [g:snipPos, s:snipLen] = s:BuildTabStops(snippet, lnum, col - indent, indent)
-
- if s:snipLen
- aug snipMateAutocmds
- au CursorMovedI * call s:UpdateChangedSnip(0)
- au InsertEnter * call s:UpdateChangedSnip(1)
- aug END
- let s:lastBuf = bufnr(0) " Only expand snippet while in current buffer
- let s:curPos = 0
- let s:endCol = g:snipPos[s:curPos][1]
- let s:endLine = g:snipPos[s:curPos][0]
-
- call cursor(g:snipPos[s:curPos][0], g:snipPos[s:curPos][1])
- let s:prevLen = [line('$'), col('$')]
- if g:snipPos[s:curPos][2] != -1 | return s:SelectWord() | endif
- else
- unl g:snipPos s:snipLen
- " Place cursor at end of snippet if no tab stop is given
- let newlines = len(snipLines) - 1
- call cursor(lnum + newlines, indent + len(snipLines[-1]) - len(afterCursor)
- \ + (newlines ? 0: col - 1))
- endif
- return ''
-endf
-
-" Prepare snippet to be processed by s:BuildTabStops
-fun s:ProcessSnippet(snip)
- let snippet = a:snip
- " Evaluate eval (`...`) expressions.
- " Using a loop here instead of a regex fixes a bug with nested "\=".
- if stridx(snippet, '`') != -1
- while match(snippet, '`.\{-}`') != -1
- let snippet = substitute(snippet, '`.\{-}`',
- \ substitute(eval(matchstr(snippet, '`\zs.\{-}\ze`')),
- \ "\n\\%$", '', ''), '')
- endw
- let snippet = substitute(snippet, "\r", "\n", 'g')
- endif
-
- " Place all text after a colon in a tab stop after the tab stop
- " (e.g. "${#:foo}" becomes "${:foo}foo").
- " This helps tell the position of the tab stops later.
- let snippet = substitute(snippet, '${\d\+:\(.\{-}\)}', '&\1', 'g')
-
- " Update the a:snip so that all the $# become the text after
- " the colon in their associated ${#}.
- " (e.g. "${1:foo}" turns all "$1"'s into "foo")
- let i = 1
- while stridx(snippet, '${'.i) != -1
- let s = matchstr(snippet, '${'.i.':\zs.\{-}\ze}')
- if s != ''
- let snippet = substitute(snippet, '$'.i, s.'&', 'g')
- endif
- let i += 1
- endw
-
- if &et " Expand tabs to spaces if 'expandtab' is set.
- return substitute(snippet, '\t', repeat(' ', &sts ? &sts : &sw), 'g')
- endif
- return snippet
-endf
-
-" Counts occurences of haystack in needle
-fun s:Count(haystack, needle)
- let counter = 0
- let index = stridx(a:haystack, a:needle)
- while index != -1
- let index = stridx(a:haystack, a:needle, index+1)
- let counter += 1
- endw
- return counter
-endf
-
-" Builds a list of a list of each tab stop in the snippet containing:
-" 1.) The tab stop's line number.
-" 2.) The tab stop's column number
-" (by getting the length of the string between the last "\n" and the
-" tab stop).
-" 3.) The length of the text after the colon for the current tab stop
-" (e.g. "${1:foo}" would return 3). If there is no text, -1 is returned.
-" 4.) If the "${#:}" construct is given, another list containing all
-" the matches of "$#", to be replaced with the placeholder. This list is
-" composed the same way as the parent; the first item is the line number,
-" and the second is the column.
-fun s:BuildTabStops(snip, lnum, col, indent)
- let snipPos = []
- let i = 1
- let withoutVars = substitute(a:snip, '$\d\+', '', 'g')
- while stridx(a:snip, '${'.i) != -1
- let beforeTabStop = matchstr(withoutVars, '^.*\ze${'.i.'\D')
- let withoutOthers = substitute(withoutVars, '${\('.i.'\D\)\@!\d\+.\{-}}', '', 'g')
-
- let j = i - 1
- call add(snipPos, [0, 0, -1])
- let snipPos[j][0] = a:lnum + s:Count(beforeTabStop, "\n")
- let snipPos[j][1] = a:indent + len(matchstr(withoutOthers, '.*\(\n\|^\)\zs.*\ze${'.i.'\D'))
- if snipPos[j][0] == a:lnum | let snipPos[j][1] += a:col | endif
-
- " Get all $# matches in another list, if ${#:name} is given
- if stridx(withoutVars, '${'.i.':') != -1
- let snipPos[j][2] = len(matchstr(withoutVars, '${'.i.':\zs.\{-}\ze}'))
- let dots = repeat('.', snipPos[j][2])
- call add(snipPos[j], [])
- let withoutOthers = substitute(a:snip, '${\d\+.\{-}}\|$'.i.'\@!\d\+', '', 'g')
- while match(withoutOthers, '$'.i.'\(\D\|$\)') != -1
- let beforeMark = matchstr(withoutOthers, '^.\{-}\ze'.dots.'$'.i.'\(\D\|$\)')
- call add(snipPos[j][3], [0, 0])
- let snipPos[j][3][-1][0] = a:lnum + s:Count(beforeMark, "\n")
- let snipPos[j][3][-1][1] = a:indent + (snipPos[j][3][-1][0] > a:lnum
- \ ? len(matchstr(beforeMark, '.*\n\zs.*'))
- \ : a:col + len(beforeMark))
- let withoutOthers = substitute(withoutOthers, '$'.i.'\ze\(\D\|$\)', '', '')
- endw
- endif
- let i += 1
- endw
- return [snipPos, i - 1]
-endf
-
-fun snipMate#jumpTabStop(backwards)
- let leftPlaceholder = exists('s:origWordLen')
- \ && s:origWordLen != g:snipPos[s:curPos][2]
- if leftPlaceholder && exists('s:oldEndCol')
- let startPlaceholder = s:oldEndCol + 1
- endif
-
- if exists('s:update')
- call s:UpdatePlaceholderTabStops()
- else
- call s:UpdateTabStops()
- endif
-
- " Don't reselect placeholder if it has been modified
- if leftPlaceholder && g:snipPos[s:curPos][2] != -1
- if exists('startPlaceholder')
- let g:snipPos[s:curPos][1] = startPlaceholder
- else
- let g:snipPos[s:curPos][1] = col('.')
- let g:snipPos[s:curPos][2] = 0
- endif
- endif
-
- let s:curPos += a:backwards ? -1 : 1
- " Loop over the snippet when going backwards from the beginning
- if s:curPos < 0 | let s:curPos = s:snipLen - 1 | endif
-
- if s:curPos == s:snipLen
- let sMode = s:endCol == g:snipPos[s:curPos-1][1]+g:snipPos[s:curPos-1][2]
- call s:RemoveSnippet()
- return sMode ? "\<tab>" : TriggerSnippet()
- endif
-
- call cursor(g:snipPos[s:curPos][0], g:snipPos[s:curPos][1])
-
- let s:endLine = g:snipPos[s:curPos][0]
- let s:endCol = g:snipPos[s:curPos][1]
- let s:prevLen = [line('$'), col('$')]
-
- return g:snipPos[s:curPos][2] == -1 ? '' : s:SelectWord()
-endf
-
-fun s:UpdatePlaceholderTabStops()
- let changeLen = s:origWordLen - g:snipPos[s:curPos][2]
- unl s:startCol s:origWordLen s:update
- if !exists('s:oldVars') | return | endif
- " Update tab stops in snippet if text has been added via "$#"
- " (e.g., in "${1:foo}bar$1${2}").
- if changeLen != 0
- let curLine = line('.')
-
- for pos in g:snipPos
- if pos == g:snipPos[s:curPos] | continue | endif
- let changed = pos[0] == curLine && pos[1] > s:oldEndCol
- let changedVars = 0
- let endPlaceholder = pos[2] - 1 + pos[1]
- " Subtract changeLen from each tab stop that was after any of
- " the current tab stop's placeholders.
- for [lnum, col] in s:oldVars
- if lnum > pos[0] | break | endif
- if pos[0] == lnum
- if pos[1] > col || (pos[2] == -1 && pos[1] == col)
- let changed += 1
- elseif col < endPlaceholder
- let changedVars += 1
- endif
- endif
- endfor
- let pos[1] -= changeLen * changed
- let pos[2] -= changeLen * changedVars " Parse variables within placeholders
- " e.g., "${1:foo} ${2:$1bar}"
-
- if pos[2] == -1 | continue | endif
- " Do the same to any placeholders in the other tab stops.
- for nPos in pos[3]
- let changed = nPos[0] == curLine && nPos[1] > s:oldEndCol
- for [lnum, col] in s:oldVars
- if lnum > nPos[0] | break | endif
- if nPos[0] == lnum && nPos[1] > col
- let changed += 1
- endif
- endfor
- let nPos[1] -= changeLen * changed
- endfor
- endfor
- endif
- unl s:endCol s:oldVars s:oldEndCol
-endf
-
-fun s:UpdateTabStops()
- let changeLine = s:endLine - g:snipPos[s:curPos][0]
- let changeCol = s:endCol - g:snipPos[s:curPos][1]
- if exists('s:origWordLen')
- let changeCol -= s:origWordLen
- unl s:origWordLen
- endif
- let lnum = g:snipPos[s:curPos][0]
- let col = g:snipPos[s:curPos][1]
- " Update the line number of all proceeding tab stops if <cr> has
- " been inserted.
- if changeLine != 0
- let changeLine -= 1
- for pos in g:snipPos
- if pos[0] >= lnum
- if pos[0] == lnum | let pos[1] += changeCol | endif
- let pos[0] += changeLine
- endif
- if pos[2] == -1 | continue | endif
- for nPos in pos[3]
- if nPos[0] >= lnum
- if nPos[0] == lnum | let nPos[1] += changeCol | endif
- let nPos[0] += changeLine
- endif
- endfor
- endfor
- elseif changeCol != 0
- " Update the column of all proceeding tab stops if text has
- " been inserted/deleted in the current line.
- for pos in g:snipPos
- if pos[1] >= col && pos[0] == lnum
- let pos[1] += changeCol
- endif
- if pos[2] == -1 | continue | endif
- for nPos in pos[3]
- if nPos[0] > lnum | break | endif
- if nPos[0] == lnum && nPos[1] >= col
- let nPos[1] += changeCol
- endif
- endfor
- endfor
- endif
-endf
-
-fun s:SelectWord()
- let s:origWordLen = g:snipPos[s:curPos][2]
- let s:oldWord = strpart(getline('.'), g:snipPos[s:curPos][1] - 1,
- \ s:origWordLen)
- let s:prevLen[1] -= s:origWordLen
- if !empty(g:snipPos[s:curPos][3])
- let s:update = 1
- let s:endCol = -1
- let s:startCol = g:snipPos[s:curPos][1] - 1
- endif
- if !s:origWordLen | return '' | endif
- let l = col('.') != 1 ? 'l' : ''
- if &sel == 'exclusive'
- return "\<esc>".l.'v'.s:origWordLen."l\<c-g>"
- endif
- return s:origWordLen == 1 ? "\<esc>".l.'gh'
- \ : "\<esc>".l.'v'.(s:origWordLen - 1)."l\<c-g>"
-endf
-
-" This updates the snippet as you type when text needs to be inserted
-" into multiple places (e.g. in "${1:default text}foo$1bar$1",
-" "default text" would be highlighted, and if the user types something,
-" UpdateChangedSnip() would be called so that the text after "foo" & "bar"
-" are updated accordingly)
-"
-" It also automatically quits the snippet if the cursor is moved out of it
-" while in insert mode.
-fun s:UpdateChangedSnip(entering)
- if exists('g:snipPos') && bufnr(0) != s:lastBuf
- call s:RemoveSnippet()
- elseif exists('s:update') " If modifying a placeholder
- if !exists('s:oldVars') && s:curPos + 1 < s:snipLen
- " Save the old snippet & word length before it's updated
- " s:startCol must be saved too, in case text is added
- " before the snippet (e.g. in "foo$1${2}bar${1:foo}").
- let s:oldEndCol = s:startCol
- let s:oldVars = deepcopy(g:snipPos[s:curPos][3])
- endif
- let col = col('.') - 1
-
- if s:endCol != -1
- let changeLen = col('$') - s:prevLen[1]
- let s:endCol += changeLen
- else " When being updated the first time, after leaving select mode
- if a:entering | return | endif
- let s:endCol = col - 1
- endif
-
- " If the cursor moves outside the snippet, quit it
- if line('.') != g:snipPos[s:curPos][0] || col < s:startCol ||
- \ col - 1 > s:endCol
- unl! s:startCol s:origWordLen s:oldVars s:update
- return s:RemoveSnippet()
- endif
-
- call s:UpdateVars()
- let s:prevLen[1] = col('$')
- elseif exists('g:snipPos')
- if !a:entering && g:snipPos[s:curPos][2] != -1
- let g:snipPos[s:curPos][2] = -2
- endif
-
- let col = col('.')
- let lnum = line('.')
- let changeLine = line('$') - s:prevLen[0]
-
- if lnum == s:endLine
- let s:endCol += col('$') - s:prevLen[1]
- let s:prevLen = [line('$'), col('$')]
- endif
- if changeLine != 0
- let s:endLine += changeLine
- let s:endCol = col
- endif
-
- " Delete snippet if cursor moves out of it in insert mode
- if (lnum == s:endLine && (col > s:endCol || col < g:snipPos[s:curPos][1]))
- \ || lnum > s:endLine || lnum < g:snipPos[s:curPos][0]
- call s:RemoveSnippet()
- endif
- endif
-endf
-
-" This updates the variables in a snippet when a placeholder has been edited.
-" (e.g., each "$1" in "${1:foo} $1bar $1bar")
-fun s:UpdateVars()
- let newWordLen = s:endCol - s:startCol + 1
- let newWord = strpart(getline('.'), s:startCol, newWordLen)
- if newWord == s:oldWord || empty(g:snipPos[s:curPos][3])
- return
- endif
-
- let changeLen = g:snipPos[s:curPos][2] - newWordLen
- let curLine = line('.')
- let startCol = col('.')
- let oldStartSnip = s:startCol
- let updateTabStops = changeLen != 0
- let i = 0
-
- for [lnum, col] in g:snipPos[s:curPos][3]
- if updateTabStops
- let start = s:startCol
- if lnum == curLine && col <= start
- let s:startCol -= changeLen
- let s:endCol -= changeLen
- endif
- for nPos in g:snipPos[s:curPos][3][(i):]
- " This list is in ascending order, so quit if we've gone too far.
- if nPos[0] > lnum | break | endif
- if nPos[0] == lnum && nPos[1] > col
- let nPos[1] -= changeLen
- endif
- endfor
- if lnum == curLine && col > start
- let col -= changeLen
- let g:snipPos[s:curPos][3][i][1] = col
- endif
- let i += 1
- endif
-
- " "Very nomagic" is used here to allow special characters.
- call setline(lnum, substitute(getline(lnum), '\%'.col.'c\V'.
- \ escape(s:oldWord, '\'), escape(newWord, '\&'), ''))
- endfor
- if oldStartSnip != s:startCol
- call cursor(0, startCol + s:startCol - oldStartSnip)
- endif
-
- let s:oldWord = newWord
- let g:snipPos[s:curPos][2] = newWordLen
-endf
-" vim:noet:sw=4:ts=4:ft=vim
diff --git a/vim/autoload/tcomment.vim b/vim/autoload/tcomment.vim
deleted file mode 100644
index 38b1887..0000000
--- a/vim/autoload/tcomment.vim
+++ /dev/null
@@ -1,981 +0,0 @@
-" tcomment.vim
-" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
-" @Website: http://www.vim.org/account/profile.php?user_id=4037
-" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
-" @Created: 2007-09-17.
-" @Last Change: 2011-01-20.
-" @Revision: 0.0.315
-
-" call tlog#Log('Load: '. expand('<sfile>')) " vimtlib-sfile
-
-if !exists("g:tcommentBlankLines")
- " If true, comment blank lines too
- let g:tcommentBlankLines = 1 "{{{2
-endif
-
-if !exists("g:tcommentOpModeExtra")
- " Modifies how the operator works.
- " > ... Move the cursor to the end of the comment
- let g:tcommentOpModeExtra = '' "{{{2
-endif
-
-if !exists('g:tcommentOptions')
- " Other key-value options used by |tcomment#Comment()|.
- "
- " Example: If you want to put the opening comment marker always in
- " the first column regardless of the block's indentation, put this
- " into your |vimrc| file: >
- " let g:tcommentOptions = {'col': 1}
- let g:tcommentOptions = {} "{{{2
-endif
-
-if !exists("g:tcommentGuessFileType")
- " Guess the file type based on syntax names always or for some fileformat only
- " If non-zero, try to guess filetypes.
- " tcomment also checks g:tcommentGuessFileType_{&filetype} for
- " filetype specific values.
- "
- " Values:
- " 0 ... don't guess
- " 1 ... guess
- " FILETYPE ... assume this filetype
- let g:tcommentGuessFileType = 0 "{{{2
-endif
-if !exists("g:tcommentGuessFileType_dsl")
- " For dsl documents, assumet filetype = xml.
- let g:tcommentGuessFileType_dsl = 'xml' "{{{2
-endif
-if !exists("g:tcommentGuessFileType_php")
- " In php documents, the php part is usually marked as phpRegion. We
- " thus assume that the buffers default comment style isn't php but
- " html.
- let g:tcommentGuessFileType_php = 'html' "{{{2
-endif
-if !exists("g:tcommentGuessFileType_html")
- let g:tcommentGuessFileType_html = 1 "{{{2
-endif
-if !exists("g:tcommentGuessFileType_tskeleton")
- let g:tcommentGuessFileType_tskeleton = 1 "{{{2
-endif
-if !exists("g:tcommentGuessFileType_vim")
- let g:tcommentGuessFileType_vim = 1 "{{{2
-endif
-if !exists("g:tcommentGuessFileType_django")
- let g:tcommentGuessFileType_django = 1 "{{{2
-endif
-
-if !exists("g:tcommentIgnoreTypes_php")
- " In php files, some syntax regions are wongly highlighted as sql
- " markup. We thus ignore sql syntax when guessing the filetype in
- " php files.
- let g:tcommentIgnoreTypes_php = 'sql' "{{{2
-endif
-
-if !exists('g:tcomment#syntax_substitute')
- " :read: let g:tcomment#syntax_substitute = {...} "{{{2
- " Perform replacements on the syntax name.
- let g:tcomment#syntax_substitute = {
- \ '\C^javaScript': {'sub': 'javascript'}
- \ }
-endif
-
-if !exists('g:tcommentSyntaxMap')
- " tcomment guesses filetypes based on the name of the current syntax
- " region. This works well if the syntax names match
- " /filetypeSomeName/. Other syntax names have to be explicitly
- " mapped onto the corresponding filetype.
- " :read: let g:tcommentSyntaxMap = {...} "{{{2
- let g:tcommentSyntaxMap = {
- \ 'vimMzSchemeRegion': 'scheme',
- \ 'vimPerlRegion': 'perl',
- \ 'vimPythonRegion': 'python',
- \ 'vimRubyRegion': 'ruby',
- \ 'vimTclRegion': 'tcl',
- \ }
-endif
-
-if !exists("g:tcommentBlockC")
- " Generic c-like block comments.
- " :read: let g:tcommentBlockC = {...} "{{{2
- let g:tcommentBlockC = {
- \ 'commentstring': '/*%s */',
- \ 'middle': ' * ',
- \ 'rxbeg': '\*\+',
- \ 'rxend': '\*\+',
- \ 'rxmid': '\*\+',
- \ }
-endif
-if !exists("g:tcommentBlockC2")
- " Generic c-like block comments (alternative markup).
- " :read: let g:tcommentBlockC2 = {...} "{{{2
- let g:tcommentBlockC2 = {
- \ 'commentstring': '/**%s */',
- \ 'middle': ' * ',
- \ 'rxbeg': '\*\+',
- \ 'rxend': '\*\+',
- \ 'rxmid': '\*\+',
- \ }
-endif
-if !exists("g:tcommentInlineC")
- " Generic c-like comments.
- let g:tcommentInlineC = "/* %s */" "{{{2
-endif
-
-if !exists("g:tcommentBlockXML")
- " Generic xml-like block comments.
- let g:tcommentBlockXML = "<!--%s-->\n " "{{{2
-endif
-if !exists("g:tcommentInlineXML")
- " Generic xml-like comments.
- let g:tcommentInlineXML = "<!-- %s -->" "{{{2
-endif
-
-let s:typesDirty = 1
-
-let s:definitions = {}
-
-" If you don't explicitly define a comment style, |:TComment| will use
-" 'commentstring' instead. We override the default values here in order
-" to have a blank after the comment marker. Block comments work only if
-" we explicitly define the markup.
-"
-" The comment definition can be either a string or a dictionary.
-"
-" If it is a string:
-" The format for block comments is similar to 'commentstrings' with the
-" exception that the format strings for blocks can contain a second line
-" that defines how "middle lines" (see :h format-comments) should be
-" displayed.
-"
-" If it is a dictionary:
-" See the help on the args argument of |tcomment#Comment|.
-function! tcomment#DefineType(name, commentdef)
- if !has_key(s:definitions, a:name)
- if type(a:commentdef) == 4
- let cdef = copy(a:commentdef)
- else
- let cdef = a:0 >= 1 ? a:1 : {}
- let cdef.commentstring = a:commentdef
- endif
- let s:definitions[a:name] = cdef
- endif
- let s:typesDirty = 1
-endf
-
-" :nodoc:
-" Return 1 if a comment type is defined.
-function! tcomment#TypeExists(name)
- return has_key(s:definitions, a:name)
-endf
-
-call tcomment#DefineType('aap', '# %s' )
-call tcomment#DefineType('ada', '-- %s' )
-call tcomment#DefineType('apache', '# %s' )
-call tcomment#DefineType('autoit', '; %s' )
-call tcomment#DefineType('asm', '; %s' )
-call tcomment#DefineType('awk', '# %s' )
-call tcomment#DefineType('catalog', '-- %s --' )
-call tcomment#DefineType('catalog_block', "--%s--\n " )
-call tcomment#DefineType('cpp', '// %s' )
-call tcomment#DefineType('cpp_inline', g:tcommentInlineC )
-call tcomment#DefineType('cpp_block', g:tcommentBlockC )
-call tcomment#DefineType('css', '/* %s */' )
-call tcomment#DefineType('css_inline', g:tcommentInlineC )
-call tcomment#DefineType('css_block', g:tcommentBlockC )
-call tcomment#DefineType('c', '/* %s */' )
-call tcomment#DefineType('c_inline', g:tcommentInlineC )
-call tcomment#DefineType('c_block', g:tcommentBlockC )
-call tcomment#DefineType('cfg', '# %s' )
-call tcomment#DefineType('conf', '# %s' )
-call tcomment#DefineType('crontab', '# %s' )
-call tcomment#DefineType('cs', '// %s' )
-call tcomment#DefineType('cs_inline', g:tcommentInlineC )
-call tcomment#DefineType('cs_block', g:tcommentBlockC )
-call tcomment#DefineType('desktop', '# %s' )
-call tcomment#DefineType('django', '{# %s #}' )
-call tcomment#DefineType('django_block', "{%% comment %%}%s{%% endcomment %%}\n ")
-call tcomment#DefineType('docbk', '<!-- %s -->' )
-call tcomment#DefineType('docbk_inline', g:tcommentInlineXML)
-call tcomment#DefineType('docbk_block', g:tcommentBlockXML )
-call tcomment#DefineType('dosbatch', 'rem %s' )
-call tcomment#DefineType('dosini', '; %s' )
-call tcomment#DefineType('dsl', '; %s' )
-call tcomment#DefineType('dylan', '// %s' )
-call tcomment#DefineType('eiffel', '-- %s' )
-call tcomment#DefineType('erlang', '%%%% %s' )
-call tcomment#DefineType('eruby', '<%%# %s' )
-call tcomment#DefineType('fstab', '# %s' )
-call tcomment#DefineType('gitcommit', '# %s' )
-call tcomment#DefineType('gtkrc', '# %s' )
-call tcomment#DefineType('go', '// %s' )
-call tcomment#DefineType('go_inline', g:tcommentInlineC )
-call tcomment#DefineType('go_block', g:tcommentBlockC )
-call tcomment#DefineType('groovy', '// %s' )
-call tcomment#DefineType('groovy_inline', g:tcommentInlineC )
-call tcomment#DefineType('groovy_block', g:tcommentBlockC )
-call tcomment#DefineType('groovy_doc_block', g:tcommentBlockC2 )
-call tcomment#DefineType('haskell', '-- %s' )
-call tcomment#DefineType('haskell_block', "{-%s-}\n " )
-call tcomment#DefineType('haskell_inline', '{- %s -}' )
-call tcomment#DefineType('html', '<!-- %s -->' )
-call tcomment#DefineType('html_inline', g:tcommentInlineXML)
-call tcomment#DefineType('html_block', g:tcommentBlockXML )
-call tcomment#DefineType('io', '// %s' )
-call tcomment#DefineType('javaScript', '// %s' )
-call tcomment#DefineType('javaScript_inline', g:tcommentInlineC )
-call tcomment#DefineType('javaScript_block', g:tcommentBlockC )
-call tcomment#DefineType('javascript', '// %s' )
-call tcomment#DefineType('javascript_inline', g:tcommentInlineC )
-call tcomment#DefineType('javascript_block', g:tcommentBlockC )
-call tcomment#DefineType('java', '/* %s */' )
-call tcomment#DefineType('java_inline', g:tcommentInlineC )
-call tcomment#DefineType('java_block', g:tcommentBlockC )
-call tcomment#DefineType('java_doc_block', g:tcommentBlockC2 )
-call tcomment#DefineType('jproperties', '# %s' )
-call tcomment#DefineType('lisp', '; %s' )
-call tcomment#DefineType('lynx', '# %s' )
-call tcomment#DefineType('matlab', '%% %s' )
-call tcomment#DefineType('m4', 'dnl %s' )
-call tcomment#DefineType('mail', '> %s' )
-call tcomment#DefineType('msidl', '// %s' )
-call tcomment#DefineType('msidl_block', g:tcommentBlockC )
-call tcomment#DefineType('nroff', '.\\" %s' )
-call tcomment#DefineType('nsis', '# %s' )
-call tcomment#DefineType('objc', '/* %s */' )
-call tcomment#DefineType('objc_inline', g:tcommentInlineC )
-call tcomment#DefineType('objc_block', g:tcommentBlockC )
-call tcomment#DefineType('ocaml', '(* %s *)' )
-call tcomment#DefineType('ocaml_inline', '(* %s *)' )
-call tcomment#DefineType('ocaml_block', "(*%s*)\n " )
-call tcomment#DefineType('pascal', '(* %s *)' )
-call tcomment#DefineType('pascal_inline', '(* %s *)' )
-call tcomment#DefineType('pascal_block', "(*%s*)\n " )
-call tcomment#DefineType('perl', '# %s' )
-call tcomment#DefineType('perl_block', "=cut%s=cut" )
-call tcomment#DefineType('php', '// %s' )
-call tcomment#DefineType('php_inline', g:tcommentInlineC )
-call tcomment#DefineType('php_block', g:tcommentBlockC )
-call tcomment#DefineType('php_2_block', g:tcommentBlockC2 )
-call tcomment#DefineType('po', '# %s' )
-call tcomment#DefineType('prolog', '%% %s' )
-call tcomment#DefineType('rc', '// %s' )
-call tcomment#DefineType('readline', '# %s' )
-call tcomment#DefineType('ruby', '# %s' )
-call tcomment#DefineType('ruby_3', '### %s' )
-call tcomment#DefineType('ruby_block', "=begin rdoc%s=end")
-call tcomment#DefineType('ruby_nodoc_block', "=begin%s=end" )
-call tcomment#DefineType('r', '# %s' )
-call tcomment#DefineType('sbs', "' %s" )
-call tcomment#DefineType('scheme', '; %s' )
-call tcomment#DefineType('sed', '# %s' )
-call tcomment#DefineType('sgml', '<!-- %s -->' )
-call tcomment#DefineType('sgml_inline', g:tcommentInlineXML)
-call tcomment#DefineType('sgml_block', g:tcommentBlockXML )
-call tcomment#DefineType('sh', '# %s' )
-call tcomment#DefineType('sql', '-- %s' )
-call tcomment#DefineType('spec', '# %s' )
-call tcomment#DefineType('sps', '* %s.' )
-call tcomment#DefineType('sps_block', "* %s." )
-call tcomment#DefineType('spss', '* %s.' )
-call tcomment#DefineType('spss_block', "* %s." )
-call tcomment#DefineType('tcl', '# %s' )
-call tcomment#DefineType('tex', '%% %s' )
-call tcomment#DefineType('tpl', '<!-- %s -->' )
-call tcomment#DefineType('viki', '%% %s' )
-call tcomment#DefineType('viki_3', '%%%%%% %s' )
-call tcomment#DefineType('viki_inline', '{cmt: %s}' )
-call tcomment#DefineType('vim', '" %s' )
-call tcomment#DefineType('vim_3', '""" %s' )
-call tcomment#DefineType('websec', '# %s' )
-call tcomment#DefineType('x86conf', '# %s' )
-call tcomment#DefineType('xml', '<!-- %s -->' )
-call tcomment#DefineType('xml_inline', g:tcommentInlineXML)
-call tcomment#DefineType('xml_block', g:tcommentBlockXML )
-call tcomment#DefineType('xs', '// %s' )
-call tcomment#DefineType('xs_block', g:tcommentBlockC )
-call tcomment#DefineType('xslt', '<!-- %s -->' )
-call tcomment#DefineType('xslt_inline', g:tcommentInlineXML)
-call tcomment#DefineType('xslt_block', g:tcommentBlockXML )
-call tcomment#DefineType('yaml', '# %s' )
-
-
-function! s:DefaultValue(option)
- exec 'let '. a:option .' = &'. a:option
- exec 'set '. a:option .'&'
- exec 'let default = &'. a:option
- exec 'let &'. a:option .' = '. a:option
- return default
-endf
-
-let s:defaultComments = s:DefaultValue('comments')
-let s:defaultCommentString = s:DefaultValue('commentstring')
-let s:nullCommentString = '%s'
-
-" tcomment#Comment(line1, line2, ?commentMode, ?commentAnyway, ?args...)
-" args... are either:
-" 1. a list of key=value pairs where known keys are (see also
-" |g:tcommentOptions|):
-" as=STRING ... Use a specific comment definition
-" col=N ... Start the comment at column N (in block mode; must
-" be smaller than |indent()|)
-" mode=STRING ... See the notes below on the "commentMode" argument
-" begin=STRING ... Comment prefix
-" end=STRING ... Comment postfix
-" middle=STRING ... Middle line comments in block mode
-" rxbeg=N ... Regexp to find the substring of "begin" that
-" should be multipied by "count"
-" rxend=N ... The above for "end"
-" rxmid=N ... The above for "middle"
-" 2. 1-2 values for: ?commentPrefix, ?commentPostfix
-" 3. a dictionary (internal use only)
-"
-" commentMode:
-" G ... guess the value of commentMode
-" B ... block (use extra lines for the comment markers)
-" i ... maybe inline, guess
-" I ... inline
-" R ... right (comment the line right of the cursor)
-" v ... visual
-" o ... operator
-" By default, each line in range will be commented by adding the comment
-" prefix and postfix.
-function! tcomment#Comment(beg, end, ...)
- let commentMode = a:0 >= 1 ? a:1 : 'G'
- let commentAnyway = a:0 >= 2 ? (a:2 == '!') : 0
- " TLogVAR a:beg, a:end, a:1, commentMode, commentAnyway
- " save the cursor position
- let pos = getpos('.')
- let s:pos_end = getpos("'>")
- if commentMode =~# 'i'
- let commentMode = substitute(commentMode, '\Ci', line("'<") == line("'>") ? 'I' : 'G', 'g')
- endif
- let [cstart, cend] = s:GetStartEnd(commentMode)
- " TLogVAR commentMode, cstart, cend
- " get the correct commentstring
- let cdef = copy(g:tcommentOptions)
- if a:0 >= 3 && type(a:3) == 4
- call extend(cdef, a:3)
- else
- call extend(cdef, s:GetCommentDefinition(a:beg, a:end, commentMode))
- let ax = 3
- if a:0 >= 3 && a:3 != '' && stridx(a:3, '=') == -1
- let ax = 4
- let cdef.begin = a:3
- if a:0 >= 4 && a:4 != '' && stridx(a:4, '=') == -1
- let ax = 5
- let cdef.end = a:4
- endif
- endif
- if a:0 >= ax
- call extend(cdef, s:ParseArgs(a:beg, a:end, commentMode, a:000[ax - 1 : -1]))
- endif
- if !empty(get(cdef, 'begin', '')) || !empty(get(cdef, 'end', ''))
- let cdef.commentstring = s:EncodeCommentPart(get(cdef, 'begin', ''))
- \ . '%s'
- \ . s:EncodeCommentPart(get(cdef, 'end', ''))
- endif
- let commentMode = cdef.mode
- endif
- if !empty(filter(['count', 'cbeg', 'cend', 'cmid'], 'has_key(cdef, v:val)'))
- call s:RepeatCommentstring(cdef)
- endif
- " echom "DBG" string(cdef) string(a:000)
- let cms0 = s:BlockGetCommentString(cdef)
- let cms0 = escape(cms0, '\')
- " make whitespace optional; this conflicts with comments that require some
- " whitespace
- let cmtCheck = substitute(cms0, '\([ ]\)', '\1\\?', 'g')
- " turn commentstring into a search pattern
- let cmtCheck = printf(cmtCheck, '\(\_.\{-}\)')
- " set commentMode and indentStr
- let [indentStr, uncomment] = s:CommentDef(a:beg, a:end, cmtCheck, commentMode, cstart, cend)
- " TLogVAR indentStr, uncomment
- let col = get(cdef, 'col', -1)
- if col >= 0
- let col -= 1
- let indent = len(indentStr)
- if col > indent
- let cms0 = repeat(' ', col - indent) . cms0
- else
- let indentStr = repeat(' ', col)
- endif
- endif
- if commentAnyway
- let uncomment = 0
- endif
- " go
- if commentMode =~# 'B'
- " We want a comment block
- call s:CommentBlock(a:beg, a:end, uncomment, cmtCheck, cdef, indentStr)
- else
- " call s:CommentLines(a:beg, a:end, cstart, cend, uncomment, cmtCheck, cms0, indentStr)
- " We want commented lines
- " final search pattern for uncommenting
- let cmtCheck = escape('\V\^\(\s\{-}\)'. cmtCheck .'\$', '"/\')
- " final pattern for commenting
- let cmtReplace = escape(cms0, '"/')
- silent exec a:beg .','. a:end .'s/\V'.
- \ s:StartRx(cstart) . indentStr .'\zs\(\.\{-}\)'. s:EndRx(cend) .'/'.
- \ '\=s:ProcessedLine('. uncomment .', submatch(0), "'. cmtCheck .'", "'. cmtReplace .'")/ge'
- endif
- " reposition cursor
- " TLogVAR commentMode
- if commentMode =~ '>'
- call setpos('.', s:pos_end)
- else
- " TLogVAR pos
- call setpos('.', pos)
- endif
-endf
-
-
-function! s:GetStartEnd(commentMode) "{{{3
- let commentMode = a:commentMode
- if commentMode =~# 'R' || commentMode =~# 'I'
- let cstart = col("'<")
- if cstart == 0
- let cstart = col('.')
- endif
- if commentMode =~# 'R'
- let commentMode = substitute(commentMode, '\CR', 'G', 'g')
- let cend = 0
- else
- let cend = col("'>")
- if commentMode =~# 'o'
- let cend += 1
- endif
- endif
- else
- let cstart = 0
- let cend = 0
- endif
- return [cstart, cend]
-endf
-
-
-function! s:RepeatCommentstring(cdef) "{{{3
- " TLogVAR a:cdef
- let cms = s:BlockGetCommentString(a:cdef)
- let mid = s:BlockGetMiddleString(a:cdef)
- let cms_fbeg = match(cms, '\s*%\@<!%s')
- let cms_fend = matchend(cms, '%\@<!%s\s*')
- let rxbeg = get(a:cdef, 'rxbeg', '^.*$')
- let rxend = get(a:cdef, 'rxend', '^.*$')
- let rpbeg = repeat('&', get(a:cdef, 'cbeg', get(a:cdef, 'count', 1)))
- let rpend = repeat('&', get(a:cdef, 'cend', get(a:cdef, 'count', 1)))
- let a:cdef.commentstring = substitute(cms[0 : cms_fbeg - 1], rxbeg, rpbeg, '')
- \. cms[cms_fbeg : cms_fend - 1]
- \. substitute(cms[cms_fend : -1], rxend, rpend, '')
- " TLogVAR cms, a:cdef.commentstring
- if !empty(mid)
- let rxmid = get(a:cdef, 'rxmid', '^.*$')
- let rpmid = repeat('&', get(a:cdef, 'cmid', get(a:cdef, 'count', 1)))
- let a:cdef.middle = substitute(mid, rxmid, rpmid, '')
- " TLogVAR mid, a:cdef.middle
- endif
- return a:cdef
-endf
-
-
-function! s:ParseArgs(beg, end, commentMode, arglist) "{{{3
- let args = {}
- for arg in a:arglist
- let key = matchstr(arg, '^[^=]\+')
- let value = matchstr(arg, '=\zs.*$')
- if key == 'as'
- call extend(args, s:GetCommentDefinitionForType(a:beg, a:end, a:commentMode, value))
- else
- let args[key] = value
- endif
- endfor
- return args
-endf
-
-
-function! tcomment#Operator(type, ...) "{{{3
- let commentMode = a:0 >= 1 ? a:1 : ''
- let bang = a:0 >= 2 ? a:2 : ''
- if !exists('w:tcommentPos')
- let w:tcommentPos = getpos(".")
- endif
- let sel_save = &selection
- let &selection = "inclusive"
- let reg_save = @@
- " let pos = getpos('.')
- " TLogVAR a:type
- try
- if a:type == 'line'
- silent exe "normal! '[V']"
- let commentMode1 = 'G'
- elseif a:type == 'block'
- silent exe "normal! `[\<C-V>`]"
- let commentMode1 = 'I'
- else
- silent exe "normal! `[v`]"
- let commentMode1 = 'i'
- endif
- if empty(commentMode)
- let commentMode = commentMode1
- endif
- let beg = line("'[")
- let end = line("']")
- norm! 
- let commentMode .= g:tcommentOpModeExtra
- call tcomment#Comment(beg, end, commentMode.'o', bang)
- finally
- let &selection = sel_save
- let @@ = reg_save
- if g:tcommentOpModeExtra !~ '>'
- " TLogVAR pos
- " call setpos('.', pos)
- if exists('w:tcommentPos')
- call setpos('.', w:tcommentPos)
- unlet! w:tcommentPos
- else
- echohl WarningMsg
- echom "TComment: w:tcommentPos wasn't set. Please report this to the plugin author"
- echohl NONE
- endif
- endif
- endtry
-endf
-
-
-function! tcomment#OperatorLine(type) "{{{3
- call tcomment#Operator(a:type, 'G')
-endf
-
-
-function! tcomment#OperatorAnyway(type) "{{{3
- call tcomment#Operator(a:type, '', '!')
-endf
-
-
-function! tcomment#OperatorLineAnyway(type) "{{{3
- call tcomment#Operator(a:type, 'G', '!')
-endf
-
-
-" :display: tcomment#CommentAs(beg, end, commentAnyway, filetype, ?args...)
-" Where args is either:
-" 1. A count NUMBER
-" 2. An args list (see the notes on the "args" argument of
-" |tcomment#Comment()|)
-" comment text as if it were of a specific filetype
-function! tcomment#CommentAs(beg, end, commentAnyway, filetype, ...)
- if a:filetype =~ '_block$'
- let commentMode = 'B'
- let ft = substitute(a:filetype, '_block$', '', '')
- elseif a:filetype =~ '_inline$'
- let commentMode = 'I'
- let ft = substitute(a:filetype, '_inline$', '', '')
- else
- let commentMode = 'G'
- let ft = a:filetype
- endif
- if a:0 >= 1
- if type(a:1) == 0
- let cdef = {'count': a:0 >= 1 ? a:1 : 1}
- else
- let cdef = s:ParseArgs(a:beg, a:end, commentMode, a:000)
- endif
- else
- let cdef = {}
- endif
- " echom "DBG" string(cdef)
- call extend(cdef, s:GetCommentDefinitionForType(a:beg, a:end, commentMode, ft))
- keepjumps call tcomment#Comment(a:beg, a:end, commentMode, a:commentAnyway, cdef)
-endf
-
-
-" collect all known comment types
-" :nodoc:
-function! tcomment#CollectFileTypes()
- if s:typesDirty
- let s:types = keys(s:definitions)
- let s:typesRx = '\V\^\('. join(s:types, '\|') .'\)\(\u\.\*\)\?\$'
- let s:typesDirty = 0
- endif
-endf
-
-call tcomment#CollectFileTypes()
-
-
-" return a list of filetypes for which a tcomment_{&ft} is defined
-" :nodoc:
-function! tcomment#Complete(ArgLead, CmdLine, CursorPos) "{{{3
- call tcomment#CollectFileTypes()
- let completions = copy(s:types)
- let filetype = s:Filetype()
- if index(completions, filetype) != -1
- " TLogVAR filetype
- call insert(completions, filetype)
- endif
- if !empty(a:ArgLead)
- call filter(completions, 'v:val =~ ''\V\^''.a:ArgLead')
- endif
- let completions += tcomment#CompleteArgs(a:ArgLead, a:CmdLine, a:CursorPos)
- return completions
-endf
-
-
-" :nodoc:
-function! tcomment#CompleteArgs(ArgLead, CmdLine, CursorPos) "{{{3
- let completions = ['as=', 'col=', 'count=', 'mode=', 'begin=', 'end=']
- if !empty(a:ArgLead)
- if a:ArgLead =~ '^as='
- call tcomment#CollectFileTypes()
- let completions += map(copy(s:types), '"as=". v:val')
- endif
- call filter(completions, 'v:val =~ ''\V\^''.a:ArgLead')
- endif
- return completions
-endf
-
-
-function! s:EncodeCommentPart(string)
- return substitute(a:string, '%', '%%', 'g')
-endf
-
-
-function! s:GetCommentDefinitionForType(beg, end, commentMode, filetype) "{{{3
- let cdef = s:GetCommentDefinition(a:beg, a:end, a:commentMode, a:filetype)
- let cms = cdef.commentstring
- let commentMode = cdef.mode
- let pre = substitute(cms, '%s.*$', '', '')
- let pre = substitute(pre, '%%', '%', 'g')
- let post = substitute(cms, '^.\{-}%s', '', '')
- let post = substitute(post, '%%', '%', 'g')
- let cdef.begin = pre
- let cdef.end = post
- return cdef
-endf
-
-
-" s:GetCommentDefinition(beg, end, commentMode, ?filetype="")
-function! s:GetCommentDefinition(beg, end, commentMode, ...)
- let ft = a:0 >= 1 ? a:1 : ''
- if ft != ''
- let cdef = s:GetCustomCommentString(ft, a:commentMode)
- else
- let cdef = {'mode': a:commentMode}
- endif
- let cms = get(cdef, 'commentstring', '')
- if empty(cms)
- let filetype = s:Filetype()
- if exists('b:commentstring')
- let cms = b:commentstring
- return s:GetCustomCommentString(filetype, a:commentMode, cms)
- elseif exists('b:commentStart') && b:commentStart != ''
- let cms = s:EncodeCommentPart(b:commentStart) .' %s'
- if exists('b:commentEnd') && b:commentEnd != ''
- let cms = cms .' '. s:EncodeCommentPart(b:commentEnd)
- endif
- return s:GetCustomCommentString(filetype, a:commentMode, cms)
- elseif g:tcommentGuessFileType || (exists('g:tcommentGuessFileType_'. filetype)
- \ && g:tcommentGuessFileType_{filetype} =~ '[^0]')
- if g:tcommentGuessFileType_{filetype} == 1
- let altFiletype = ''
- else
- let altFiletype = g:tcommentGuessFileType_{filetype}
- endif
- return s:GuessFileType(a:beg, a:end, a:commentMode, filetype, altFiletype)
- else
- return s:GetCustomCommentString(filetype, a:commentMode, s:GuessCurrentCommentString(a:commentMode))
- endif
- let cdef.commentstring = cms
- endif
- return cdef
-endf
-
-function! s:StartRx(pos)
- if a:pos == 0
- return '\^'
- else
- return '\%'. a:pos .'c'
- endif
-endf
-
-function! s:EndRx(pos)
- if a:pos == 0
- return '\$'
- else
- return '\%'. a:pos .'c'
- endif
-endf
-
-function! s:GetIndentString(line, start)
- let start = a:start > 0 ? a:start - 1 : 0
- return substitute(strpart(getline(a:line), start), '\V\^\s\*\zs\.\*\$', '', '')
-endf
-
-function! s:CommentDef(beg, end, checkRx, commentMode, cstart, cend)
- let mdrx = '\V'. s:StartRx(a:cstart) .'\s\*'. a:checkRx .'\s\*'. s:EndRx(0)
- let line = getline(a:beg)
- if a:cstart != 0 && a:cend != 0
- let line = strpart(line, 0, a:cend - 1)
- endif
- let uncomment = (line =~ mdrx)
- let indentStr = s:GetIndentString(a:beg, a:cstart)
- let il = indent(a:beg)
- let n = a:beg + 1
- while n <= a:end
- if getline(n) =~ '\S'
- let jl = indent(n)
- if jl < il
- let indentStr = s:GetIndentString(n, a:cstart)
- let il = jl
- endif
- if a:commentMode =~# 'G'
- if !(getline(n) =~ mdrx)
- let uncomment = 0
- endif
- endif
- endif
- let n = n + 1
- endwh
- if a:commentMode =~# 'B'
- let t = @t
- try
- silent exec 'norm! '. a:beg.'G1|v'.a:end.'G$"ty'
- let uncomment = (@t =~ mdrx)
- finally
- let @t = t
- endtry
- endif
- return [indentStr, uncomment]
-endf
-
-function! s:ProcessedLine(uncomment, match, checkRx, replace)
- " TLogVAR a:uncomment, a:match, a:checkRx, a:replace
- if !(a:match =~ '\S' || g:tcommentBlankLines)
- return a:match
- endif
- let ml = len(a:match)
- if a:uncomment
- let rv = substitute(a:match, a:checkRx, '\1\2', '')
- else
- let rv = printf(a:replace, a:match)
- endif
- " TLogVAR rv
- " let md = len(rv) - ml
- let s:pos_end = getpos('.')
- let s:pos_end[2] += len(rv)
- " TLogVAR pe, md, a:match
- if v:version > 702 || (v:version == 702 && has('patch407'))
- let rv = escape(rv, ' ')
- else
- let rv = escape(rv, '\ ')
- endif
- let rv = substitute(rv, '\n', '\\\n', 'g')
- return rv
-endf
-
-function! s:CommentLines(beg, end, cstart, cend, uncomment, cmtCheck, cms0, indentStr) "{{{3
- " We want commented lines
- " final search pattern for uncommenting
- let cmtCheck = escape('\V\^\(\s\{-}\)'. a:cmtCheck .'\$', '"/\')
- " final pattern for commenting
- let cmtReplace = escape(a:cms0, '"/')
- silent exec a:beg .','. a:end .'s/\V'.
- \ s:StartRx(a:cstart) . a:indentStr .'\zs\(\.\{-}\)'. s:EndRx(a:cend) .'/'.
- \ '\=s:ProcessedLine('. a:uncomment .', submatch(0), "'. a:cmtCheck .'", "'. cmtReplace .'")/ge'
-endf
-
-function! s:CommentBlock(beg, end, uncomment, checkRx, cdef, indentStr)
- let t = @t
- try
- silent exec 'norm! '. a:beg.'G1|v'.a:end.'G$"td'
- let ms = s:BlockGetMiddleString(a:cdef)
- let mx = escape(ms, '\')
- if a:uncomment
- let @t = substitute(@t, '\V\^\s\*'. a:checkRx .'\$', '\1', '')
- if ms != ''
- let @t = substitute(@t, '\V\n'. a:indentStr . mx, '\n'. a:indentStr, 'g')
- endif
- let @t = substitute(@t, '^\n', '', '')
- let @t = substitute(@t, '\n\s*$', '', '')
- else
- let cs = s:BlockGetCommentString(a:cdef)
- let cs = a:indentStr . substitute(cs, '%s', '%s'. a:indentStr, '')
- if ms != ''
- let ms = a:indentStr . ms
- let mx = a:indentStr . mx
- let @t = substitute(@t, '^'. a:indentStr, '', 'g')
- let @t = ms . substitute(@t, '\n'. a:indentStr, '\n'. mx, 'g')
- endif
- let @t = printf(cs, "\n". @t ."\n")
- endif
- silent norm! "tP
- finally
- let @t = t
- endtry
-endf
-
-
-function! s:Filetype(...) "{{{3
- let ft = a:0 >= 1 ? a:1 : &filetype
- let ft = substitute(ft, '\..*$', '', '')
- return ft
-endf
-
-
-" inspired by Meikel Brandmeyer's EnhancedCommentify.vim
-" this requires that a syntax names are prefixed by the filetype name
-" s:GuessFileType(beg, end, commentMode, filetype, ?fallbackFiletype)
-function! s:GuessFileType(beg, end, commentMode, filetype, ...)
- if a:0 >= 1 && a:1 != ''
- let cdef = s:GetCustomCommentString(a:1, a:commentMode)
- if empty(get(cdef, 'commentstring', ''))
- let cdef.commentstring = s:GuessCurrentCommentString(a:commentMode)
- endif
- else
- let cdef = {'commentstring': s:GuessCurrentCommentString(0), 'mode': s:CommentMode(a:commentMode, 'G')}
- endif
- let n = a:beg
- " TLogVAR n, a:beg, a:end
- while n <= a:end
- let m = indent(n) + 1
- let le = len(getline(n))
- " TLogVAR m, le
- while m < le
- let syntaxName = s:GetSyntaxName(n, m)
- " TLogVAR syntaxName, n, m
- let ftypeMap = get(g:tcommentSyntaxMap, syntaxName)
- if !empty(ftypeMap)
- " TLogVAR ftypeMap
- return s:GetCustomCommentString(ftypeMap, a:commentMode, cdef.commentstring)
- elseif syntaxName =~ s:typesRx
- let ft = substitute(syntaxName, s:typesRx, '\1', '')
- " TLogVAR ft
- if exists('g:tcommentIgnoreTypes_'. a:filetype) && g:tcommentIgnoreTypes_{a:filetype} =~ '\<'.ft.'\>'
- let m += 1
- else
- return s:GetCustomCommentString(ft, a:commentMode, cdef.commentstring)
- endif
- elseif syntaxName == '' || syntaxName == 'None' || syntaxName =~ '^\u\+$' || syntaxName =~ '^\u\U*$'
- let m += 1
- else
- break
- endif
- endwh
- let n += 1
- endwh
- return cdef
-endf
-
-
-function! s:GetSyntaxName(lnum, col) "{{{3
- let syntaxName = synIDattr(synID(a:lnum, a:col, 1), 'name')
- if !empty(g:tcomment#syntax_substitute)
- for [rx, subdef] in items(g:tcomment#syntax_substitute)
- if !has_key(subdef, 'if') || eval(subdef.if)
- let syntaxName = substitute(syntaxName, rx, subdef.sub, 'g')
- endif
- endfor
- endif
- " TLogVAR syntaxName
- return syntaxName
-endf
-
-
-function! s:CommentMode(commentMode, newmode) "{{{3
- return substitute(a:commentMode, '\w\+', a:newmode, 'g')
-endf
-
-function! s:GuessCurrentCommentString(commentMode)
- let valid_cms = (stridx(&commentstring, '%s') != -1)
- if &commentstring != s:defaultCommentString && valid_cms
- " The &commentstring appears to have been set and to be valid
- return &commentstring
- endif
- if &comments != s:defaultComments
- " the commentstring is the default one, so we assume that it wasn't
- " explicitly set; we then try to reconstruct &cms from &comments
- let cms = s:ConstructFromComments(a:commentMode)
- if cms != s:nullCommentString
- return cms
- endif
- endif
- if valid_cms
- " Before &commentstring appeared not to be set. As we don't know
- " better we return it anyway if it is valid
- return &commentstring
- else
- " &commentstring is invalid. So we return the identity string.
- return s:nullCommentString
- endif
-endf
-
-function! s:ConstructFromComments(commentMode)
- exec s:ExtractCommentsPart('')
- if a:commentMode =~# 'G' && line != ''
- return line .' %s'
- endif
- exec s:ExtractCommentsPart('s')
- if s != ''
- exec s:ExtractCommentsPart('e')
- return s.' %s '.e
- endif
- if line != ''
- return line .' %s'
- else
- return s:nullCommentString
- endif
-endf
-
-function! s:ExtractCommentsPart(key)
- " let key = a:key != "" ? a:key .'[^:]*' : ""
- let key = a:key . '[bnflrxO0-9-]*'
- let val = substitute(&comments, '^\(.\{-},\)\{-}'. key .':\([^,]\+\).*$', '\2', '')
- if val == &comments
- let val = ''
- else
- let val = substitute(val, '%', '%%', 'g')
- endif
- let var = a:key == '' ? 'line' : a:key
- return 'let '. var .'="'. escape(val, '"') .'"'
-endf
-
-" s:GetCustomCommentString(ft, commentMode, ?default="")
-function! s:GetCustomCommentString(ft, commentMode, ...)
- let commentMode = a:commentMode
- let customComment = tcomment#TypeExists(a:ft)
- if commentMode =~# 'B' && tcomment#TypeExists(a:ft .'_block')
- let def = s:definitions[a:ft .'_block']
- elseif commentMode =~? 'I' && tcomment#TypeExists(a:ft .'_inline')
- let def = s:definitions[a:ft .'_inline']
- elseif customComment
- let def = s:definitions[a:ft]
- let commentMode = s:CommentMode(commentMode, 'G')
- elseif a:0 >= 1
- let def = {'commentstring': a:1}
- let commentMode = s:CommentMode(commentMode, 'G')
- else
- let def = {}
- let commentMode = s:CommentMode(commentMode, 'G')
- endif
- let cdef = copy(def)
- let cdef.mode = commentMode
- return cdef
-endf
-
-function! s:BlockGetCommentString(cdef)
- if has_key(a:cdef, 'middle')
- return a:cdef.commentstring
- else
- return matchstr(a:cdef.commentstring, '^.\{-}\ze\(\n\|$\)')
- endif
-endf
-
-function! s:BlockGetMiddleString(cdef)
- if has_key(a:cdef, 'middle')
- return a:cdef.middle
- else
- return matchstr(a:cdef.commentstring, '\n\zs.*')
- endif
-endf
-
-
-redraw
-
diff --git a/vim/autoload/zencoding.vim b/vim/autoload/zencoding.vim
deleted file mode 100644
index cfd7d95..0000000
--- a/vim/autoload/zencoding.vim
+++ /dev/null
@@ -1,2069 +0,0 @@
-"=============================================================================
-" zencoding.vim
-" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
-" Last Change: 24-Feb-2011.
-
-let s:save_cpo = &cpo
-set cpo&vim
-
-function! s:zen_getExpandos(type, key)
- let expandos = s:zen_getResource(a:type, 'expandos', {})
- if has_key(expandos, a:key)
- return expandos[a:key]
- endif
- return a:key
-endfunction
-
-function! s:zen_useFilter(filters, filter)
- for f in a:filters
- if f == a:filter
- return 1
- endif
- endfor
- return 0
-endfunction
-
-function! s:zen_isExtends(type, extend)
- if a:type == a:extend
- return 1
- endif
- if !has_key(s:zen_settings, a:type)
- return 0
- endif
- if !has_key(s:zen_settings[a:type], 'extends')
- return 0
- endif
- let extends = s:zen_settings[a:type].extends
- if type(extends) == 1
- let tmp = split(extends, '\s*,\s*')
- unlet! extends
- let extends = tmp
- endif
- for ext in extends
- if a:extend == ext
- return 1
- endif
- endfor
- return 0
-endfunction
-
-function! s:zen_parseIntoTree(abbr, type)
- let abbr = a:abbr
- let type = a:type
- if !has_key(s:zen_settings, type)
- let type = 'html'
- endif
- if len(type) == 0 | let type = 'html' | endif
-
- if has_key(s:zen_settings[type], 'indentation')
- let indent = s:zen_settings[type].indentation
- else
- let indent = s:zen_settings.indentation
- endif
-
- if s:zen_isExtends(type, "html")
- let abbr = substitute(abbr, '\([a-zA-Z][a-zA-Z0-9]*\)+\([()]\|$\)', '\="(".s:zen_getExpandos(type, submatch(1)).")".submatch(2)', 'i')
- let mx = '\([+>]\|<\+\)\{-}\s*\((*\)\{-}\s*\([@#.]\{-}[a-zA-Z\!][a-zA-Z0-9:\!\-]*\|{[^}]\+}\)\(\%(\%(#{[{}a-zA-Z0-9_\-\$]\+\|#[a-zA-Z0-9_\-\$]\+\)\|\%(\[[^\]]\+\]\)\|\%(\.{[{}a-zA-Z0-9_\-\$]\+\|\.[a-zA-Z0-9_\-\$]\+\)\)*\)\%(\({[^}]\+}\)\)\{0,1}\%(\s*\*\s*\([0-9]\+\)\s*\)\{0,1}\(\%(\s*)\%(\s*\*\s*[0-9]\+\s*\)\{0,1}\)*\)'
- else
- let mx = '\([+>]\|<\+\)\{-}\s*\((*\)\{-}\s*\([@#.]\{-}[a-zA-Z\!][a-zA-Z0-9:\!\+\-]*\|{[^}]\+}\)\(\%(\%(#{[{}a-zA-Z0-9_\-\$]\+\|#[a-zA-Z0-9_\-\$]\+\)\|\%(\[[^\]]\+\]\)\|\%(\.{[{}a-zA-Z0-9_\-\$]\+\|\.[a-zA-Z0-9_\-\$]\+\)\)*\)\%(\({[^}]\+}\)\)\{0,1}\%(\s*\*\s*\([0-9]\+\)\s*\)\{0,1}\(\%(\s*)\%(\s*\*\s*[0-9]\+\s*\)\{0,1}\)*\)'
- endif
- let root = { 'name': '', 'attr': {}, 'child': [], 'snippet': '', 'multiplier': 1, 'parent': {}, 'value': '', 'pos': 0 }
- let parent = root
- let last = root
- let pos = []
- while len(abbr)
- " parse line
- let match = matchstr(abbr, mx)
- let str = substitute(match, mx, '\0', 'ig')
- let operator = substitute(match, mx, '\1', 'ig')
- let block_start = substitute(match, mx, '\2', 'ig')
- let tag_name = substitute(match, mx, '\3', 'ig')
- let attributes = substitute(match, mx, '\4', 'ig')
- let value = substitute(match, mx, '\5', 'ig')
- let multiplier = 0 + substitute(match, mx, '\6', 'ig')
- let block_end = substitute(match, mx, '\7', 'ig')
- if len(str) == 0
- break
- endif
- if tag_name =~ '^#'
- let attributes = tag_name . attributes
- let tag_name = 'div'
- endif
- if tag_name =~ '^\.'
- let attributes = tag_name . attributes
- let tag_name = 'div'
- endif
- if multiplier <= 0 | let multiplier = 1 | endif
-
- " make default node
- let current = { 'name': '', 'attr': {}, 'child': [], 'snippet': '', 'multiplier': 1, 'parent': {}, 'value': '', 'pos': 0 }
- let current.name = tag_name
-
- " aliases
- let aliases = s:zen_getResource(type, 'aliases', {})
- if has_key(aliases, tag_name)
- let current.name = aliases[tag_name]
- endif
-
- " snippets
- let snippets = s:zen_getResource(type, 'snippets', {})
- if !empty(snippets) && has_key(snippets, tag_name)
- let snippet = snippets[tag_name]
- let snippet = substitute(snippet, '|', '${cursor}', 'g')
- let lines = split(snippet, "\n")
- call map(lines, 'substitute(v:val, "\\( \\|\\t\\)", indent, "g")')
- let current.snippet = join(lines, "\n")
- let current.name = ''
- endif
-
- " default_attributes
- let default_attributes = s:zen_getResource(type, 'default_attributes', {})
- if !empty(default_attributes)
- for pat in [current.name, tag_name]
- if has_key(default_attributes, pat)
- if type(default_attributes[pat]) == 4
- let a = default_attributes[pat]
- for k in keys(a)
- let current.attr[k] = len(a[k]) ? substitute(a[k], '|', '${cursor}', 'g') : '${cursor}'
- endfor
- else
- for a in default_attributes[pat]
- for k in keys(a)
- let current.attr[k] = len(a[k]) ? substitute(a[k], '|', '${cursor}', 'g') : '${cursor}'
- endfor
- endfor
- endif
- if has_key(s:zen_settings.html.default_attributes, current.name)
- let current.name = substitute(current.name, ':.*$', '', '')
- endif
- break
- endif
- endfor
- endif
-
- " parse attributes
- if len(attributes)
- let attr = attributes
- while len(attr)
- let item = matchstr(attr, '\(\%(\%(#[{}a-zA-Z0-9_\-\$]\+\)\|\%(\[[^\]]\+\]\)\|\%(\.[{}a-zA-Z0-9_\-\$]\+\)*\)\)')
- if len(item) == 0
- break
- endif
- if item[0] == '#'
- let current.attr.id = item[1:]
- endif
- if item[0] == '.'
- let current.attr.class = substitute(item[1:], '\.', ' ', 'g')
- endif
- if item[0] == '['
- let atts = item[1:-2]
- while len(atts)
- let amat = matchstr(atts, '\(\w\+\%(="[^"]*"\|=''[^'']*''\|[^ ''"\]]*\)\{0,1}\)')
- if len(amat) == 0
- break
- endif
- let key = split(amat, '=')[0]
- let val = amat[len(key)+1:]
- if val =~ '^["'']'
- let val = val[1:-2]
- endif
- let current.attr[key] = val
- let atts = atts[stridx(atts, amat) + len(amat):]
- endwhile
- endif
- let attr = substitute(strpart(attr, len(item)), '^\s*', '', '')
- endwhile
- endif
-
- " parse text
- if tag_name =~ '^{.*}$'
- let current.name = ''
- let current.value = tag_name
- else
- let current.value = value
- endif
- let current.multiplier = multiplier
-
- " parse step inside/outside
- if !empty(last)
- if operator =~ '>'
- unlet! parent
- let parent = last
- let current.parent = last
- let current.pos = last.pos + 1
- else
- let current.parent = parent
- let current.pos = last.pos
- endif
- else
- let current.parent = parent
- let current.pos = 1
- endif
- if operator =~ '<'
- for c in range(len(operator))
- let tmp = parent.parent
- if empty(tmp)
- break
- endif
- let parent = tmp
- endfor
- endif
-
- call add(parent.child, current)
- let last = current
-
- " parse block
- if block_start =~ '('
- if operator =~ '>'
- let last.pos += 1
- endif
- for n in range(len(block_start))
- let pos += [last.pos]
- endfor
- endif
- if block_end =~ ')'
- for n in split(substitute(substitute(block_end, ' ', '', 'g'), ')', ',),', 'g'), ',')
- if n == ')'
- if len(pos) > 0 && last.pos >= pos[-1]
- for c in range(last.pos - pos[-1])
- let tmp = parent.parent
- if !has_key(tmp, 'parent')
- break
- endif
- let parent = tmp
- endfor
- if operator =~ '>'
- call remove(pos, -1)
- endif
- let last = parent
- let last.pos += 1
- endif
- elseif len(n)
- let cl = last.child
- let cls = []
- for c in range(n[1:])
- let cls += cl
- endfor
- let last.child = cls
- endif
- endfor
- endif
- let abbr = abbr[stridx(abbr, match) + len(match):]
-
- if g:zencoding_debug > 1
- echo "str=".str
- echo "block_start=".block_start
- echo "tag_name=".tag_name
- echo "operator=".operator
- echo "attributes=".attributes
- echo "value=".value
- echo "multiplier=".multiplier
- echo "block_end=".block_end
- echo "abbr=".abbr
- echo "pos=".string(pos)
- echo "\n"
- endif
- endwhile
- return root
-endfunction
-
-function! s:zen_parseTag(tag)
- let current = { 'name': '', 'attr': {}, 'child': [], 'snippet': '', 'multiplier': 1, 'parent': {}, 'value': '', 'pos': 0 }
- let mx = '<\([a-zA-Z][a-zA-Z0-9]*\)\(\%(\s[a-zA-Z][a-zA-Z0-9]\+=\%([^"'' \t]\+\|["''][^"'']*["'']\)\s*\)*\)\(/\{0,1}\)>'
- let match = matchstr(a:tag, mx)
- let current.name = substitute(match, mx, '\1', 'i')
- let attrs = substitute(match, mx, '\2', 'i')
- let mx = '\([a-zA-Z0-9]\+\)=["'']\{0,1}\([^"'' \t]*\|[^"'']\+\)["'']\{0,1}'
- while len(attrs) > 0
- let match = matchstr(attrs, mx)
- if len(match) == 0
- break
- endif
- let name = substitute(match, mx, '\1', 'i')
- let value = substitute(match, mx, '\2', 'i')
- let current.attr[name] = value
- let attrs = attrs[stridx(attrs, match) + len(match):]
- endwhile
- return current
-endfunction
-
-function! s:zen_mergeConfig(lhs, rhs)
- if type(a:lhs) == 3 && type(a:rhs) == 3
- let a:lhs += a:rhs
- if len(a:lhs)
- call remove(a:lhs, 0, len(a:lhs)-1)
- endif
- for rhi in a:rhs
- call add(a:lhs, a:rhs[rhi])
- endfor
- elseif type(a:lhs) == 4 && type(a:rhs) == 4
- for key in keys(a:rhs)
- if type(a:rhs[key]) == 3
- if !has_key(a:lhs, key)
- let a:lhs[key] = []
- endif
- let a:lhs[key] += a:rhs[key]
- elseif type(a:rhs[key]) == 4
- if has_key(a:lhs, key)
- call s:zen_mergeConfig(a:lhs[key], a:rhs[key])
- else
- let a:lhs[key] = a:rhs[key]
- endif
- else
- let a:lhs[key] = a:rhs[key]
- endif
- endfor
- endif
-endfunction
-
-
-function! s:zen_toString_haml(settings, current, type, inline, filters, itemno, indent)
- let settings = a:settings
- let current = a:current
- let type = a:type
- let inline = a:inline
- let filters = a:filters
- let itemno = a:itemno
- let indent = a:indent
- let str = ""
-
- let comment_indent = ''
- let comment = ''
- if len(current.name) > 0
- let str .= '%' . current.name
- let tmp = ''
- for attr in keys(current.attr)
- let val = current.attr[attr]
- if current.multiplier > 1
- while val =~ '\$\([^{]\|$\)'
- let val = substitute(val, '\(\$\+\)\([^{]\|$\)', '\=printf("%0".len(submatch(1))."d", itemno+1).submatch(2)', 'g')
- endwhile
- endif
- if attr == 'id'
- let str .= '#' . val
- elseif attr == 'class'
- let str .= '.' . substitute(val, ' ', '.', 'g')
- else
- if len(tmp) > 0 | let tmp .= ',' | endif
- let tmp .= ' :' . attr . ' => "' . val . '"'
- endif
- endfor
- if len(tmp)
- let str .= '{' . tmp . ' }'
- endif
- if stridx(','.settings.html.empty_elements.',', ','.current.name.',') != -1 && len(current.value) == 0
- let str .= "/"
- endif
-
- let inner = ''
- if len(current.value) > 0
- let lines = split(current.value[1:-2], "\n")
- let str .= " " . lines[0]
- for line in lines[1:]
- let str .= " |\n" . line
- endfor
- endif
- if len(current.child) == 1 && len(current.child[0].name) == 0
- let lines = split(current.child[0].value[1:-2], "\n")
- let str .= " " . lines[0]
- for line in lines[1:]
- let str .= " |\n" . line
- endfor
- elseif len(current.child) > 0
- for child in current.child
- let inner .= s:zen_toString(child, type, inline, filters)
- endfor
- let inner = substitute(inner, "\n", "\n ", 'g')
- let inner = substitute(inner, "\n $", "", 'g')
- let str .= "\n " . inner
- endif
- endif
- let str .= "\n"
- return str
-endfunction
-
-function! s:zen_toString_html(settings, current, type, inline, filters, itemno, indent)
- let settings = a:settings
- let current = a:current
- let type = a:type
- let inline = a:inline
- let filters = a:filters
- let itemno = a:itemno
- let indent = a:indent
- let str = ""
-
- let comment_indent = ''
- let comment = ''
- if s:zen_useFilter(filters, 'c')
- let comment_indent = substitute(str, '^.*\(\s*\)$', '\1', '')
- endif
- let tmp = '<' . current.name
- for attr in keys(current.attr)
- if current.name =~ '^\(xsl:with-param\|xsl:variable\)$' && s:zen_useFilter(filters, 'xsl') && len(current.child) && attr == 'select'
- continue
- endif
- let val = current.attr[attr]
- if current.multiplier > 1
- while val =~ '\$\([^{]\|$\)'
- let val = substitute(val, '\(\$\+\)\([^{]\|$\)', '\=printf("%0".len(submatch(1))."d", itemno+1).submatch(2)', 'g')
- endwhile
- endif
- let tmp .= ' ' . attr . '="' . val . '"'
- if s:zen_useFilter(filters, 'c')
- if attr == 'id' | let comment .= '#' . val | endif
- if attr == 'class' | let comment .= '.' . val | endif
- endif
- endfor
- if len(comment) > 0
- let tmp = "<!-- " . comment . " -->" . (inline ? "" : "\n") . comment_indent . tmp
- endif
- let str .= tmp
- let inner = current.value[1:-2]
- if stridx(','.settings.html.inline_elements.',', ','.current.name.',') != -1
- let child_inline = 1
- else
- let child_inline = 0
- endif
- for child in current.child
- let html = s:zen_toString(child, type, child_inline, filters)
- if child.name == 'br'
- let inner = substitute(inner, '\n\s*$', '', '')
- endif
- let inner .= html
- endfor
- if len(current.child) == 1 && current.child[0].name == ''
- if stridx(','.settings.html.inline_elements.',', ','.current.name.',') == -1
- let str .= ">" . inner . "</" . current.name . ">\n"
- else
- let str .= ">" . inner . "</" . current.name . ">"
- endif
- elseif len(current.child)
- if inline == 0
- if stridx(','.settings.html.inline_elements.',', ','.current.name.',') == -1
- if inner =~ "\n$"
- let inner = substitute(inner, "\n", "\n" . indent, 'g')
- let inner = substitute(inner, indent . "$", "", 'g')
- let str .= ">\n" . indent . inner . "</" . current.name . ">\n"
- else
- let str .= ">\n" . indent . inner . indent . "\n</" . current.name . ">\n"
- endif
- else
- let str .= ">" . inner . "</" . current.name . ">\n"
- endif
- else
- let str .= ">" . inner . "</" . current.name . ">"
- endif
- else
- if inline == 0
- if stridx(','.settings.html.empty_elements.',', ','.current.name.',') != -1
- let str .= " />\n"
- else
- if stridx(','.settings.html.inline_elements.',', ','.current.name.',') == -1 && len(current.child)
- let str .= ">\n" . inner . '${cursor}</' . current.name . ">\n"
- else
- let str .= ">" . inner . '${cursor}</' . current.name . ">\n"
- endif
- endif
- else
- if stridx(','.settings.html.empty_elements.',', ','.current.name.',') != -1
- let str .= " />"
- else
- let str .= ">" . inner . '${cursor}</' . current.name . ">"
- endif
- endif
- endif
- if len(comment) > 0
- let str .= "<!-- /" . comment . " -->" . (inline ? "" : "\n") . comment_indent
- endif
- return str
-endfunction
-
-function! s:zen_toString(...)
- let current = a:1
- if a:0 > 1
- let type = a:2
- else
- let type = &ft
- endif
-" if !has_key(s:zen_settings, type)
-" let type = 'html'
-" endif
- if len(type) == 0 | let type = 'html' | endif
- if a:0 > 2
- let inline = a:3
- else
- let inline = 0
- endif
- if a:0 > 3
- if type(a:4) == 1
- let filters = split(a:4, '\s*,\s*')
- else
- let filters = a:4
- endif
- else
- let filters = ['html']
- endif
-
- if has_key(s:zen_settings, type) && has_key(s:zen_settings[type], 'indentation')
- let indent = s:zen_settings[type].indentation
- else
- let indent = s:zen_settings.indentation
- endif
- let itemno = 0
- let str = ''
- while itemno < current.multiplier
- if len(current.name)
- if exists('*g:zen_toString_'.type)
- let str .= function('g:zen_toString_'.type)(s:zen_settings, current, type, inline, filters, itemno, indent)
- elseif s:zen_useFilter(filters, 'haml')
- let str .= s:zen_toString_haml(s:zen_settings, current, type, inline, filters, itemno, indent)
- else
- let str .= s:zen_toString_html(s:zen_settings, current, type, inline, filters, itemno, indent)
- endif
- else
- let snippet = current.snippet
- if len(current.snippet) == 0
- let snippets = s:zen_getResource(type, 'snippets', {})
- if !empty(snippets) && has_key(snippets, 'zensnippet')
- let snippet = snippets['zensnippet']
- endif
- endif
- if len(snippet) > 0
- let tmp = substitute(snippet, '|', '${cursor}', 'g')
- let tmp = substitute(tmp, '\${zenname}', current.name, 'g')
- if type == 'css' && s:zen_useFilter(filters, 'fc')
- let tmp = substitute(tmp, '^\([^:]\+\):\(.*\)$', '\1: \2', '')
- endif
- for attr in keys(current.attr)
- let val = current.attr[attr]
- let tmp = substitute(tmp, '\${' . attr . '}', val, 'g')
- endfor
- let str .= tmp
- else
- if len(current.name)
- let str .= current.name
- endif
- if len(current.value)
- let str .= current.value[1:-2]
- endif
- endif
- let inner = ''
- if len(current.child)
- for n in current.child
- let inner .= s:zen_toString(n, type, inline, filters)
- endfor
- let inner = substitute(inner, "\n", "\n" . indent, 'g')
- endif
- let str = substitute(str, '\${child}', inner, '')
- endif
- let itemno = itemno + 1
- endwhile
- if s:zen_useFilter(filters, 'e')
- let str = substitute(str, '&', '\&amp;', 'g')
- let str = substitute(str, '<', '\&lt;', 'g')
- let str = substitute(str, '>', '\&gt;', 'g')
- endif
- return str
-endfunction
-
-function! s:zen_getResource(type, name, default)
- if !has_key(s:zen_settings, a:type)
- return a:default
- endif
- let ret = a:default
-
- if has_key(s:zen_settings[a:type], a:name)
- call s:zen_mergeConfig(ret, s:zen_settings[a:type][a:name])
- endif
-
- if has_key(s:zen_settings[a:type], 'extends')
- let extends = s:zen_settings[a:type].extends
- if type(extends) == 1
- let tmp = split(extends, '\s*,\s*')
- unlet! extends
- let extends = tmp
- endif
- for ext in extends
- if has_key(s:zen_settings, ext) && has_key(s:zen_settings[ext], a:name)
- call s:zen_mergeConfig(ret, s:zen_settings[ext][a:name])
- endif
- endfor
- endif
- return ret
-endfunction
-
-function! s:zen_getFileType()
- let type = &ft
- if type == 'xslt' | let type = 'xsl' | endif
- if type == 'htmldjango' | let type = 'html' | endif
- if type == 'html.django_template' | let type = 'html' | endif
- if synIDattr(synID(line("."), col("."), 1), "name") =~ '^css'
- let type = 'css'
- endif
- if synIDattr(synID(line("."), col("."), 1), "name") =~ '^html'
- let type = 'html'
- endif
- if synIDattr(synID(line("."), col("."), 1), "name") =~ '^xml'
- let type = 'xml'
- endif
- if synIDattr(synID(line("."), col("."), 1), "name") =~ '^javaScript'
- let type = 'javascript'
- endif
- if len(type) == 0 | let type = 'html' | endif
- return type
-endfunction
-
-function! zencoding#expandAbbr(mode) range
- let type = s:zen_getFileType()
- let expand = ''
- let filters = ['html']
- let line = ''
- let part = ''
- let rest = ''
-
- if has_key(s:zen_settings, type) && has_key(s:zen_settings[type], 'filters')
- let filters = split(s:zen_settings[type].filters, '\s*,\s*')
- endif
-
- if a:mode == 2
- let leader = substitute(input('Tag: ', ''), '^\s*\(.*\)\s*$', '\1', 'g')
- if len(leader) == 0
- return
- endif
- let mx = '|\(\%(html\|haml\|e\|c\|fc\|xsl\)\s*,\{0,1}\s*\)*$'
- if leader =~ mx
- let filters = split(matchstr(leader, mx)[1:], '\s*,\s*')
- let leader = substitute(leader, mx, '', '')
- endif
- if leader =~ '\*'
- let query = substitute(leader, '*', '*' . (a:lastline - a:firstline + 1), '') . '>{$line$}'
- let items = s:zen_parseIntoTree(query, type).child
- for item in items
- let expand .= s:zen_toString(item, type, 0, filters)
- endfor
- let line = getline(a:firstline)
- let part = substitute(line, '^\s*', '', '')
- for n in range(a:firstline, a:lastline)
- let lline = getline(n)
- let lpart = substitute(lline, '^\s*', '', '')
- let pos = stridx(expand, "$line$")
- if pos != -1
- let expand = expand[:pos-1] . lpart . expand[pos+6:]
- endif
- endfor
- let expand = substitute(expand, '\$line\$', '', 'g')
- else
- let str = ''
- if a:firstline != a:lastline
- let line = getline(a:firstline)
- let part = substitute(line, '^\s*', '', '')
- for n in range(a:firstline, a:lastline)
- if len(leader) > 0
- let str .= getline(n) . "\n"
- else
- let lpart = substitute(getline(n), '^\s*', '', '')
- let str .= lpart . "\n"
- endif
- endfor
- if len(leader)
- let items = s:zen_parseIntoTree(leader, type).child
- let items[0].value = "{\n".str."}"
- else
- let items = s:zen_parseIntoTree(leader, type).child
- let items[0].value = "{".str."}"
- endif
- else
- let str .= getline(a:firstline)
- let items = s:zen_parseIntoTree(leader, type).child
- let items[0].value = "{".str."}"
- endif
- for item in items
- let expand .= s:zen_toString(item, type, 0, filters)
- endfor
- endif
- silent! exe "normal! gvc"
- else
- let line = getline('.')
- if col('.') < len(line)
- let line = matchstr(line, '^\(.*\%'.col('.').'c.\)')
- endif
- if a:mode == 1
- let part = matchstr(line, '\([a-zA-Z0-9_\@:|]\+\)$')
- else
- let part = matchstr(line, '\(\S.*\)$')
- while part =~ '<.*>'
- let part = substitute(part, '^.*<.\{-}>', '', '')
- endwhile
- endif
- let rest = getline('.')[len(line):]
- let str = part
- let mx = '|\(\%(html\|haml\|e\|c\|fc\|xsl\)\s*,\{0,1}\s*\)*$'
- if str =~ mx
- let filters = split(matchstr(str, mx)[1:], '\s*,\s*')
- let str = substitute(str, mx, '', '')
- endif
- let items = s:zen_parseIntoTree(str, type).child
- for item in items
- let expand .= s:zen_toString(item, type, 0, filters)
- endfor
- endif
- if len(expand)
- if expand !~ '\${cursor}'
- if a:mode == 2 |
- let expand = '${cursor}' . expand
- else
- let expand .= '${cursor}'
- endif
- endif
- let expand = substitute(expand, '${lang}', s:zen_settings.lang, 'g')
- let expand = substitute(expand, '${charset}', s:zen_settings.charset, 'g')
- let expand = substitute(expand, '\${cursor}', '$cursor$', '')
- let expand = substitute(expand, '\${cursor}', '', 'g')
- if has_key(s:zen_settings, 'timezone') && len(s:zen_settings.timezone)
- let expand = substitute(expand, '${datetime}', strftime("%Y-%m-%dT%H:%M:%S") . s:zen_settings.timezone, 'g')
- else
- " TODO: on windows, %z/%Z is 'Tokyo(Standard)'
- let expand = substitute(expand, '${datetime}', strftime("%Y-%m-%dT%H:%M:%S %z"), 'g')
- endif
- if line[:-len(part)-1] =~ '^\s\+$'
- let indent = line[:-len(part)-1]
- else
- let indent = ''
- endif
- let expand = substitute(expand, '\n\s*$', '', 'g')
- let expand = line[:-len(part)-1] . substitute(expand, "\n", "\n" . indent, 'g') . rest
- let lines = split(expand, '\n')
- call setline(line('.'), lines[0])
- if len(lines) > 1
- call append(line('.'), lines[1:])
- endif
- endif
- silent! exe "normal! ".len(part)."h"
- if search('\$cursor\$', 'e')
- let oldselection = &selection
- let &selection = 'inclusive'
- silent! exe "normal! v7h\"_s"
- let &selection = oldselection
- endif
- if g:zencoding_debug > 1
- call getchar()
- endif
-endfunction
-
-function! zencoding#moveNextPrev(flag)
- if search('><\/\|\(""\)\|^\s*$', a:flag ? 'Wpb' : 'Wp') == 3
- startinsert!
- else
- silent! normal! l
- startinsert
- endif
-endfunction
-
-function! zencoding#imageSize()
- let img_region = s:search_region('<img\s', '>')
- if !s:region_is_valid(img_region) || !s:cursor_in_region(img_region)
- return
- endif
- let content = s:get_content(img_region)
- if content !~ '^<img[^><]\+>$'
- return
- endif
- let current = s:zen_parseTag(content)
- let fn = current.attr.src
- if fn !~ '^\(/\|http\)'
- let fn = simplify(expand('%:h') . '/' . fn)
- endif
- let [type, width, height] = ['', -1, -1]
-
- if filereadable(fn)
- let hex = substitute(system('xxd -p "'.fn.'"'), '\n', '', 'g')
- else
- let hex = substitute(system('curl -s "'.fn.'" | xxd -p'), '\n', '', 'g')
- endif
-
- if hex =~ '^89504e470d0a1a0a'
- let type = 'png'
- let width = eval('0x'.hex[32:39])
- let height = eval('0x'.hex[40:47])
- endif
- if hex =~ '^ffd8'
- let pos = match(hex, 'ffc[02]')
- let type = 'jpg'
- let height = eval('0x'.hex[pos+10:pos+11])*256 + eval('0x'.hex[pos+12:pos+13])
- let width = eval('0x'.hex[pos+14:pos+15])*256 + eval('0x'.hex[pos+16:pos+17])
- endif
- if hex =~ '^47494638'
- let type = 'gif'
- let width = eval('0x'.hex[14:15].hex[12:13])
- let height = eval('0x'.hex[18:19].hex[16:17])
- endif
-
- if width == -1 && height == -1
- return
- endif
- let current.attr.width = width
- let current.attr.height = height
- let html = s:zen_toString(current, 'html', 1)
- call s:change_content(img_region, html)
-endfunction
-
-function! zencoding#toggleComment()
- if s:zen_getFileType() == 'css'
- let line = getline('.')
- let mx = '^\(\s*\)/\*\s*\(.*\)\s*\*/\s*$'
- if line =~ mx
- let space = substitute(matchstr(line, mx), mx, '\1', '')
- let line = substitute(matchstr(line, mx), mx, '\2', '')
- let line = space . substitute(line, '^\s*\|\s*$', '\1', 'g')
- else
- let mx = '^\(\s*\)\(.*\)\s*$'
- let line = substitute(line, mx, '\1/* \2 */', '')
- endif
- call setline('.', line)
- return
- endif
-
- let curpos = getpos('.')
- while 1
- let mx = '<\(/\{0,1}[a-zA-Z][a-zA-Z0-9]*\)[^>]*>'
- let pos1 = searchpos(mx, 'bcnW')
- let content = matchstr(getline(pos1[0])[pos1[1]-1:], mx)
- let tag_name = substitute(content, '^<\(/\{0,1}[a-zA-Z0-9]*\).*$', '\1', '')
- let block = [pos1, [pos1[0], pos1[1] + len(content) - 1]]
- if content[-2:] == '/>' && s:point_in_region(curpos[1:2], block)
- let comment_region = s:search_region('<!--', '-->')
- if !s:region_is_valid(comment_region) || !s:point_in_region(curpos[1:2], comment_region) || !(s:point_in_region(comment_region[0], block) && s:point_in_region(comment_region[1], block))
- let content = '<!-- ' . s:get_content(block) . ' -->'
- call s:change_content(block, content)
- else
- let content = s:get_content(comment_region)
- let content = substitute(content, '^<!--\s\(.*\)\s-->$', '\1', '')
- call s:change_content(comment_region, content)
- endif
- return
- else
- if tag_name[0] == '/'
- let pos1 = searchpos('<' . tag_name[1:] . '[^a-zA-Z0-9]', 'bcnW')
- call setpos('.', [0, pos1[0], pos1[1], 0])
- let pos2 = searchpos('</' . tag_name[1:] . '>', 'cneW')
- else
- let pos2 = searchpos('</' . tag_name . '>', 'cneW')
- endif
- let block = [pos1, pos2]
- if !s:region_is_valid(block)
- call setpos('.', curpos)
- let block = s:search_region('<!', '-->')
- if !s:region_is_valid(block)
- return
- endif
- endif
- if s:point_in_region(curpos[1:2], block)
- let comment_region = s:search_region('<!--', '-->')
- if !s:region_is_valid(comment_region) || !s:point_in_region(curpos[1:2], comment_region) || !(s:point_in_region(comment_region[0], block) && s:point_in_region(comment_region[1], block))
- let content = '<!-- ' . s:get_content(block) . ' -->'
- call s:change_content(block, content)
- else
- let content = s:get_content(comment_region)
- let content = substitute(content, '^<!--\s\(.*\)\s-->$', '\1', '')
- call s:change_content(comment_region, content)
- endif
- return
- else
- if block[0][0] > 0
- call setpos('.', [0, block[0][0]-1, block[0][1], 0])
- else
- call setpos('.', curpos)
- return
- endif
- endif
- endif
- endwhile
-endfunction
-
-function! zencoding#splitJoinTag()
- let curpos = getpos('.')
- while 1
- let mx = '<\(/\{0,1}[a-zA-Z][a-zA-Z0-9]*\)[^>]*>'
- let pos1 = searchpos(mx, 'bcnW')
- let content = matchstr(getline(pos1[0])[pos1[1]-1:], mx)
- let tag_name = substitute(content, '^<\(/\{0,1}[a-zA-Z0-9]*\).*$', '\1', '')
- let block = [pos1, [pos1[0], pos1[1] + len(content) - 1]]
- if content[-2:] == '/>' && s:cursor_in_region(block)
- let content = content[:-3] . "></" . tag_name . '>'
- call s:change_content(block, content)
- call setpos('.', [0, block[0][0], block[0][1], 0])
- return
- else
- if tag_name[0] == '/'
- let pos1 = searchpos('<' . tag_name[1:] . '[^a-zA-Z0-9]', 'bcnW')
- call setpos('.', [0, pos1[0], pos1[1], 0])
- let pos2 = searchpos('</' . tag_name[1:] . '>', 'cneW')
- else
- let pos2 = searchpos('</' . tag_name . '>', 'cneW')
- endif
- let block = [pos1, pos2]
- let content = s:get_content(block)
- if s:point_in_region(curpos[1:2], block) && content[1:] !~ '<' . tag_name . '[^a-zA-Z0-9]*[^>]*>'
- let content = matchstr(content, mx)[:-2] . '/>'
- call s:change_content(block, content)
- call setpos('.', [0, block[0][0], block[0][1], 0])
- return
- else
- if block[0][0] > 0
- call setpos('.', [0, block[0][0]-1, block[0][1], 0])
- else
- call setpos('.', curpos)
- return
- endif
- endif
- endif
- endwhile
-endfunction
-
-function! zencoding#removeTag()
- let curpos = getpos('.')
- while 1
- let mx = '<\(/\{0,1}[a-zA-Z][a-zA-Z0-9]*\)[^>]*>'
- let pos1 = searchpos(mx, 'bcnW')
- let content = matchstr(getline(pos1[0])[pos1[1]-1:], mx)
- let tag_name = substitute(content, '^<\(/\{0,1}[a-zA-Z0-9]*\).*$', '\1', '')
- let block = [pos1, [pos1[0], pos1[1] + len(content) - 1]]
- if content[-2:] == '/>' && s:cursor_in_region(block)
- call s:change_content(block, '')
- call setpos('.', [0, block[0][0], block[0][1], 0])
- return
- else
- if tag_name[0] == '/'
- let pos1 = searchpos('<' . tag_name[1:] . '[^a-zA-Z0-9]', 'bcnW')
- call setpos('.', [0, pos1[0], pos1[1], 0])
- let pos2 = searchpos('</' . tag_name[1:] . '>', 'cneW')
- else
- let pos2 = searchpos('</' . tag_name . '>', 'cneW')
- endif
- let block = [pos1, pos2]
- let content = s:get_content(block)
- if s:point_in_region(curpos[1:2], block) && content[1:] !~ '<' . tag_name . '[^a-zA-Z0-9]*[^>]*>'
- call s:change_content(block, '')
- call setpos('.', [0, block[0][0], block[0][1], 0])
- return
- else
- if block[0][0] > 0
- call setpos('.', [0, block[0][0]-1, block[0][1], 0])
- else
- call setpos('.', curpos)
- return
- endif
- endif
- endif
- endwhile
-endfunction
-
-function! zencoding#balanceTag(flag) range
- let vblock = s:get_visualblock()
- if a:flag == -2 || a:flag == 2
- let curpos = [0, line("'<"), col("'<"), 0]
- else
- let curpos = getpos('.')
- endif
- while 1
- let mx = '<\(/\{0,1}[a-zA-Z][a-zA-Z0-9]*\)[^>]*>'
- let pos1 = searchpos(mx, (a:flag == -2 ? 'nW' : 'bcnW'))
- let content = matchstr(getline(pos1[0])[pos1[1]-1:], mx)
- let tag_name = substitute(content, '^<\(/\{0,1}[a-zA-Z0-9]*\).*$', '\1', '')
- let block = [pos1, [pos1[0], pos1[1] + len(content) - 1]]
- if !s:region_is_valid(block)
- break
- endif
- if content[-2:] == '/>' && s:point_in_region(curpos[1:2], block)
- call s:select_region(block)
- return
- else
- if tag_name[0] == '/'
- let pos1 = searchpos('<' . tag_name[1:] . '[^a-zA-Z0-9]', a:flag == -2 ? 'nW' : 'bcnW')
- if pos1[0] == 0
- break
- endif
- call setpos('.', [0, pos1[0], pos1[1], 0])
- let pos2 = searchpos('</' . tag_name[1:] . '>', 'cneW')
- else
- let pos2 = searchpos('</' . tag_name . '>', 'cneW')
- endif
- let block = [pos1, pos2]
- if !s:region_is_valid(block)
- break
- endif
- let content = s:get_content(block)
- if a:flag == -2
- let check = s:region_in_region(vblock, block) && content[1:] !~ '<' . tag_name . '[^a-zA-Z0-9]*[^>]*>'
- else
- let check = s:point_in_region(curpos[1:2], block) && content[1:] !~ '<' . tag_name . '[^a-zA-Z0-9]*[^>]*>'
- endif
- if check
- if a:flag < 0
- let l = getline(pos1[0])
- let content = matchstr(l[pos1[1]-1:], mx)
- if pos1[1] + len(content) > len(l)
- let pos1[0] += 1
- else
- let pos1[1] += len(content)
- endif
- let pos2 = searchpos('\(\n\|.\)</' . tag_name . '>', 'cnW')
- else
- let pos2 = searchpos('</' . tag_name . '>', 'cneW')
- endif
- let block = [pos1, pos2]
- call s:select_region(block)
- return
- else
- if s:region_is_valid(block)
- if a:flag == -2
- if setpos('.', [0, block[0][0]+1, block[0][1], 0]) == -1
- break
- endif
- else
- if setpos('.', [0, block[0][0]-1, block[0][1], 0]) == -1
- break
- endif
- endif
- else
- break
- endif
- endif
- endif
- endwhile
- if a:flag == -2 || a:flag == 2
- silent! exe "normal! gv"
- else
- call setpos('.', curpos)
- endif
-endfunction
-
-function! zencoding#anchorizeURL(flag)
- let mx = 'https\=:\/\/[-!#$%&*+,./:;=?@0-9a-zA-Z_~]\+'
- let pos1 = searchpos(mx, 'bcnW')
- let url = matchstr(getline(pos1[0])[pos1[1]-1:], mx)
- let block = [pos1, [pos1[0], pos1[1] + len(url) - 1]]
- if !s:cursor_in_region(block)
- return
- endif
-
- let content = s:get_content_from_url(url)
- let content = substitute(content, '\n', '', 'g')
- let content = substitute(content, '\n\s*\n', '\n', 'g')
- let head = strpart(content, 0, stridx(content, '</head>'))
- let title = substitute(head, '.*<title[^>]*>\([^<]\+\)<\/title[^>]*>.*', '\1', 'g')
-
- if a:flag == 0
- let a = s:zen_parseTag('<a>')
- let a.attr.href = url
- let a.value = '{' . title . '}'
- let expand = s:zen_toString(a, 'html', 0, [])
- let expand = substitute(expand, '\${cursor}', '', 'g')
- else
- let body = s:get_text_from_html(content)
- let body = '{' . substitute(body, '^\(.\{0,100}\).*', '\1', '') . '...}'
-
- let blockquote = s:zen_parseTag('<blockquote class="quote">')
- let a = s:zen_parseTag('<a>')
- let a.attr.href = url
- let a.value = '{' . title . '}'
- call add(blockquote.child, a)
- call add(blockquote.child, s:zen_parseTag('<br/>'))
- let p = s:zen_parseTag('<p>')
- let p.value = body
- call add(blockquote.child, p)
- let cite = s:zen_parseTag('<cite>')
- let cite.value = '{' . url . '}'
- call add(blockquote.child, cite)
- let expand = s:zen_toString(blockquote, 'html', 0, [])
- let expand = substitute(expand, '\${cursor}', '', 'g')
- let indent = substitute(getline('.'), '^\(\s*\).*', '\1', '')
- let expand = substitute(expand, "\n", "\n" . indent, 'g')
- endif
- call s:change_content(block, expand)
-endfunction
-
-"==============================================================================
-" html utils
-"==============================================================================
-function! s:get_content_from_url(url)
- silent! new
- silent! exec '0r!curl -s -L "'.substitute(a:url, '#.*', '', '').'"'
- let ret = join(getline(1, '$'), "\n")
- silent! bw!
- return ret
-endfunction
-
-function! s:get_text_from_html(buf)
- let threshold_len = 100
- let threshold_per = 0.1
- let buf = a:buf
-
- let buf = substitute(buf, '<!--.\{-}-->', '', 'g')
- let buf = strpart(buf, stridx(buf, '</head>'))
- let buf = substitute(buf, '<style[^>]*>.\{-}</style>', '', 'g')
- let buf = substitute(buf, '<script[^>]*>.\{-}</script>', '', 'g')
- let res = ''
- let max = 0
- let mx = '\(<td[^>]\{-}>\)\|\(<\/td>\)\|\(<div[^>]\{-}>\)\|\(<\/div>\)'
- let m = split(buf, mx)
- for str in m
- let c = split(str, '<[^>]*?>')
- let str = substitute(str, '<[^>]\{-}>', '', 'g')
- let str = substitute(str, '&gt;', '>', 'g')
- let str = substitute(str, '&lt;', '<', 'g')
- let str = substitute(str, '&quot;', '"', 'g')
- let str = substitute(str, '&apos;', "'", 'g')
- let str = substitute(str, '&nbsp;', ' ', 'g')
- let str = substitute(str, '&yen;', '\&#65509;', 'g')
- let str = substitute(str, '&amp;', '\&', 'g')
- let str = substitute(str, '^\s*\(.*\)\s*$', '\1', '')
- let str = substitute(str, '\s\+', ' ', 'g')
- let l = len(str)
- if l > threshold_len
- let per = len(c) / l
- if max < l && per < threshold_per
- let max = l
- let res = str
- endif
- endif
- endfor
- let res = substitute(res, '^\s*\(.*\)\s*$', '\1', 'g')
- return res
-endfunction
-"==============================================================================
-
-"==============================================================================
-" region utils
-"==============================================================================
-" delete_content : delete content in region
-" if region make from between '<foo>' and '</foo>'
-" --------------------
-" begin:<foo>
-" </foo>:end
-" --------------------
-" this function make the content as following
-" --------------------
-" begin::end
-" --------------------
-function! s:delete_content(region)
- let lines = getline(a:region[0][0], a:region[1][0])
- call setpos('.', [0, a:region[0][0], a:region[0][1], 0])
- silent! exe "delete ".(a:region[1][0] - a:region[0][0])
- call setline(line('.'), lines[0][:a:region[0][1]-2] . lines[-1][a:region[1][1]])
-endfunction
-
-" change_content : change content in region
-" if region make from between '<foo>' and '</foo>'
-" --------------------
-" begin:<foo>
-" </foo>:end
-" --------------------
-" and content is
-" --------------------
-" foo
-" bar
-" baz
-" --------------------
-" this function make the content as following
-" --------------------
-" begin:foo
-" bar
-" baz:end
-" --------------------
-function! s:change_content(region, content)
- let newlines = split(a:content, '\n')
- let oldlines = getline(a:region[0][0], a:region[1][0])
- call setpos('.', [0, a:region[0][0], a:region[0][1], 0])
- silent! exe "delete ".(a:region[1][0] - a:region[0][0])
- if len(newlines) == 0
- let tmp = ''
- if a:region[0][1] > 1
- let tmp = oldlines[0][:a:region[0][1]-2]
- endif
- if a:region[1][1] > 1
- let tmp .= oldlines[-1][a:region[1][1]:]
- endif
- call setline(line('.'), tmp)
- elseif len(newlines) == 1
- if a:region[0][1] > 1
- let newlines[0] = oldlines[0][:a:region[0][1]-2] . newlines[0]
- endif
- if a:region[1][1] > 1
- let newlines[0] .= oldlines[-1][a:region[1][1]:]
- endif
- call setline(line('.'), newlines[0])
- else
- if a:region[0][1] > 1
- let newlines[0] = oldlines[0][:a:region[0][1]-2] . newlines[0]
- endif
- if a:region[1][1] > 1
- let newlines[-1] .= oldlines[-1][a:region[1][1]:]
- endif
- call setline(line('.'), newlines[0])
- call append(line('.'), newlines[1:])
- endif
-endfunction
-
-" select_region : select region
-" this function make a selection of region
-function! s:select_region(region)
- call setpos('.', [0, a:region[1][0], a:region[1][1], 0])
- normal! v
- call setpos('.', [0, a:region[0][0], a:region[0][1], 0])
-endfunction
-
-" point_in_region : check point is in the region
-" this function return 0 or 1
-function! s:point_in_region(point, region)
- if !s:region_is_valid(a:region) | return 0 | endif
- if a:region[0][0] > a:point[0] | return 0 | endif
- if a:region[1][0] < a:point[0] | return 0 | endif
- if a:region[0][0] == a:point[0] && a:region[0][1] > a:point[1] | return 0 | endif
- if a:region[1][0] == a:point[0] && a:region[1][1] < a:point[1] | return 0 | endif
- return 1
-endfunction
-
-" cursor_in_region : check cursor is in the region
-" this function return 0 or 1
-function! s:cursor_in_region(region)
- if !s:region_is_valid(a:region) | return 0 | endif
- let cur = getpos('.')[1:2]
- return s:point_in_region(cur, a:region)
-endfunction
-
-" region_is_valid : check region is valid
-" this function return 0 or 1
-function! s:region_is_valid(region)
- if a:region[0][0] == 0 || a:region[1][0] == 0 | return 0 | endif
- return 1
-endfunction
-
-" search_region : make region from pattern which is composing start/end
-" this function return array of position
-function! s:search_region(start, end)
- return [searchpos(a:start, 'bcnW'), searchpos(a:end, 'cneW')]
-endfunction
-
-" get_content : get content in region
-" this function return string in region
-function! s:get_content(region)
- if !s:region_is_valid(a:region)
- return ''
- endif
- let lines = getline(a:region[0][0], a:region[1][0])
- if a:region[0][0] == a:region[1][0]
- let lines[0] = lines[0][a:region[0][1]-1:a:region[1][1]-1]
- else
- let lines[0] = lines[0][a:region[0][1]-1:]
- let lines[-1] = lines[-1][:a:region[1][1]-1]
- endif
- return join(lines, "\n")
-endfunction
-
-" region_in_region : check region is in the region
-" this function return 0 or 1
-function! s:region_in_region(outer, inner)
- if !s:region_is_valid(a:inner) || !s:region_is_valid(a:outer)
- return 0
- endif
- return s:point_in_region(a:inner[0], a:outer) && s:point_in_region(a:inner[1], a:outer)
-endfunction
-
-" get_visualblock : get region of visual block
-" this function return region of visual block
-function! s:get_visualblock()
- return [[line("'<"), col("'<")], [line("'>"), col("'>")]]
-endfunction
-"==============================================================================
-
-function! zencoding#ExpandWord(abbr, type, orig)
- let mx = '|\(\%(html\|haml\|e\|c\|fc\|xsl\)\s*,\{0,1}\s*\)*$'
- let str = a:abbr
- let type = a:type
-
- if len(type) == 0 | let type = 'html' | endif
- if str =~ mx
- let filters = split(matchstr(str, mx)[1:], '\s*,\s*')
- let str = substitute(str, mx, '', '')
- elseif has_key(s:zen_settings[a:type], 'filters')
- let filters = split(s:zen_settings[a:type].filters, '\s*,\s*')
- else
- let filters = ['html']
- endif
- let items = s:zen_parseIntoTree(str, a:type).child
- let expand = ''
- for item in items
- let expand .= s:zen_toString(item, a:type, 0, filters)
- endfor
- if a:orig == 0
- let expand = substitute(expand, '\${lang}', s:zen_settings.lang, 'g')
- let expand = substitute(expand, '\${charset}', s:zen_settings.charset, 'g')
- let expand = substitute(expand, '\${cursor}', '', 'g')
- endif
- return expand
-endfunction
-
-function! zencoding#CompleteTag(findstart, base)
- if a:findstart
- let line = getline('.')
- let start = col('.') - 1
- while start > 0 && line[start - 1] =~ '[a-zA-Z0-9:\@]'
- let start -= 1
- endwhile
- return start
- else
- let type = s:zen_getFileType()
- let res = []
-
- let snippets = s:zen_getResource(type, 'snippets', {})
- for item in keys(snippets)
- if stridx(item, a:base) != -1
- call add(res, substitute(item, '\${cursor}\||', '', 'g'))
- endif
- endfor
- let aliases = s:zen_getResource(type, 'aliases', {})
- for item in values(aliases)
- if stridx(item, a:base) != -1
- call add(res, substitute(item, '\${cursor}\||', '', 'g'))
- endif
- endfor
- return res
- endif
-endfunction
-
-unlet! s:zen_settings
-let s:zen_settings = {
-\ 'indentation': "\t",
-\ 'lang': "en",
-\ 'charset': "UTF-8",
-\ 'css': {
-\ 'snippets': {
-\ '@i': '@import url(|);',
-\ '@m': "@media print {\n\t|\n}",
-\ '@f': "@font-face {\n\tfont-family:|;\n\tsrc:url(|);\n}",
-\ '!': '!important',
-\ 'pos': 'position:|;',
-\ 'pos:s': 'position:static;',
-\ 'pos:a': 'position:absolute;',
-\ 'pos:r': 'position:relative;',
-\ 'pos:f': 'position:fixed;',
-\ 't': 'top:|;',
-\ 't:a': 'top:auto;',
-\ 'r': 'right:|;',
-\ 'r:a': 'right:auto;',
-\ 'b': 'bottom:|;',
-\ 'b:a': 'bottom:auto;',
-\ 'l': 'left:|;',
-\ 'l:a': 'left:auto;',
-\ 'z': 'z-index:|;',
-\ 'z:a': 'z-index:auto;',
-\ 'fl': 'float:|;',
-\ 'fl:n': 'float:none;',
-\ 'fl:l': 'float:left;',
-\ 'fl:r': 'float:right;',
-\ 'cl': 'clear:|;',
-\ 'cl:n': 'clear:none;',
-\ 'cl:l': 'clear:left;',
-\ 'cl:r': 'clear:right;',
-\ 'cl:b': 'clear:both;',
-\ 'd': 'display:|;',
-\ 'd:n': 'display:none;',
-\ 'd:b': 'display:block;',
-\ 'd:i': 'display:inline;',
-\ 'd:ib': 'display:inline-block;',
-\ 'd:li': 'display:list-item;',
-\ 'd:ri': 'display:run-in;',
-\ 'd:cp': 'display:compact;',
-\ 'd:tb': 'display:table;',
-\ 'd:itb': 'display:inline-table;',
-\ 'd:tbcp': 'display:table-caption;',
-\ 'd:tbcl': 'display:table-column;',
-\ 'd:tbclg': 'display:table-column-group;',
-\ 'd:tbhg': 'display:table-header-group;',
-\ 'd:tbfg': 'display:table-footer-group;',
-\ 'd:tbr': 'display:table-row;',
-\ 'd:tbrg': 'display:table-row-group;',
-\ 'd:tbc': 'display:table-cell;',
-\ 'd:rb': 'display:ruby;',
-\ 'd:rbb': 'display:ruby-base;',
-\ 'd:rbbg': 'display:ruby-base-group;',
-\ 'd:rbt': 'display:ruby-text;',
-\ 'd:rbtg': 'display:ruby-text-group;',
-\ 'v': 'visibility:|;',
-\ 'v:v': 'visibility:visible;',
-\ 'v:h': 'visibility:hidden;',
-\ 'v:c': 'visibility:collapse;',
-\ 'ov': 'overflow:|;',
-\ 'ov:v': 'overflow:visible;',
-\ 'ov:h': 'overflow:hidden;',
-\ 'ov:s': 'overflow:scroll;',
-\ 'ov:a': 'overflow:auto;',
-\ 'ovx': 'overflow-x:|;',
-\ 'ovx:v': 'overflow-x:visible;',
-\ 'ovx:h': 'overflow-x:hidden;',
-\ 'ovx:s': 'overflow-x:scroll;',
-\ 'ovx:a': 'overflow-x:auto;',
-\ 'ovy': 'overflow-y:|;',
-\ 'ovy:v': 'overflow-y:visible;',
-\ 'ovy:h': 'overflow-y:hidden;',
-\ 'ovy:s': 'overflow-y:scroll;',
-\ 'ovy:a': 'overflow-y:auto;',
-\ 'ovs': 'overflow-style:|;',
-\ 'ovs:a': 'overflow-style:auto;',
-\ 'ovs:s': 'overflow-style:scrollbar;',
-\ 'ovs:p': 'overflow-style:panner;',
-\ 'ovs:m': 'overflow-style:move;',
-\ 'ovs:mq': 'overflow-style:marquee;',
-\ 'zoo': 'zoom:1;',
-\ 'cp': 'clip:|;',
-\ 'cp:a': 'clip:auto;',
-\ 'cp:r': 'clip:rect(|);',
-\ 'bxz': 'box-sizing:|;',
-\ 'bxz:cb': 'box-sizing:content-box;',
-\ 'bxz:bb': 'box-sizing:border-box;',
-\ 'bxsh': 'box-shadow:|;',
-\ 'bxsh:n': 'box-shadow:none;',
-\ 'bxsh:w': '-webkit-box-shadow:0 0 0 #000;',
-\ 'bxsh:m': '-moz-box-shadow:0 0 0 0 #000;',
-\ 'm': 'margin:|;',
-\ 'm:a': 'margin:auto;',
-\ 'm:0': 'margin:0;',
-\ 'm:2': 'margin:0 0;',
-\ 'm:3': 'margin:0 0 0;',
-\ 'm:4': 'margin:0 0 0 0;',
-\ 'mt': 'margin-top:|;',
-\ 'mt:a': 'margin-top:auto;',
-\ 'mr': 'margin-right:|;',
-\ 'mr:a': 'margin-right:auto;',
-\ 'mb': 'margin-bottom:|;',
-\ 'mb:a': 'margin-bottom:auto;',
-\ 'ml': 'margin-left:|;',
-\ 'ml:a': 'margin-left:auto;',
-\ 'p': 'padding:|;',
-\ 'p:0': 'padding:0;',
-\ 'p:2': 'padding:0 0;',
-\ 'p:3': 'padding:0 0 0;',
-\ 'p:4': 'padding:0 0 0 0;',
-\ 'pt': 'padding-top:|;',
-\ 'pr': 'padding-right:|;',
-\ 'pb': 'padding-bottom:|;',
-\ 'pl': 'padding-left:|;',
-\ 'w': 'width:|;',
-\ 'w:a': 'width:auto;',
-\ 'h': 'height:|;',
-\ 'h:a': 'height:auto;',
-\ 'maw': 'max-width:|;',
-\ 'maw:n': 'max-width:none;',
-\ 'mah': 'max-height:|;',
-\ 'mah:n': 'max-height:none;',
-\ 'miw': 'min-width:|;',
-\ 'mih': 'min-height:|;',
-\ 'o': 'outline:|;',
-\ 'o:n': 'outline:none;',
-\ 'oo': 'outline-offset:|;',
-\ 'ow': 'outline-width:|;',
-\ 'os': 'outline-style:|;',
-\ 'oc': 'outline-color:#000;',
-\ 'oc:i': 'outline-color:invert;',
-\ 'bd': 'border:|;',
-\ 'bd+': 'border:1px solid #000;',
-\ 'bd:n': 'border:none;',
-\ 'bdbk': 'border-break:|;',
-\ 'bdbk:c': 'border-break:close;',
-\ 'bdcl': 'border-collapse:|;',
-\ 'bdcl:c': 'border-collapse:collapse;',
-\ 'bdcl:s': 'border-collapse:separate;',
-\ 'bdc': 'border-color:#000;',
-\ 'bdi': 'border-image:url(|);',
-\ 'bdi:n': 'border-image:none;',
-\ 'bdi:w': '-webkit-border-image:url(|) 0 0 0 0 stretch stretch;',
-\ 'bdi:m': '-moz-border-image:url(|) 0 0 0 0 stretch stretch;',
-\ 'bdti': 'border-top-image:url(|);',
-\ 'bdti:n': 'border-top-image:none;',
-\ 'bdri': 'border-right-image:url(|);',
-\ 'bdri:n': 'border-right-image:none;',
-\ 'bdbi': 'border-bottom-image:url(|);',
-\ 'bdbi:n': 'border-bottom-image:none;',
-\ 'bdli': 'border-left-image:url(|);',
-\ 'bdli:n': 'border-left-image:none;',
-\ 'bdci': 'border-corner-image:url(|);',
-\ 'bdci:n': 'border-corner-image:none;',
-\ 'bdci:c': 'border-corner-image:continue;',
-\ 'bdtli': 'border-top-left-image:url(|);',
-\ 'bdtli:n': 'border-top-left-image:none;',
-\ 'bdtli:c': 'border-top-left-image:continue;',
-\ 'bdtri': 'border-top-right-image:url(|);',
-\ 'bdtri:n': 'border-top-right-image:none;',
-\ 'bdtri:c': 'border-top-right-image:continue;',
-\ 'bdbri': 'border-bottom-right-image:url(|);',
-\ 'bdbri:n': 'border-bottom-right-image:none;',
-\ 'bdbri:c': 'border-bottom-right-image:continue;',
-\ 'bdbli': 'border-bottom-left-image:url(|);',
-\ 'bdbli:n': 'border-bottom-left-image:none;',
-\ 'bdbli:c': 'border-bottom-left-image:continue;',
-\ 'bdf': 'border-fit:|;',
-\ 'bdf:c': 'border-fit:clip;',
-\ 'bdf:r': 'border-fit:repeat;',
-\ 'bdf:sc': 'border-fit:scale;',
-\ 'bdf:st': 'border-fit:stretch;',
-\ 'bdf:ow': 'border-fit:overwrite;',
-\ 'bdf:of': 'border-fit:overflow;',
-\ 'bdf:sp': 'border-fit:space;',
-\ 'bdl': 'border-left:|;',
-\ 'bdl:a': 'border-length:auto;',
-\ 'bdsp': 'border-spacing:|;',
-\ 'bds': 'border-style:|;',
-\ 'bds:n': 'border-style:none;',
-\ 'bds:h': 'border-style:hidden;',
-\ 'bds:dt': 'border-style:dotted;',
-\ 'bds:ds': 'border-style:dashed;',
-\ 'bds:s': 'border-style:solid;',
-\ 'bds:db': 'border-style:double;',
-\ 'bds:dtds': 'border-style:dot-dash;',
-\ 'bds:dtdtds': 'border-style:dot-dot-dash;',
-\ 'bds:w': 'border-style:wave;',
-\ 'bds:g': 'border-style:groove;',
-\ 'bds:r': 'border-style:ridge;',
-\ 'bds:i': 'border-style:inset;',
-\ 'bds:o': 'border-style:outset;',
-\ 'bdw': 'border-width:|;',
-\ 'bdt': 'border-top:|;',
-\ 'bdt+': 'border-top:1px solid #000;',
-\ 'bdt:n': 'border-top:none;',
-\ 'bdtw': 'border-top-width:|;',
-\ 'bdts': 'border-top-style:|;',
-\ 'bdts:n': 'border-top-style:none;',
-\ 'bdtc': 'border-top-color:#000;',
-\ 'bdr': 'border-right:|;',
-\ 'bdr+': 'border-right:1px solid #000;',
-\ 'bdr:n': 'border-right:none;',
-\ 'bdrw': 'border-right-width:|;',
-\ 'bdrs': 'border-right-style:|;',
-\ 'bdrs:n': 'border-right-style:none;',
-\ 'bdrc': 'border-right-color:#000;',
-\ 'bdb': 'border-bottom:|;',
-\ 'bdb+': 'border-bottom:1px solid #000;',
-\ 'bdb:n': 'border-bottom:none;',
-\ 'bdbw': 'border-bottom-width:|;',
-\ 'bdbs': 'border-bottom-style:|;',
-\ 'bdbs:n': 'border-bottom-style:none;',
-\ 'bdbc': 'border-bottom-color:#000;',
-\ 'bdln': 'border-length:|;',
-\ 'bdl+': 'border-left:1px solid #000;',
-\ 'bdl:n': 'border-left:none;',
-\ 'bdlw': 'border-left-width:|;',
-\ 'bdls': 'border-left-style:|;',
-\ 'bdls:n': 'border-left-style:none;',
-\ 'bdlc': 'border-left-color:#000;',
-\ 'bdrus': 'border-radius:|;',
-\ 'bdtrrs': 'border-top-right-radius:|;',
-\ 'bdtlrs': 'border-top-left-radius:|;',
-\ 'bdbrrs': 'border-bottom-right-radius:|;',
-\ 'bdblrs': 'border-bottom-left-radius:|;',
-\ 'bg': 'background:|;',
-\ 'bg+': 'background:#FFF url(|) 0 0 no-repeat;',
-\ 'bg:n': 'background:none;',
-\ 'bg:ie': 'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=''|x.png'');',
-\ 'bgc': 'background-color:#FFF;',
-\ 'bgi': 'background-image:url(|);',
-\ 'bgi:n': 'background-image:none;',
-\ 'bgr': 'background-repeat:|;',
-\ 'bgr:n': 'background-repeat:no-repeat;',
-\ 'bgr:x': 'background-repeat:repeat-x;',
-\ 'bgr:y': 'background-repeat:repeat-y;',
-\ 'bga': 'background-attachment:|;',
-\ 'bga:f': 'background-attachment:fixed;',
-\ 'bga:s': 'background-attachment:scroll;',
-\ 'bgp': 'background-position:0 0;',
-\ 'bgpx': 'background-position-x:|;',
-\ 'bgpy': 'background-position-y:|;',
-\ 'bgbk': 'background-break:|;',
-\ 'bgbk:bb': 'background-break:bounding-box;',
-\ 'bgbk:eb': 'background-break:each-box;',
-\ 'bgbk:c': 'background-break:continuous;',
-\ 'bgcp': 'background-clip:|;',
-\ 'bgcp:bb': 'background-clip:border-box;',
-\ 'bgcp:pb': 'background-clip:padding-box;',
-\ 'bgcp:cb': 'background-clip:content-box;',
-\ 'bgcp:nc': 'background-clip:no-clip;',
-\ 'bgo': 'background-origin:|;',
-\ 'bgo:pb': 'background-origin:padding-box;',
-\ 'bgo:bb': 'background-origin:border-box;',
-\ 'bgo:cb': 'background-origin:content-box;',
-\ 'bgz': 'background-size:|;',
-\ 'bgz:a': 'background-size:auto;',
-\ 'bgz:ct': 'background-size:contain;',
-\ 'bgz:cv': 'background-size:cover;',
-\ 'c': 'color:#000;',
-\ 'tbl': 'table-layout:|;',
-\ 'tbl:a': 'table-layout:auto;',
-\ 'tbl:f': 'table-layout:fixed;',
-\ 'cps': 'caption-side:|;',
-\ 'cps:t': 'caption-side:top;',
-\ 'cps:b': 'caption-side:bottom;',
-\ 'ec': 'empty-cells:|;',
-\ 'ec:s': 'empty-cells:show;',
-\ 'ec:h': 'empty-cells:hide;',
-\ 'lis': 'list-style:|;',
-\ 'lis:n': 'list-style:none;',
-\ 'lisp': 'list-style-position:|;',
-\ 'lisp:i': 'list-style-position:inside;',
-\ 'lisp:o': 'list-style-position:outside;',
-\ 'list': 'list-style-type:|;',
-\ 'list:n': 'list-style-type:none;',
-\ 'list:d': 'list-style-type:disc;',
-\ 'list:c': 'list-style-type:circle;',
-\ 'list:s': 'list-style-type:square;',
-\ 'list:dc': 'list-style-type:decimal;',
-\ 'list:dclz': 'list-style-type:decimal-leading-zero;',
-\ 'list:lr': 'list-style-type:lower-roman;',
-\ 'list:ur': 'list-style-type:upper-roman;',
-\ 'lisi': 'list-style-image:|;',
-\ 'lisi:n': 'list-style-image:none;',
-\ 'q': 'quotes:|;',
-\ 'q:n': 'quotes:none;',
-\ 'q:ru': 'quotes:''\00AB'' ''\00BB'' ''\201E'' ''\201C'';',
-\ 'q:en': 'quotes:''\201C'' ''\201D'' ''\2018'' ''\2019'';',
-\ 'ct': 'content:|;',
-\ 'ct:n': 'content:normal;',
-\ 'ct:oq': 'content:open-quote;',
-\ 'ct:noq': 'content:no-open-quote;',
-\ 'ct:cq': 'content:close-quote;',
-\ 'ct:ncq': 'content:no-close-quote;',
-\ 'ct:a': 'content:attr(|);',
-\ 'ct:c': 'content:counter(|);',
-\ 'ct:cs': 'content:counters(|);',
-\ 'coi': 'counter-increment:|;',
-\ 'cor': 'counter-reset:|;',
-\ 'va': 'vertical-align:|;',
-\ 'va:sup': 'vertical-align:super;',
-\ 'va:t': 'vertical-align:top;',
-\ 'va:tt': 'vertical-align:text-top;',
-\ 'va:m': 'vertical-align:middle;',
-\ 'va:bl': 'vertical-align:baseline;',
-\ 'va:b': 'vertical-align:bottom;',
-\ 'va:tb': 'vertical-align:text-bottom;',
-\ 'va:sub': 'vertical-align:sub;',
-\ 'ta': 'text-align:|;',
-\ 'ta:l': 'text-align:left;',
-\ 'ta:c': 'text-align:center;',
-\ 'ta:r': 'text-align:right;',
-\ 'tal': 'text-align-last:|;',
-\ 'tal:a': 'text-align-last:auto;',
-\ 'tal:l': 'text-align-last:left;',
-\ 'tal:c': 'text-align-last:center;',
-\ 'tal:r': 'text-align-last:right;',
-\ 'td': 'text-decoration:|;',
-\ 'td:n': 'text-decoration:none;',
-\ 'td:u': 'text-decoration:underline;',
-\ 'td:o': 'text-decoration:overline;',
-\ 'td:l': 'text-decoration:line-through;',
-\ 'te': 'text-emphasis:|;',
-\ 'te:n': 'text-emphasis:none;',
-\ 'te:ac': 'text-emphasis:accent;',
-\ 'te:dt': 'text-emphasis:dot;',
-\ 'te:c': 'text-emphasis:circle;',
-\ 'te:ds': 'text-emphasis:disc;',
-\ 'te:b': 'text-emphasis:before;',
-\ 'te:a': 'text-emphasis:after;',
-\ 'th': 'text-height:|;',
-\ 'th:a': 'text-height:auto;',
-\ 'th:f': 'text-height:font-size;',
-\ 'th:t': 'text-height:text-size;',
-\ 'th:m': 'text-height:max-size;',
-\ 'ti': 'text-indent:|;',
-\ 'ti:-': 'text-indent:-9999px;',
-\ 'tj': 'text-justify:|;',
-\ 'tj:a': 'text-justify:auto;',
-\ 'tj:iw': 'text-justify:inter-word;',
-\ 'tj:ii': 'text-justify:inter-ideograph;',
-\ 'tj:ic': 'text-justify:inter-cluster;',
-\ 'tj:d': 'text-justify:distribute;',
-\ 'tj:k': 'text-justify:kashida;',
-\ 'tj:t': 'text-justify:tibetan;',
-\ 'to': 'text-outline:|;',
-\ 'to+': 'text-outline:0 0 #000;',
-\ 'to:n': 'text-outline:none;',
-\ 'tr': 'text-replace:|;',
-\ 'tr:n': 'text-replace:none;',
-\ 'tt': 'text-transform:|;',
-\ 'tt:n': 'text-transform:none;',
-\ 'tt:c': 'text-transform:capitalize;',
-\ 'tt:u': 'text-transform:uppercase;',
-\ 'tt:l': 'text-transform:lowercase;',
-\ 'tw': 'text-wrap:|;',
-\ 'tw:n': 'text-wrap:normal;',
-\ 'tw:no': 'text-wrap:none;',
-\ 'tw:u': 'text-wrap:unrestricted;',
-\ 'tw:s': 'text-wrap:suppress;',
-\ 'tsh': 'text-shadow:|;',
-\ 'tsh+': 'text-shadow:0 0 0 #000;',
-\ 'tsh:n': 'text-shadow:none;',
-\ 'lh': 'line-height:|;',
-\ 'whs': 'white-space:|;',
-\ 'whs:n': 'white-space:normal;',
-\ 'whs:p': 'white-space:pre;',
-\ 'whs:nw': 'white-space:nowrap;',
-\ 'whs:pw': 'white-space:pre-wrap;',
-\ 'whs:pl': 'white-space:pre-line;',
-\ 'whsc': 'white-space-collapse:|;',
-\ 'whsc:n': 'white-space-collapse:normal;',
-\ 'whsc:k': 'white-space-collapse:keep-all;',
-\ 'whsc:l': 'white-space-collapse:loose;',
-\ 'whsc:bs': 'white-space-collapse:break-strict;',
-\ 'whsc:ba': 'white-space-collapse:break-all;',
-\ 'wob': 'word-break:|;',
-\ 'wob:n': 'word-break:normal;',
-\ 'wob:k': 'word-break:keep-all;',
-\ 'wob:l': 'word-break:loose;',
-\ 'wob:bs': 'word-break:break-strict;',
-\ 'wob:ba': 'word-break:break-all;',
-\ 'wos': 'word-spacing:|;',
-\ 'wow': 'word-wrap:|;',
-\ 'wow:nm': 'word-wrap:normal;',
-\ 'wow:n': 'word-wrap:none;',
-\ 'wow:u': 'word-wrap:unrestricted;',
-\ 'wow:s': 'word-wrap:suppress;',
-\ 'lts': 'letter-spacing:|;',
-\ 'f': 'font:|;',
-\ 'f+': 'font:1em Arial,sans-serif;',
-\ 'fw': 'font-weight:|;',
-\ 'fw:n': 'font-weight:normal;',
-\ 'fw:b': 'font-weight:bold;',
-\ 'fw:br': 'font-weight:bolder;',
-\ 'fw:lr': 'font-weight:lighter;',
-\ 'fs': 'font-style:|;',
-\ 'fs:n': 'font-style:normal;',
-\ 'fs:i': 'font-style:italic;',
-\ 'fs:o': 'font-style:oblique;',
-\ 'fv': 'font-variant:|;',
-\ 'fv:n': 'font-variant:normal;',
-\ 'fv:sc': 'font-variant:small-caps;',
-\ 'fz': 'font-size:|;',
-\ 'fza': 'font-size-adjust:|;',
-\ 'fza:n': 'font-size-adjust:none;',
-\ 'ff': 'font-family:|;',
-\ 'ff:s': 'font-family:serif;',
-\ 'ff:ss': 'font-family:sans-serif;',
-\ 'ff:c': 'font-family:cursive;',
-\ 'ff:f': 'font-family:fantasy;',
-\ 'ff:m': 'font-family:monospace;',
-\ 'fef': 'font-effect:|;',
-\ 'fef:n': 'font-effect:none;',
-\ 'fef:eg': 'font-effect:engrave;',
-\ 'fef:eb': 'font-effect:emboss;',
-\ 'fef:o': 'font-effect:outline;',
-\ 'fem': 'font-emphasize:|;',
-\ 'femp': 'font-emphasize-position:|;',
-\ 'femp:b': 'font-emphasize-position:before;',
-\ 'femp:a': 'font-emphasize-position:after;',
-\ 'fems': 'font-emphasize-style:|;',
-\ 'fems:n': 'font-emphasize-style:none;',
-\ 'fems:ac': 'font-emphasize-style:accent;',
-\ 'fems:dt': 'font-emphasize-style:dot;',
-\ 'fems:c': 'font-emphasize-style:circle;',
-\ 'fems:ds': 'font-emphasize-style:disc;',
-\ 'fsm': 'font-smooth:|;',
-\ 'fsm:a': 'font-smooth:auto;',
-\ 'fsm:n': 'font-smooth:never;',
-\ 'fsm:aw': 'font-smooth:always;',
-\ 'fst': 'font-stretch:|;',
-\ 'fst:n': 'font-stretch:normal;',
-\ 'fst:uc': 'font-stretch:ultra-condensed;',
-\ 'fst:ec': 'font-stretch:extra-condensed;',
-\ 'fst:c': 'font-stretch:condensed;',
-\ 'fst:sc': 'font-stretch:semi-condensed;',
-\ 'fst:se': 'font-stretch:semi-expanded;',
-\ 'fst:e': 'font-stretch:expanded;',
-\ 'fst:ee': 'font-stretch:extra-expanded;',
-\ 'fst:ue': 'font-stretch:ultra-expanded;',
-\ 'op': 'opacity:|;',
-\ 'op:ie': 'filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=100);',
-\ 'op:ms': '-ms-filter:''progid:DXImageTransform.Microsoft.Alpha(Opacity=100)'';',
-\ 'rz': 'resize:|;',
-\ 'rz:n': 'resize:none;',
-\ 'rz:b': 'resize:both;',
-\ 'rz:h': 'resize:horizontal;',
-\ 'rz:v': 'resize:vertical;',
-\ 'cur': 'cursor:|;',
-\ 'cur:a': 'cursor:auto;',
-\ 'cur:d': 'cursor:default;',
-\ 'cur:c': 'cursor:crosshair;',
-\ 'cur:ha': 'cursor:hand;',
-\ 'cur:he': 'cursor:help;',
-\ 'cur:m': 'cursor:move;',
-\ 'cur:p': 'cursor:pointer;',
-\ 'cur:t': 'cursor:text;',
-\ 'pgbb': 'page-break-before:|;',
-\ 'pgbb:au': 'page-break-before:auto;',
-\ 'pgbb:al': 'page-break-before:always;',
-\ 'pgbb:l': 'page-break-before:left;',
-\ 'pgbb:r': 'page-break-before:right;',
-\ 'pgbi': 'page-break-inside:|;',
-\ 'pgbi:au': 'page-break-inside:auto;',
-\ 'pgbi:av': 'page-break-inside:avoid;',
-\ 'pgba': 'page-break-after:|;',
-\ 'pgba:au': 'page-break-after:auto;',
-\ 'pgba:al': 'page-break-after:always;',
-\ 'pgba:l': 'page-break-after:left;',
-\ 'pgba:r': 'page-break-after:right;',
-\ 'orp': 'orphans:|;',
-\ 'wid': 'widows:|;'
-\ },
-\ 'filters': 'fc'
-\ },
-\ 'html': {
-\ 'snippets': {
-\ 'cc:ie6': "<!--[if lte IE 6]>\n\t${child}|\n<![endif]-->",
-\ 'cc:ie': "<!--[if IE]>\n\t${child}|\n<![endif]-->",
-\ 'cc:noie': "<!--[if !IE]><!-->\n\t${child}|\n<!--<![endif]-->",
-\ 'html:4t': "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n"
-\ ."<html lang=\"${lang}\">\n"
-\ ."<head>\n"
-\ ." <meta http-equiv=\"Content-Type\" content=\"text/html;charset=${charset}\">\n"
-\ ." <title></title>\n"
-\ ."</head>\n"
-\ ."<body>\n\t${child}|\n</body>\n"
-\ ."</html>",
-\ 'html:4s': "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n"
-\ ."<html lang=\"${lang}\">\n"
-\ ."<head>\n"
-\ ." <meta http-equiv=\"Content-Type\" content=\"text/html;charset=${charset}\">\n"
-\ ." <title></title>\n"
-\ ."</head>\n"
-\ ."<body>\n\t${child}|\n</body>\n"
-\ ."</html>",
-\ 'html:xt': "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n"
-\ ."<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"${lang}\">\n"
-\ ."<head>\n"
-\ ." <meta http-equiv=\"Content-Type\" content=\"text/html;charset=${charset}\" />\n"
-\ ." <title></title>\n"
-\ ."</head>\n"
-\ ."<body>\n\t${child}|\n</body>\n"
-\ ."</html>",
-\ 'html:xs': "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n"
-\ ."<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"${lang}\">\n"
-\ ."<head>\n"
-\ ." <meta http-equiv=\"Content-Type\" content=\"text/html;charset=${charset}\" />\n"
-\ ." <title></title>\n"
-\ ."</head>\n"
-\ ."<body>\n\t${child}|\n</body>\n"
-\ ."</html>",
-\ 'html:xxs': "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n"
-\ ."<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"${lang}\">\n"
-\ ."<head>\n"
-\ ." <meta http-equiv=\"Content-Type\" content=\"text/html;charset=${charset}\" />\n"
-\ ." <title></title>\n"
-\ ."</head>\n"
-\ ."<body>\n\t${child}|\n</body>\n"
-\ ."</html>",
-\ 'html:5': "<!DOCTYPE HTML>\n"
-\ ."<html lang=\"${lang}\">\n"
-\ ."<head>\n"
-\ ." <meta charset=\"${charset}\">\n"
-\ ." <title></title>\n"
-\ ."</head>\n"
-\ ."<body>\n\t${child}|\n</body>\n"
-\ ."</html>"
-\ },
-\ 'default_attributes': {
-\ 'a': {'href': ''},
-\ 'a:link': {'href': 'http://|'},
-\ 'a:mail': {'href': 'mailto:|'},
-\ 'abbr': {'title': ''},
-\ 'acronym': {'title': ''},
-\ 'base': {'href': ''},
-\ 'bdo': {'dir': ''},
-\ 'bdo:r': {'dir': 'rtl'},
-\ 'bdo:l': {'dir': 'ltr'},
-\ 'del': {'datetime': '${datetime}'},
-\ 'ins': {'datetime': '${datetime}'},
-\ 'link:css': [{'rel': 'stylesheet'}, {'type': 'text/css'}, {'href': '|style.css'}, {'media': 'all'}],
-\ 'link:print': [{'rel': 'stylesheet'}, {'type': 'text/css'}, {'href': '|print.css'}, {'media': 'print'}],
-\ 'link:favicon': [{'rel': 'shortcut icon'}, {'type': 'image/x-icon'}, {'href': '|favicon.ico'}],
-\ 'link:touch': [{'rel': 'apple-touch-icon'}, {'href': '|favicon.png'}],
-\ 'link:rss': [{'rel': 'alternate'}, {'type': 'application/rss+xml'}, {'title': 'RSS'}, {'href': '|rss.xml'}],
-\ 'link:atom': [{'rel': 'alternate'}, {'type': 'application/atom+xml'}, {'title': 'Atom'}, {'href': 'atom.xml'}],
-\ 'meta:utf': [{'http-equiv': 'Content-Type'}, {'content': 'text/html;charset=UTF-8'}],
-\ 'meta:win': [{'http-equiv': 'Content-Type'}, {'content': 'text/html;charset=Win-1251'}],
-\ 'meta:compat': [{'http-equiv': 'X-UA-Compatible'}, {'content': 'IE=7'}],
-\ 'style': {'type': 'text/css'},
-\ 'script': {'type': 'text/javascript'},
-\ 'script:src': [{'type': 'text/javascript'}, {'src': ''}],
-\ 'img': [{'src': ''}, {'alt': ''}],
-\ 'iframe': [{'src': ''}, {'frameborder': '0'}],
-\ 'embed': [{'src': ''}, {'type': ''}],
-\ 'object': [{'data': ''}, {'type': ''}],
-\ 'param': [{'name': ''}, {'value': ''}],
-\ 'map': {'name': ''},
-\ 'area': [{'shape': ''}, {'coords': ''}, {'href': ''}, {'alt': ''}],
-\ 'area:d': [{'shape': 'default'}, {'href': ''}, {'alt': ''}],
-\ 'area:c': [{'shape': 'circle'}, {'coords': ''}, {'href': ''}, {'alt': ''}],
-\ 'area:r': [{'shape': 'rect'}, {'coords': ''}, {'href': ''}, {'alt': ''}],
-\ 'area:p': [{'shape': 'poly'}, {'coords': ''}, {'href': ''}, {'alt': ''}],
-\ 'link': [{'rel': 'stylesheet'}, {'href': ''}],
-\ 'form': {'action': ''},
-\ 'form:get': {'action': '', 'method': 'get'},
-\ 'form:post': {'action': '', 'method': 'post'},
-\ 'form:upload': {'action': '', 'method': 'post', 'enctype': 'multipart/form-data'},
-\ 'label': {'for': ''},
-\ 'input': {'type': ''},
-\ 'input:hidden': [{'type': 'hidden'}, {'name': ''}],
-\ 'input:h': [{'type': 'hidden'}, {'name': ''}],
-\ 'input:text': [{'type': 'text'}, {'name': ''}, {'id': ''}],
-\ 'input:t': [{'type': 'text'}, {'name': ''}, {'id': ''}],
-\ 'input:search': [{'type': 'search'}, {'name': ''}, {'id': ''}],
-\ 'input:email': [{'type': 'email'}, {'name': ''}, {'id': ''}],
-\ 'input:url': [{'type': 'url'}, {'name': ''}, {'id': ''}],
-\ 'input:password': [{'type': 'password'}, {'name': ''}, {'id': ''}],
-\ 'input:p': [{'type': 'password'}, {'name': ''}, {'id': ''}],
-\ 'input:datetime': [{'type': 'datetime'}, {'name': ''}, {'id': ''}],
-\ 'input:date': [{'type': 'date'}, {'name': ''}, {'id': ''}],
-\ 'input:datetime-local': [{'type': 'datetime-local'}, {'name': ''}, {'id': ''}],
-\ 'input:month': [{'type': 'month'}, {'name': ''}, {'id': ''}],
-\ 'input:week': [{'type': 'week'}, {'name': ''}, {'id': ''}],
-\ 'input:time': [{'type': 'time'}, {'name': ''}, {'id': ''}],
-\ 'input:number': [{'type': 'number'}, {'name': ''}, {'id': ''}],
-\ 'input:color': [{'type': 'color'}, {'name': ''}, {'id': ''}],
-\ 'input:checkbox': [{'type': 'checkbox'}, {'name': ''}, {'id': ''}],
-\ 'input:c': [{'type': 'checkbox'}, {'name': ''}, {'id': ''}],
-\ 'input:radio': [{'type': 'radio'}, {'name': ''}, {'id': ''}],
-\ 'input:r': [{'type': 'radio'}, {'name': ''}, {'id': ''}],
-\ 'input:range': [{'type': 'range'}, {'name': ''}, {'id': ''}],
-\ 'input:file': [{'type': 'file'}, {'name': ''}, {'id': ''}],
-\ 'input:f': [{'type': 'file'}, {'name': ''}, {'id': ''}],
-\ 'input:submit': [{'type': 'submit'}, {'value': ''}],
-\ 'input:s': [{'type': 'submit'}, {'value': ''}],
-\ 'input:image': [{'type': 'image'}, {'src': ''}, {'alt': ''}],
-\ 'input:i': [{'type': 'image'}, {'src': ''}, {'alt': ''}],
-\ 'input:reset': [{'type': 'reset'}, {'value': ''}],
-\ 'input:button': [{'type': 'button'}, {'value': ''}],
-\ 'input:b': [{'type': 'button'}, {'value': ''}],
-\ 'select': [{'name': ''}, {'id': ''}],
-\ 'option': {'value': ''},
-\ 'textarea': [{'name': ''}, {'id': ''}, {'cols': '30'}, {'rows': '10'}],
-\ 'menu:context': {'type': 'context'},
-\ 'menu:c': {'type': 'context'},
-\ 'menu:toolbar': {'type': 'toolbar'},
-\ 'menu:t': {'type': 'toolbar'},
-\ 'video': {'src': ''},
-\ 'audio': {'src': ''},
-\ 'html:xml': [{'xmlns': 'http://www.w3.org/1999/xhtml'}, {'xml:lang': '${lang}'}]
-\ },
-\ 'aliases': {
-\ 'link:*': 'link',
-\ 'meta:*': 'meta',
-\ 'area:*': 'area',
-\ 'bdo:*': 'bdo',
-\ 'form:*': 'form',
-\ 'input:*': 'input',
-\ 'script:*': 'script',
-\ 'html:*': 'html',
-\ 'a:*': 'a',
-\ 'menu:*': 'menu',
-\ 'bq': 'blockquote',
-\ 'acr': 'acronym',
-\ 'fig': 'figure',
-\ 'ifr': 'iframe',
-\ 'emb': 'embed',
-\ 'obj': 'object',
-\ 'src': 'source',
-\ 'cap': 'caption',
-\ 'colg': 'colgroup',
-\ 'fst': 'fieldset',
-\ 'btn': 'button',
-\ 'optg': 'optgroup',
-\ 'opt': 'option',
-\ 'tarea': 'textarea',
-\ 'leg': 'legend',
-\ 'sect': 'section',
-\ 'art': 'article',
-\ 'hdr': 'header',
-\ 'ftr': 'footer',
-\ 'adr': 'address',
-\ 'dlg': 'dialog',
-\ 'str': 'strong',
-\ 'sty': 'style',
-\ 'prog': 'progress',
-\ 'fset': 'fieldset',
-\ 'datag': 'datagrid',
-\ 'datal': 'datalist',
-\ 'kg': 'keygen',
-\ 'out': 'output',
-\ 'det': 'details',
-\ 'cmd': 'command'
-\ },
-\ 'expandos': {
-\ 'ol': 'ol>li',
-\ 'ul': 'ul>li',
-\ 'dl': 'dl>dt+dd',
-\ 'map': 'map>area',
-\ 'table': 'table>tr>td',
-\ 'colgroup': 'colgroup>col',
-\ 'colg': 'colgroup>col',
-\ 'tr': 'tr>td',
-\ 'select': 'select>option',
-\ 'optgroup': 'optgroup>option',
-\ 'optg': 'optgroup>option'
-\ },
-\ 'empty_elements': 'area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed,keygen,command',
-\ 'block_elements': 'address,applet,blockquote,button,center,dd,del,dir,div,dl,dt,fieldset,form,frameset,hr,iframe,ins,isindex,link,map,menu,noframes,noscript,object,ol,p,pre,script,table,tbody,td,tfoot,th,thead,tr,ul,h1,h2,h3,h4,h5,h6,style',
-\ 'inline_elements': 'a,abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,small,span,strike,strong,sub,sup,textarea,tt,u,var',
-\ },
-\ 'xsl': {
-\ 'extends': 'html',
-\ 'default_attributes': {
-\ 'tmatch': [{'match': ''}, {'mode': ''}],
-\ 'tname': [{'name': ''}],
-\ 'xsl:when': {'test': ''},
-\ 'var': [{'name': ''}, {'select': ''}],
-\ 'vari': {'name': ''},
-\ 'if': {'test': ''},
-\ 'call': {'name': ''},
-\ 'attr': {'name': ''},
-\ 'wp': [{'name': ''}, {'select': ''}],
-\ 'par': [{'name': ''}, {'select': ''}],
-\ 'val': {'select': ''},
-\ 'co': {'select': ''},
-\ 'each': {'select': ''},
-\ 'ap': [{'select': ''}, {'mode': ''}]
-\ },
-\ 'aliases': {
-\ 'tmatch': 'xsl:template',
-\ 'tname': 'xsl:template',
-\ 'var': 'xsl:variable',
-\ 'vari': 'xsl:variable',
-\ 'if': 'xsl:if',
-\ 'call': 'xsl:call-template',
-\ 'wp': 'xsl:with-param',
-\ 'par': 'xsl:param',
-\ 'val': 'xsl:value-of',
-\ 'attr': 'xsl:attribute',
-\ 'co' : 'xsl:copy-of',
-\ 'each' : 'xsl:for-each',
-\ 'ap' : 'xsl:apply-templates'
-\ },
-\ 'expandos': {
-\ 'choose': 'xsl:choose>xsl:when+xsl:otherwise'
-\ }
-\ },
-\ 'haml': {
-\ 'extends': 'html'
-\ },
-\ 'xhtml': {
-\ 'extends': 'html'
-\ },
-\ 'mustache': {
-\ 'extends': 'html'
-\ }
-\}
-
-if exists('g:user_zen_settings')
- call s:zen_mergeConfig(s:zen_settings, g:user_zen_settings)
-endif
-
-let &cpo = s:save_cpo
-unlet s:save_cpo
-
-" vim:set et:
diff --git a/vim/bundle/foldtext b/vim/bundle/foldtext
new file mode 160000
+Subproject dd25d369d3d06170e4987ba46b170df1debc7c4
diff --git a/vim/bundle/fuzzyfinder b/vim/bundle/fuzzyfinder
new file mode 160000
+Subproject b9f165970346df55862853dd83c8a4f2b2b7026
diff --git a/vim/bundle/git b/vim/bundle/git
new file mode 160000
+Subproject 291cbe97f2c367f40360949f19b4fa8fb0740e9
diff --git a/vim/bundle/l9 b/vim/bundle/l9
new file mode 160000
+Subproject c822b05ee0886f9a9703227dc85a6d47612c4bf
diff --git a/vim/bundle/pathogen b/vim/bundle/pathogen
new file mode 160000
+Subproject ab64b4ddd0c184a528780b498a0b0a5b40248f7
diff --git a/vim/bundle/perl b/vim/bundle/perl
new file mode 160000
+Subproject 252d7ab03f65f8a6b14ef4bb604b2f931a543f4
diff --git a/vim/bundle/snipmate b/vim/bundle/snipmate
new file mode 160000
+Subproject f5a75d075d3c005ebe69e3f5e56cf99516e8aa3
diff --git a/vim/bundle/supertab b/vim/bundle/supertab
new file mode 160000
+Subproject dbc0f1d60d319daeeb437b03fd95f92e5a00ca3
diff --git a/vim/bundle/tcomment b/vim/bundle/tcomment
new file mode 160000
+Subproject 9869c70206ba7398a0912e14f968a13cd53d41c
diff --git a/vim/bundle/textobj b/vim/bundle/textobj
new file mode 160000
+Subproject d7057e8c68f4e0cc400fa193bf915fd4a73b1bc
diff --git a/vim/bundle/yankring b/vim/bundle/yankring
new file mode 160000
+Subproject 280ca1b471bd3a0d2347735e8fcbd03a53f2c6a
diff --git a/vim/bundle/zencoding b/vim/bundle/zencoding
new file mode 160000
+Subproject 115f68df621483b309019d13544902071d58743
diff --git a/vim/doc/ft-gitcommit-plugin.txt b/vim/doc/ft-gitcommit-plugin.txt
deleted file mode 100644
index 0d89ae1..0000000
--- a/vim/doc/ft-gitcommit-plugin.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-GIT COMMIT *ft-gitcommit-plugin*
-
-One command, :DiffGitCached, is provided to show a diff of the current commit
-in the preview window. It is equivalent to calling "git diff --cached" plus
-any arguments given to the command.
diff --git a/vim/doc/fuf.jax b/vim/doc/fuf.jax
deleted file mode 100644
index 403872f..0000000
--- a/vim/doc/fuf.jax
+++ /dev/null
@@ -1,1405 +0,0 @@
-*fuf.jax* ãƒãƒƒãƒ•ã‚¡/ファイル/ãã®ä»–ã‚’ã€ã‚ã„ã¾ã„検索
-
- Copyright (c) 2007-2010 Takeshi NISHIDA
-
-FuzzyFinder *fuzzyfinder* *fuf*
-
-æ¦‚è¦ |fuf-introduction|
-インストール |fuf-installation|
-使ã„æ–¹ |fuf-usage|
-モード |fuf-modes|
-詳細ãªãƒˆãƒ”ック |fuf-detailed-topics|
-コマンド |fuf-commands|
-オプション |fuf-options|
-VIMRC ã®ä¾‹ |fuf-vimrc-example|
-SPECIAL THANKS |fuf-thanks|
-CHANGELOG |fuf-changelog|
-ã‚ã°ã†ã¨ |fuf-about|
-
-==============================================================================
-æ¦‚è¦ *fuf-introduction*
-
-FuzzyFinder ã¯ãƒãƒƒãƒ•ã‚¡/ファイル/コマンド/ブックマーク/ã‚¿ã‚°ã«ç´ æ—©ãアクセスã™ã‚‹
-ãŸã‚ã®æ‰‹æ®µã‚’æä¾›ã—ã¾ã™ã€‚入力ã•ã‚ŒãŸãƒ‘ターンã‹ã‚‰å¤‰æ›ã•ã‚ŒãŸã‚ã„ã¾ã„パターンã¾ãŸã¯
-部分一致パターンã§æ¤œç´¢ã‚’è¡Œã„ã¾ã™ã€‚
-
- 入力パターン ã‚ã„ã¾ã„パターン 部分一致パターン ~
->
- abc *a*b*c* *abc*
- dir/file dir/*f*i*l*e* dir/*file*
- d*r/file d*r/*f*i*l*e* d*r/*file*
- ../**/s ../**/*s* ../**/*s*
- (** : å†å¸°æ¤œç´¢)
-<
-次ã®ã‚ˆã†ãªå ´é¢ã§æœ‰ç”¨ã§ã™:
-
- "./AhLongLongLongLongLongFile.txt"
- "./AhLongLongLongLongLongName.txt"
- "./OhLongLongLongLongLongFile.txt"
- "./OhLongLongLongLongLongName.txt" <- 欲ã—ã„ファイル :-O
-
-"ON" ã¨å…¥åŠ›ã™ã‚Œã° "OhLongLongLongLongLongName.txt" ãŒé¸æŠžã§ãã¾ã™. :-D
-
-FuzzyFinder ãŒæ¤œç´¢ã§ãる対象ã¯æ¬¡ã®é€šã‚Šã§ã™:
- - ãƒãƒƒãƒ•ã‚¡
- - ファイル
- - ディレクトリ
- - 最近使ã£ãŸãƒ•ã‚¡ã‚¤ãƒ«
- - 最近使ã£ãŸãƒ•ã‚¡ã‚¤ãƒ«ã®è¿‘ãã®ãƒ•ã‚¡ã‚¤ãƒ«
- - 最近使ã£ãŸã‚³ãƒžãƒ³ãƒ‰ãƒ©ã‚¤ãƒ³
- - ブックマークã•ã‚ŒãŸãƒ•ã‚¡ã‚¤ãƒ«
- - ブックマークã•ã‚ŒãŸãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒª
- - ã‚¿ã‚°
- - タグファイルã«å«ã¾ã‚Œã‚‹ãƒ•ã‚¡ã‚¤ãƒ«
- - ジャンプリスト
- - ãƒã‚§ãƒ³ã‚¸ãƒªã‚¹ãƒˆ
- - ãƒãƒƒãƒ•ã‚¡ã®è¡Œ
- - quickfix
- - ヘルプ
-
-FuzzyFinder 㯠ファイルを検索ã—ãŸã‚Šã‚¢ã‚¤ãƒ†ãƒ ã‚’é¸æŠžã™ã‚‹ã‚·ã‚¹ãƒ†ãƒ ã‚’利用ã™ã‚‹ãŸã‚ã®
-API ã‚‚æä¾›ã—ã¾ã™ã€‚
-
-FuzzyFinder ã¯ãƒžãƒ«ãƒãƒã‚¤ãƒˆæ–‡å­—をサãƒãƒ¼ãƒˆã—ã¦ã„ã¾ã™ã€‚
-
-
-==============================================================================
-インストール *fuf-installation*
-
-ZIPファイルをランタイムディレクトリã«å±•é–‹ã—ã¾ã™ã€‚
-
-以下ã®ã‚ˆã†ã«ãƒ•ã‚¡ã‚¤ãƒ«ãŒé…ç½®ã•ã‚Œã‚‹ã¯ãšã§ã™ã€‚
->
- <ランタイムディレクトリ>/plugin/fuf.vim
- <ランタイムディレクトリ>/doc/fuf.txt
- ...
-<
-ã‚‚ã—ランタイムディレクトリãŒå¤šæ•°ã®ãƒ—ラグインã§ã”ã¡ã‚ƒã”ã¡ã‚ƒã«ãªã‚‹ã®ãŒå«Œãªã‚‰ã€å„
-プラグインを個別ã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã«é…ç½®ã—ã€ãã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã®ãƒ‘スを 'runtimepath'
-ã«è¿½åŠ ã—ã¦ãã ã•ã„。アンインストールも楽ã«ãªã‚Šã¾ã™ã€‚
-
-ãã®å¾Œã€ãƒ˜ãƒ«ãƒ—を有効ã«ã™ã‚‹ãŸã‚ã«ã‚¿ã‚°ãƒ•ã‚¡ã‚¤ãƒ«ã‚’æ›´æ–°ã—ã¦ãã ã•ã„。詳ã—ãã¯
-|add-local-help|ã‚’å‚ç…§ã—ã¦ãã ã•ã„。
-
-å¿…è¦ãªã‚‚ã®: ~
-
-- L9 library (vimscript #3252)
-
-
-==============================================================================
-使ã„æ–¹ *fuf-usage*
-
-次ã®ã‚³ãƒžãƒ³ãƒ‰ã§ FuzzyFinder ã‚’èµ·å‹•ã—ã¾ã™:
-
- コマンド モード ~
- |:FufBuffer| - Buffer モード (|fuf-buffer-mode|)
- |:FufFile| - File モード (|fuf-file-mode|)
- |:FufCoverageFile| - Coverage-File モード (|fuf-coveragefile-mode|)
- |:FufDir| - Directory モード (|fuf-dir-mode|)
- |:FufMruFile| - MRU-File モード (|fuf-mrufile-mode|)
- |:FufMruCmd| - MRU-Command モード (|fuf-mrucmd-mode|)
- |:FufBookmarkFile| - Bookmark-File モード (|fuf-bookmarkfile-mode|)
- |:FufBookmarkDir| - Bookmark-Dir モード (|fuf-bookmarkdir-mode|)
- |:FufTag| - Tag モード (|fuf-tag-mode|)
- |:FufBufferTag| - Buffer-Tag モード (|fuf-buffertag-mode|)
- |:FufTaggedFile| - Tagged-File モード (|fuf-taggedfile-mode|)
- |:FufJumpList| - Jump-List モード (|fuf-jumplist-mode|)
- |:FufChangeList| - Change-List モード (|fuf-changelist-mode|)
- |:FufQuickfix| - Quickfix モード (|fuf-quickfix-mode|)
- |:FufLine| - Line モード (|fuf-line-mode|)
- |:FufHelp| - Help モード (|fuf-help-mode|)
-
-ã“れらã®ã‚³ãƒžãƒ³ãƒ‰ã‚’押ã—ã‚„ã™ã„キーã«ãƒžãƒƒãƒ”ングã™ã‚‹ã“ã¨ã‚’推奨ã—ã¾ã™ã€‚
-
-ã“れらã®ã‚³ãƒžãƒ³ãƒ‰ã‚’実行ã™ã‚‹ã¨ãƒ‘ターンを入力ã™ã‚‹ãŸã‚ã®1è¡Œã®ãƒãƒƒãƒ•ã‚¡ã‚’é–‹ãã€ã‚¤ãƒ³
-サートモードを開始ã—ã¾ã™ã€‚
-
-FuzzyFinder ã¯å…¥åŠ›ã•ã‚ŒãŸãƒ‘ターンã«ãƒžãƒƒãƒã™ã‚‹ã‚¢ã‚¤ãƒ†ãƒ ã‚’検索ã—ã€ãれを補完メニュ
-ーã«è¡¨ç¤ºã—ã¾ã™ã€‚パターンマッãƒãƒ³ã‚°ã®è©³ç´°ã¯|fuf-search-patterns|ã‚’å‚ç…§ã—ã¦ãã 
-ã•ã„。
-
-多ãã®ã‚¢ã‚¤ãƒ†ãƒ ãŒãƒžãƒƒãƒãƒ³ã‚°ã™ã‚‹å ´åˆã€FuzzyFinder ã¯ãƒ¬ã‚¹ãƒãƒ³ã‚¹ã‚’å‘上ã•ã›ã‚‹ãŸã‚ã«
-列挙ã™ã‚‹ã‚¢ã‚¤ãƒ†ãƒ ã®æ•°(|g:fuf_enumeratingLimit|)を制é™ã—ã€ãã®éš›ã€å…¥åŠ›ã•ã‚ŒãŸãƒ‘ã‚¿
-ーンを"Error" グループã§ãƒã‚¤ãƒ©ã‚¤ãƒˆã—ã¾ã™ã€‚
-
-補完メニューã®æœ€åˆã®ã‚¢ã‚¤ãƒ†ãƒ ã¯è‡ªå‹•çš„ã«é¸æŠžçŠ¶æ…‹ã«ãªã‚Šã¾ã™ã€‚
-
-<C-w> ã§å…¥åŠ›ãƒ‘ターンã‹ã‚‰ã‚«ãƒ¼ã‚½ãƒ«å‰ã®ã€ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªåãªã©ã®ã²ã¨ã‹ãŸã¾ã‚Šã‚’削除ã™
-ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚
-
-<C-s> (|g:fuf_keyPrevPattern|) 㨠<C-^> (|g:fuf_keyNextPattern|) ã§ã€å±¥æ­´ã‹ã‚‰
-éŽåŽ»ã«å…¥åŠ›ã—ãŸãƒ‘ターンを呼ã³å‡ºã™ã“ã¨ãŒã§ãã¾ã™ã€‚
-
-ã„ã‚ã„ã‚ãªæ–¹æ³•ã§ã€é¸æŠžã•ã‚ŒãŸã‚¢ã‚¤ãƒ†ãƒ ã‚’é–‹ãã“ã¨ãŒã§ãã¾ã™:
-
- <CR> (|g:fuf_keyOpen|) - ç›´å‰ã®ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã§é–‹ãã¾ã™ã€‚
- <C-j> (|g:fuf_keyOpenSplit|) - ウィンドウを分割ã—ã¦é–‹ãã¾ã™ã€‚
- <C-k> (|g:fuf_keyOpenVsplit|) - ウィンドウを垂直分割ã—ã¦é–‹ãã¾ã™ã€‚
- <C-l> (|g:fuf_keyOpenTabpage|) - 別ã®ã‚¿ãƒ–ページã§é–‹ãã¾ã™ã€‚
-
-キャンセルã—ã¦ç›´å‰ã®ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã«æˆ»ã‚‹ã«ã¯ã€ã‚¤ãƒ³ã‚µãƒ¼ãƒˆãƒ¢ãƒ¼ãƒ‰ã‚’抜ã‘ã¦ãã ã•ã„。
-
-<C-\><C-\> (|g:fuf_keySwitchMatching|) ã§ã€æ¤œç´¢æ–¹æ³•ã‚’ã‚ã„ã¾ã„マッãƒãƒ³ã‚°ã¾ãŸã¯
-部分一致マッãƒãƒ³ã‚°ã«äº¤äº’ã«åˆ‡ã‚Šæ›¿ãˆã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚
-
-<C-t> (|g:fuf_keyNextMode|) 㨠<C-y> (|g:fuf_keyPrevMode|) ã§ã€ã‚¤ãƒ³ã‚µãƒ¼ãƒˆãƒ¢ãƒ¼
-ドを抜ã‘ã‚‹ã“ã¨ãªãカレントモードを切り替ãˆã‚‹ã“ã¨ãŒå‡ºæ¥ã¾ã™ã€‚
-
-ã„ãã¤ã‹ã®ãƒ¢ãƒ¼ãƒ‰ã§ã¯ã€é¸æŠžã•ã‚ŒãŸã‚¢ã‚¤ãƒ†ãƒ ã‚’ <C-@> (|g:fuf_keyPreview|) ã§ãƒ—レビ
-ューã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚åŒã˜ã‚¢ã‚¤ãƒ†ãƒ ã§ã‚­ãƒ¼ã‚’ç¹°ã‚Šè¿”ã™ã“ã¨ã§åˆ¥ã®æƒ…報を表示ã•ã›ã‚‹
-ã“ã¨ãŒã§ãã¾ã™ã€‚プレビューをサãƒãƒ¼ãƒˆã™ã‚‹ãƒ¢ãƒ¼ãƒ‰ã‚’èµ·å‹•ã™ã‚‹ã¨ã€ã‚³ãƒžãƒ³ãƒ‰ãƒ©ã‚¤ãƒ³ã®é«˜
-ã•ãŒ|g:fuf_previewHeight|ã«ãªã‚Šã¾ã™ã€‚ã“ã®æ©Ÿèƒ½ã¯|g:fuf_previewHeight|ãŒ0ã§ã¯ãª
-ã„å ´åˆã€æœ‰åŠ¹ã«ãªã‚Šã¾ã™ã€‚
-
-
-==============================================================================
-モード *fuf-modes*
-
- *fuf-buffer-mode*
-Buffer モード ~
-
-ã“ã®ãƒ¢ãƒ¼ãƒ‰ã¯ãƒãƒƒãƒ•ã‚¡ã‚’é¸æŠžã—ã¦é–‹ãインターフェースをæä¾›ã—ã¾ã™ã€‚
-
-Buffer モード中㫠<C-]> (|g:fuf_buffer_keyDelete|) を押ã™ã¨é¸æŠžã—ãŸãƒãƒƒãƒ•ã‚¡ã‚’
-削除ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚
-
- *fuf-file-mode*
-File モード ~
-
-ã“ã®ãƒ¢ãƒ¼ãƒ‰ã¯ãƒ•ã‚¡ã‚¤ãƒ«ãƒ„リーã‹ã‚‰ãƒ•ã‚¡ã‚¤ãƒ«ã‚’検索ã—ã¦é–‹ãインターフェースをæä¾›ã—ã¾
-ã™ã€‚
-
- *fuf-coveragefile-mode*
-Coverage-File モード ~
-
-ã“ã®ãƒ¢ãƒ¼ãƒ‰ã¯ã‚らã‹ã˜ã‚設定ã—ãŸæ¤œç´¢å¯¾è±¡ã®å…¨ãƒ•ã‚¡ã‚¤ãƒ«ã‹ã‚‰ãƒ•ã‚¡ã‚¤ãƒ«ã‚’é¸æŠžã—ã¦é–‹ãイ
-ンターフェースをæä¾›ã—ã¾ã™ã€‚
-
-デフォルトã§ã¯ã‚«ãƒ¬ãƒ³ãƒˆãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªä»¥ä¸‹ã®å…¨ãƒ•ã‚¡ã‚¤ãƒ«ã‚’列挙ã—ã¾ã™ã€‚
-(|g:fuf_coveragefile_globPatterns|)
-
-ä»–ã®æ¤œç´¢å¯¾è±¡ã‚’検索ã—ãŸã„å ´åˆã€|FufCoverageFileRegister|コマンドã§æ–°ã—ã„検索対
-象を登録ã—ã€|FufCoverageFileChange|コマンドã§æ¤œç´¢å¯¾è±¡ã‚’é¸æŠžã—㦠Coverage-File
-モードを起動ã—ã¾ã™ã€‚
-
-加ãˆã¦ã€|fuf#setOneTimeVariables()|関数を使ã†æ–¹æ³•ã‚‚ã‚ã‚Šã¾ã™ã€‚
-
-
-例: .hã¨.cファイルã ã‘検索ã™ã‚‹:
->
- call fuf#setOneTimeVariables(['g:fuf_coveragefile_globPatterns', ['**/*.h', '**/*.c']])
- \ | FufCoverageFile
-<
-例: デフォルトã®æ¤œç´¢å¯¾è±¡ã«åŠ ãˆã¦ãƒ›ãƒ¼ãƒ ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã‚‚検索ã™ã‚‹:
->
- call fuf#setOneTimeVariables(['g:fuf_coveragefile_globPatterns', g:fuf_coveragefile_globPatterns + ['~/**/.*', '~/**/*']])
- \ | FufCoverageFile
-<
-
- *fuf-dir-mode*
-Directory モード ~
-
-ã“ã®ãƒ¢ãƒ¼ãƒ‰ã¯ãƒ•ã‚¡ã‚¤ãƒ«ãƒ„リーã‹ã‚‰ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã‚’検索ã—ã¦ã‚«ãƒ¬ãƒ³ãƒˆãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã‚’変更
-ã™ã‚‹ã‚¤ãƒ³ã‚¿ãƒ¼ãƒ•ã‚§ãƒ¼ã‚¹ã‚’æä¾›ã—ã¾ã™ã€‚
-
- *fuf-mrufile-mode*
-MRU-File モード ~
-
-ã“ã®ãƒ¢ãƒ¼ãƒ‰ã¯æœ€è¿‘使ã£ãŸãƒ•ã‚¡ã‚¤ãƒ«ã‚’é¸æŠžã—ã¦é–‹ãインターフェースをæä¾›ã—ã¾ã™ã€‚
-
-ã“ã®ãƒ¢ãƒ¼ãƒ‰ä¸­ã« <C-]> (|g:fuf_mrufile_keyExpand|) を押ã™ã¨ã€æœ€è¿‘使ã£ãŸãƒ•ã‚¡ã‚¤ãƒ«
-ã®ä»˜è¿‘ã«ã‚るファイルを検索ã—ã¾ã™ã€‚ã“ã®ã‚­ãƒ¼ã‚’押ã™æ¯Žã«ã€æ¤œç´¢ç¯„囲をディレクトリツ
-リーã®ä¸Šä¸‹ã«1階層ãšã¤åºƒã’ã¾ã™ã€‚
-
-|BufEnter| 㨠|BufWritePost| ã§è¡Œã†å‡¦ç†ãŒãƒ‘フォーマンス上ã®å•é¡Œã‚’èµ·ã“ã—ã†ã‚‹ã®
-ã§ã€ãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã§ã¯ç„¡åŠ¹åŒ–ã™ã‚‹ãƒ¢ãƒ¼ãƒ‰ã«æŒ‡å®šã•ã‚Œã¦ã„ã¾ã™ã€‚(|g:fuf_modesDisable|)
-
-See also: |FufMruFileInCwd|
-
- *fuf-mrucmd-mode*
-MRU-Command モード ~
-
-ã“ã®ãƒ¢ãƒ¼ãƒ‰ã¯æœ€è¿‘使ã£ãŸã‚³ãƒžãƒ³ãƒ‰ãƒ©ã‚¤ãƒ³ã‚’é¸æŠžã—ã¦é–‹ãインターフェースをæä¾›ã—ã¾ã™
-。
-ã“ã®ãƒ¢ãƒ¼ãƒ‰ã«å¿…è¦ãªã€ã‚³ãƒžãƒ³ãƒ‰ãƒ©ã‚¤ãƒ³ãƒ¢ãƒ¼ãƒ‰ã® <CR> ã®ãƒžãƒƒãƒ”ングã«å‰¯ä½œç”¨ãŒã‚ã‚‹ã®ã§ã€
-ã€ãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã§ã¯ç„¡åŠ¹åŒ–ã™ã‚‹ãƒ¢ãƒ¼ãƒ‰ã«æŒ‡å®šã•ã‚Œã¦ã„ã¾ã™ã€‚(|g:fuf_modesDisable|)
-
- *fuf-bookmarkfile-mode*
-Bookmark-File モード ~
-
-ã“ã®ãƒ¢ãƒ¼ãƒ‰ã¯äº‹å‰ã«è¿½åŠ ã—ãŸãƒ–ックマークをé¸æŠžã—ã¦ãã®è¡Œã¸ã‚¸ãƒ£ãƒ³ãƒ—ã™ã‚‹ã‚¤ãƒ³ã‚¿ãƒ¼ãƒ•
-ェースをæä¾›ã—ã¾ã™ã€‚
-
-|:FufBookmarkFileAdd|コマンドã§ã‚«ãƒ¼ã‚½ãƒ«ã®ã‚る行をブックマークã«è¿½åŠ ã§ãã¾ã™ã€‚
-ã“ã®ã‚³ãƒžãƒ³ãƒ‰ã‚’実行ã™ã‚‹ã¨ã€ãƒ–ックマークåã®å…¥åŠ›ã‚’求ã‚られã¾ã™ã€‚
-
-FuzzyFinder ã¯ã‚¸ãƒ£ãƒ³ãƒ—ã™ã‚‹è¡Œç•ªå·ã‚’調整ã—ã¾ã™ã€‚ブックマークã•ã‚ŒãŸè¡ŒãŒãƒ–ックマー
-クã•ã‚ŒãŸã¨ãã®ãƒ‘ターンã¨ãƒžãƒƒãƒã—ãªã„å ´åˆã€FuzzyFinder ã¯ãƒ–ックマークã•ã‚ŒãŸä½ç½®
-ã®å‘¨è¾ºã§ãƒžãƒƒãƒã™ã‚‹è¡Œã‚’探ã—ã¾ã™ã€‚ãªã®ã§ãƒ–ックマークã—ãŸè¡ŒãŒå¤šå°‘移動ã—ã¦ã„ãŸã¨ã—
-ã¦ã‚‚ã€ãã“ã§ã‚¸ãƒ£ãƒ³ãƒ—ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚ブックマークã—ãŸè¡Œç•ªå·ã¸èª¿æ•´ã›ãšã«ã‚¸ãƒ£
-ンプã—ãŸã„å ´åˆã€|g:fuf_bookmarkfile_searchRange|ã‚’ 0 ã«è¨­å®šã—ã¦ãã ã•ã„。
-
-ã“ã®ãƒ¢ãƒ¼ãƒ‰ä¸­ã« <C-]> (|g:fuf_bookmarkfile_keyDelete|) を押ã™ã¨é¸æŠžã—ãŸãƒ–ックマ
-ークを削除ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚
-
- *fuf-bookmarkdir-mode*
-Bookmark-Dir モード ~
-
-ã“ã®ãƒ¢ãƒ¼ãƒ‰ã¯äº‹å‰ã«è¿½åŠ ã—ãŸãƒ–ックマークをé¸æŠžã—ã¦ã‚«ãƒ¬ãƒ³ãƒˆãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã‚’変更ã™ã‚‹
-ã™ã‚‹ã‚¤ãƒ³ã‚¿ãƒ¼ãƒ•ã‚§ãƒ¼ã‚¹ã‚’æä¾›ã—ã¾ã™ã€‚
-
-|:FufBookmarkDirAdd|コマンドã§ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã‚’ブックマークã«è¿½åŠ ã§ãã¾ã™ã€‚ã“ã®ã‚³
-マンドを実行ã™ã‚‹ã¨ã€ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã®ãƒ‘スã¨ãƒ–ックマークåã®å…¥åŠ›ã‚’求ã‚られã¾ã™ã€‚
-
-ã“ã®ãƒ¢ãƒ¼ãƒ‰ä¸­ã« <C-]> (|g:fuf_bookmarkdir_keyDelete|) を押ã™ã¨é¸æŠžã—ãŸãƒ–ックマ
-ークを削除ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚
-
- *fuf-tag-mode*
-Tag モード ~
-
-ã“ã®ãƒ¢ãƒ¼ãƒ‰ã¯ã‚¿ã‚°ã‚’é¸æŠžã—ã¦ãã®å®šç¾©ã¸ã‚¸ãƒ£ãƒ³ãƒ—ã™ã‚‹ã‚¤ãƒ³ã‚¿ãƒ¼ãƒ•ã‚§ãƒ¼ã‚¹ã‚’æä¾›ã—ã¾ã™ã€‚
-
-以下㯠<C-]> ã‚’ç½®ãæ›ãˆã‚‹ãƒžãƒƒãƒ”ングã§ã™ã€‚
->
- noremap <silent> <C-]> :FufTagWithCursorWord!<CR>
-<
-
- *fuf-buffertag-mode*
-Buffer-Tag モード ~
-
-ã“ã®ãƒ¢ãƒ¼ãƒ‰ã¯ã‚«ãƒ¬ãƒ³ãƒˆãƒãƒƒãƒ•ã‚¡ã¾ãŸã¯å…¨ãƒãƒƒãƒ•ã‚¡ã®ã‚¿ã‚°ã‚’é¸æŠžã—ã¦ãã®å®šç¾©ã¸ã‚¸ãƒ£ãƒ³ãƒ—
-ã™ã‚‹ã‚¤ãƒ³ã‚¿ãƒ¼ãƒ•ã‚§ãƒ¼ã‚¹ã‚’æä¾›ã—ã¾ã™ã€‚
-
-ã‚¿ã‚°ã®ãƒªã‚¹ãƒˆã¯FuzzyFinderã®èµ·å‹•æ™‚ã«ãã®å ´ã§ä½œæˆã•ã‚Œã‚‹ã®ã§ã€å‰ã‚‚ã£ã¦tagsファイ
-ルを作æˆã™ã‚‹å¿…è¦ã¯ã‚ã‚Šã¾ã›ã‚“。
-
-|FufBufferTag|ã¯ã‚«ãƒ¬ãƒ³ãƒˆãƒãƒƒãƒ•ã‚¡ã‚’対象ã«ã—ã€|FufBufferTagAll|ã¯å…¨ãƒãƒƒãƒ•ã‚¡ã‚’対
-象ã«ã—ã¾ã™ã€‚
-
-以下㯠<C-]> ã‚’ç½®ãæ›ãˆã‚‹ãƒžãƒƒãƒ”ングã§ã™:
->
- nnoremap <silent> <C-]> :FufBufferTagWithCursorWord!<CR>
- vnoremap <silent> <C-]> :FufBufferTagAllWithSelectedText!<CR>
-<
-ã¾ãŸã¯
->
- nnoremap <silent> <C-]> :FufBufferTagAllWithCursorWord!<CR>
- vnoremap <silent> <C-]> :FufBufferTagAllWithSelectedText!<CR>
-<
-ã“ã®ãƒ¢ãƒ¼ãƒ‰ã¯ taglist.vim (vimscript #273) ã«ã‚¤ãƒ³ã‚¹ãƒ‘イアã•ã‚Œã¾ã—ãŸã€‚コードもå‚
-考ã«ã—ã¦ã„ã¾ã™ã€‚
-
- *fuf-taggedfile-mode*
-Tagged-File モード ~
-
-ã“ã®ãƒ¢ãƒ¼ãƒ‰ã¯ã‚¿ã‚°ãƒ•ã‚¡ã‚¤ãƒ«ã«å«ã¾ã‚Œã‚‹ãƒ•ã‚¡ã‚¤ãƒ«ã‚’é¸æŠžã—ã¦é–‹ãインターフェースをæä¾›
-ã—ã¾ã™ã€‚
-
- *fuf-jumplist-mode*
-Jump-List モード ~
-
-ã“ã®ãƒ¢ãƒ¼ãƒ‰ã¯ã‚«ãƒ¬ãƒ³ãƒˆã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã®|jumplist|ã‹ã‚‰é¸æŠžã—ãŸä½ç½®ã¸ã‚¸ãƒ£ãƒ³ãƒ—ã™ã‚‹ã‚¤ãƒ³ã‚¿
-ーフェースをæä¾›ã—ã¾ã™ã€‚
-
- *fuf-changelist-mode*
-Change-List モード ~
-
-ã“ã®ãƒ¢ãƒ¼ãƒ‰ã¯ã‚«ãƒ¬ãƒ³ãƒˆãƒãƒƒãƒ•ã‚¡ã®|changelist|ã‹ã‚‰é¸æŠžã—ãŸä½ç½®ã¸ã‚¸ãƒ£ãƒ³ãƒ—ã™ã‚‹ã‚¤ãƒ³ã‚¿
-ーフェースをæä¾›ã—ã¾ã™ã€‚
-
- *fuf-quickfix-mode*
-Quickfix モード ~
-
-ã“ã®ãƒ¢ãƒ¼ãƒ‰ã¯|quickfix|リストã‹ã‚‰é¸æŠžã—ãŸä½ç½®ã¸ã‚¸ãƒ£ãƒ³ãƒ—ã™ã‚‹ã‚¤ãƒ³ã‚¿ãƒ¼ãƒ•ã‚§ãƒ¼ã‚¹ã‚’æ
-ä¾›ã—ã¾ã™ã€‚
-
- *fuf-line-mode*
-Line モード ~
-
-ã“ã®ãƒ¢ãƒ¼ãƒ‰ã¯ã‚«ãƒ¬ãƒ³ãƒˆãƒãƒƒãƒ•ã‚¡ã®è¡Œã‚’é¸æŠžã—ã¦ã‚¸ãƒ£ãƒ³ãƒ—ã™ã‚‹ã‚¤ãƒ³ã‚¿ãƒ¼ãƒ•ã‚§ãƒ¼ã‚¹ã‚’æä¾›ã—
-ã¾ã™ã€‚
-
- *fuf-help-mode*
-Help モード ~
-
-ã“ã®ãƒ¢ãƒ¼ãƒ‰ã¯ãƒ˜ãƒ«ãƒ—ã‚¿ã‚°ã‚’é¸æŠžã—ã¦ãã®ãƒ˜ãƒ«ãƒ—ページã¸ã‚¸ãƒ£ãƒ³ãƒ—ã™ã‚‹ã‚¤ãƒ³ã‚¿ãƒ¼ãƒ•ã‚§ãƒ¼ã‚¹
-ã‚’æä¾›ã—ã¾ã™ã€‚
-
- *fuf-givenfile-mode*
-Given-File モード ~
-
-ã“ã®ãƒ¢ãƒ¼ãƒ‰ã¯ä¸Žãˆã‚‰ã‚ŒãŸãƒªã‚¹ãƒˆã‹ã‚‰é¸æŠžã•ã‚ŒãŸãƒ•ã‚¡ã‚¤ãƒ«ã‚’é–‹ã API ã‚’æä¾›ã—ã¾ã™ã€‚
-
-API 関数:
->
- function fuf#givenfile#launch(
- \ initialPattern, partialMatching, prompt, items)
-<
- initialPattern - FuzzyFinder 起動直後ã«æŒ¿å…¥ã•ã‚Œã‚‹æ–‡å­—列
- partialMatching - ã‚ã„ã¾ã„検索ã§ã¯ãªã部分一致検索を行ã†ã‹
- prompt - プロンプト文字列
- items - アイテムã®ãƒªã‚¹ãƒˆ
-
-利用例:
->
- " ドットファイルを開ã
- call fuf#givenfile#launch('', 0, '>', split(glob('~/.*'), "\n"))
-<
-
- *fuf-givendir-mode*
-Given-Directory モード ~
-
-ã“ã®ãƒ¢ãƒ¼ãƒ‰ã¯ä¸Žãˆã‚‰ã‚ŒãŸãƒªã‚¹ãƒˆã‹ã‚‰é¸æŠžã•ã‚ŒãŸãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã«ã‚«ãƒ¬ãƒ³ãƒˆãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã‚’
-変更ã™ã‚‹ API ã‚’æä¾›ã—ã¾ã™ã€‚
-
-API 関数:
->
- function fuf#givendir#launch(
- \ initialPattern, partialMatching, prompt, items)
-<
- initialPattern - FuzzyFinder 起動直後ã«æŒ¿å…¥ã•ã‚Œã‚‹æ–‡å­—列
- partialMatching - ã‚ã„ã¾ã„検索ã§ã¯ãªã部分一致検索を行ã†ã‹
- prompt - プロンプト文字列
- items - アイテムã®ãƒªã‚¹ãƒˆ
-
-
-利用例:
->
- " ランタイムディレクトリã®ã©ã‚Œã‹ã‚’カレントディレクトリã«ã™ã‚‹
- call fuf#givendir#launch('', 0, '>', split(&runtimepath, ','))
-<
-
- *fuf-givencmd-mode*
-Given-Command モード ~
-
-ã“ã®ãƒ¢ãƒ¼ãƒ‰ã¯ä¸Žãˆã‚‰ã‚ŒãŸãƒªã‚¹ãƒˆã‹ã‚‰é¸æŠžã•ã‚ŒãŸã‚³ãƒžãƒ³ãƒ‰ã‚’実行ã™ã‚‹ API ã‚’æä¾›ã—ã¾ã™ã€‚
-
-é¸æŠžã•ã‚ŒãŸã‚³ãƒžãƒ³ãƒ‰ã¯ feedkeys() ã«ã‚ˆã£ã¦å®Ÿè¡Œã•ã‚Œã‚‹ã®ã§ã€ãƒŽãƒ¼ãƒžãƒ«ãƒ¢ãƒ¼ãƒ‰ã§ã®ä¸€é€£
-ã®ã‚­ãƒ¼å…¥åŠ›ã‚’エミュレートã•ã›ã‚‹ã“ã¨ã‚‚å¯èƒ½ã§ã™ã€‚
-
-API 関数:
->
- function fuf#givencmd#launch(
- \ initialPattern, partialMatching, prompt, items)
-<
- initialPattern - FuzzyFinder 起動直後ã«æŒ¿å…¥ã•ã‚Œã‚‹æ–‡å­—列
- partialMatching - ã‚ã„ã¾ã„検索ã§ã¯ãªã部分一致検索を行ã†ã‹
- prompt - プロンプト文字列
- items - アイテムã®ãƒªã‚¹ãƒˆ
-
-
-利用例:
->
- function GetAllCommands()
- redir => commands
- silent command
- redir END
- return map((split(commands, "\n")[3:]),
- \ '":" . matchstr(v:val, ''^....\zs\S*'')')
- endfunction
-
- " ユーザー定義コマンドをé¸æŠžã—ã¦å®Ÿè¡Œ
- call fuf#givencmd#launch('', 0, '>', GetAllCommands())
-
-<
-
- *fuf-callbackfile-mode*
-Callback-File モード ~
-
-ã“ã®ãƒ¢ãƒ¼ãƒ‰ã¯ãƒ•ã‚¡ã‚¤ãƒ«ã‚’検索ã—ã¦é¸æŠžã•ã‚ŒãŸãƒ•ã‚¡ã‚¤ãƒ«ãƒ‘スを得る API ã‚’æä¾›ã—ã¾ã™ã€‚
-
-API 関数:
->
- function fuf#callbackfile#launch(
- \ initialPattern, partialMatching, prompt, exclude, listener)
-<
- initialPattern - FuzzyFinder 起動直後ã«æŒ¿å…¥ã•ã‚Œã‚‹æ–‡å­—列
- partialMatching - ã‚ã„ã¾ã„検索ã§ã¯ãªã部分一致検索を行ã†ã‹
- prompt - プロンプト文字列
- exclude - 補完リストã‹ã‚‰é™¤å¤–ã—ãŸã„アイテムã®æ­£è¦è¡¨ç¾ãƒ‘ターン
- listener - 'onComplete' 㨠'onAbort' ã‚’æŒã¤|Dictionary|。ã“ã‚Œ
- ら㯠FuzzyFinder 終了時ã«å‘¼ã°ã‚Œã¾ã™ã€‚
- listener.onComplete(item, method) ã¯é¸æŠžãŒå®Œäº†ã—ãŸã¨
- ãã€é¸æŠžã•ã‚ŒãŸã‚¢ã‚¤ãƒ†ãƒ åã¨ã‚ªãƒ¼ãƒ—ン方å¼ç•ªå·ã®2引数ã¨
- å…±ã«å‘¼ã°ã‚Œã¾ã™ã€‚listener.onAbort() ã¯é¸æŠžã‚’中止ã—ãŸ
- ã¨ãã«å‘¼ã°ã‚Œã¾ã™ã€‚
-
-利用例:
->
- let listener = {}
-
- function listener.onComplete(item, method)
- echo "Item: " . a:item . "\nMethod: " . a:method
- endfunction
-
- function listener.onAbort()
- echo "Abort"
- endfunction
-
- " カレントディレクトリã‹ã‚‰ãƒ•ã‚¡ã‚¤ãƒ«ã‚’é¸æŠž
- call fuf#callbackfile#launch('', 0, '>', '', listener)
-
- " ホームディレクトリã‹ã‚‰ãƒ•ã‚¡ã‚¤ãƒ«ã‚’é¸æŠž
- call fuf#callbackfile#launch('~/', 0, '>', '', listener)
-<
-
- *fuf-callbackitem-mode*
-Callback-Item モード ~
-
-ã“ã®ãƒ¢ãƒ¼ãƒ‰ã¯ä¸Žãˆã‚‰ã‚ŒãŸãƒªã‚¹ãƒˆã‹ã‚‰é¸æŠžã•ã‚ŒãŸã‚¢ã‚¤ãƒ†ãƒ ã‚’å¾—ã‚‹ãŸã‚ã® API ã‚’æä¾›ã—ã¾
-ã™ã€‚
-
-API 関数:
->
- function fuf#callbackitem#launch(
- \ initialPattern, partialMatching, prompt, listener, items, forPath)
-<
- initialPattern - FuzzyFinder 起動直後ã«æŒ¿å…¥ã•ã‚Œã‚‹æ–‡å­—列
- partialMatching - ã‚ã„ã¾ã„検索ã§ã¯ãªã部分一致検索を行ã†ã‹
- prompt - プロンプト文字列
- listener - 'onComplete' 㨠'onAbort' ã‚’æŒã¤|Dictionary|。ã“ã‚Œ
- ら㯠FuzzyFinder 終了時ã«å‘¼ã°ã‚Œã¾ã™ã€‚
- listener.onComplete(item, method) ã¯é¸æŠžãŒå®Œäº†ã—ãŸã¨
- ãã€é¸æŠžã•ã‚ŒãŸã‚¢ã‚¤ãƒ†ãƒ åã¨ã‚ªãƒ¼ãƒ—ン方å¼ç•ªå·ã®2引数ã¨
- å…±ã«å‘¼ã°ã‚Œã¾ã™ã€‚listener.onAbort() ã¯é¸æŠžã‚’中止ã—ãŸ
- ã¨ãã«å‘¼ã°ã‚Œã¾ã™ã€‚
- items - アイテムã®ãƒªã‚¹ãƒˆ
- forPath - ファイルé¸æŠžã«ç‰¹åŒ–ã—ãŸãƒžãƒƒãƒãƒ³ã‚°ã‚’利用ã™ã‚‹ã‹
-
-利用例:
->
- let listener = {}
-
- function listener.onComplete(item, method)
- echo "Item: " . a:item . "\nMethod: " . a:method
- endfunction
-
- function listener.onAbort()
- echo "Abort"
- endfunction
-
- " 与ãˆã‚‰ã‚ŒãŸãƒªã‚¹ãƒˆã‹ã‚‰ã‚¢ã‚¤ãƒ†ãƒ ã‚’é¸æŠž
- call fuf#callbackitem#launch('', 0, '>', listener, ['ed', 'vi', 'vim'], 0)
-
- " 与ãˆã‚‰ã‚ŒãŸãƒªã‚¹ãƒˆã‹ã‚‰ãƒ•ã‚¡ã‚¤ãƒ«ã‚’é¸æŠž
- call fuf#callbackitem#launch('', 0, '>', listener, ['../foo/bar', 'baz'], 1)
-<
-
-==============================================================================
-詳細ãªãƒˆãƒ”ック *fuf-detailed-topics*
-
- *fuf-setting-one-time-option* *fuf#setOneTimeVariables()*
-一回é™ã‚Šã®ã‚ªãƒ—ションã®è¨­å®š ~
-
-次回㮠FuzzyFinder 用ã«ä¸€å›žé™ã‚Šã®ã‚ªãƒ—ションを設定ã—ãŸã„ã¨ãã€
-|fuf#setOneTimeVariables()|関数ãŒå½¹ã«ç«‹ã¡ã¾ã™ã€‚ã“ã®é–¢æ•°ã¯æ¬¡ã®ã‚ˆã†ã«ã—ã¦ä½¿ã„ã¾
-ã™:
->
- call fuf#setOneTimeVariables(['g:fuf_ignoreCase', 0], ['&lines', 50])
-<
-ã“ã®é–¢æ•°ã¯ 0 個以上ã®å¼•æ•°ã‚’å–ã‚Šã€å„々ã¯å¤‰æ•°åã¨å€¤ã®ãƒšã‚¢ã§ã™ã€‚指定ã•ã‚ŒãŸã‚ªãƒ—ã‚·
-ョンã¯æ¬¡å›ž FuzzyFinder ãŒèµ·å‹•ã—ãŸã¨ãã«å®Ÿéš›ã«è¨­å®šã•ã‚Œã€çµ‚了ã™ã‚‹ã¨ãã«å¾©å…ƒã•ã‚Œ
-ã¾ã™ã€‚
-
- *fuf-search-patterns*
-検索パターン ~
-
-検索パターンã¨ã—ã¦ã€ä¸€ã¤ã®ãƒ—ライマリパターンã¨0個以上ã®çµžã‚Šè¾¼ã¿ãƒ‘ターンを入力
-ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚入力パターン㯠";" (|g:fuf_patternSeparator|) ã§åŒºåˆ‡ã‚‰ã‚Œã€
-最åˆã®ãƒ‘ターンãŒãƒ—ライマリパターンã«ãªã‚Šã€æ®‹ã‚Šã®ãƒ‘ターンãŒçµžã‚Šè¾¼ã¿ãƒ‘ターンã«ãª
-ã‚Šã¾ã™ã€‚
->
- プライマリ 絞り込㿠絞り込ã¿
- |----------| |-------| |----|
- >MruFile>bookmark.vim;autoload/;/home/
-<
-プライマリパターンã«ãƒžãƒƒãƒã—ãŸã‚¢ã‚¤ãƒ†ãƒ ã®ãƒªã‚¹ãƒˆã‚’別ã®ãƒ‘ターンã§çµžã‚Šè¾¼ã‚€ãŸã‚ã«ã€
-絞り込ã¿ãƒ‘ターンを利用ã—ã¾ã™ã€‚
-
-プライマリパターンã§ã¯ã€ã‚ã„ã¾ã„マッãƒãƒ³ã‚°ã¨éƒ¨åˆ†ä¸€è‡´ãƒžãƒƒãƒãƒ³ã‚°ã®ã†ã¡ã€é¸æŠžã•ã‚Œ
-ãŸæ–¹ã‚’è¡Œã„ã¾ã™ã€‚絞り込ã¿ãƒ‘ターンã§ã¯ã€ãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã§éƒ¨åˆ†ä¸€è‡´ãƒžãƒƒãƒãƒ³ã‚°ã‚’è¡Œã„ã¾ã™
-。(|g:fuf_fuzzyRefining|)
-
-絞り込ã¿ãƒ‘ターンã¨ã—ã¦æ•°å€¤ã‚’入力ã—ãŸå ´åˆã€ã‚¢ã‚¤ãƒ†ãƒ ã®ã‚¤ãƒ³ãƒ‡ãƒƒã‚¯ã‚¹ã«å¯¾ã—ã¦ã‚‚
-マッãƒãƒ³ã‚°ã—ã¾ã™ã€‚
-
-ファイルパスã®é™çš„ãªé›†åˆã‚’対象ã¨ã™ã‚‹ãƒ¢ãƒ¼ãƒ‰ (Buffer, MRU-File モードãªã©ã€‚File,
-Directory モードãªã©ã§ã¯ãªã„) ã§|g:fuf_splitPathMatching|ãŒçœŸã®å ´åˆã€ãƒ—ライマ
-リパターンã®ãƒžãƒƒãƒãƒ³ã‚°ã¯ head 部ã¨tail 部ã«åˆ†ã‘ã¦è¡Œã‚ã‚Œã¾ã™ã€‚
->
- head tail
- |------||-----|
- foo/bar/baz.vim
-
- ã‚ã„ã¾ã„マッãƒãƒ³ã‚°ä¾‹:
- +----------------+---------+---------+---------+
- | item \ pattern | foo/bar | foo/ | bar |
- +----------------+---------+---------+---------+
- | foo/bar | match | match | match |
- | foo/abc | unmatch | match | unmatch |
- | abc/bar | unmatch | unmatch | match |
- | foobar | unmatch | unmatch | match |
- | foooo/barrrr | match | match | match |
- | foooo/fooooo | unmatch | match | unmatch |
- +----------------+---------+---------+---------+
-<
-上記ã®ã‚±ãƒ¼ã‚¹ã§ã€çµžã‚Šè¾¼ã¿ãƒ‘ターンã¯ãƒ‘ス全体ã«å¯¾ã—ã¦ãƒžãƒƒãƒãƒ³ã‚°ã§ãã¾ã™ã€‚
-
- *fuf-sorting-of-completion-items*
-補完アイテムã®ã‚½ãƒ¼ãƒˆ ~
-
-FuzzyFinder ã¯å¹¾ã¤ã‹ã®ãƒ«ãƒ¼ãƒ«ã«å¾“ã£ã¦è£œå®Œã‚¢ã‚¤ãƒ†ãƒ ã‚’ソートã—ã¾ã™ã€‚
-
-パターン全体ãŒä¸€éƒ¨åˆ†ã«ã´ã£ãŸã‚Šãƒžãƒƒãƒã™ã‚‹ã‚¢ã‚¤ãƒ†ãƒ ã¯å„ªå…ˆã•ã‚Œã¾ã™ã€‚例ãˆã°ã€ãƒ‘ター
-ン "bc" ã§ã¯ã‚¢ã‚¤ãƒ†ãƒ  "abc" 㯠"bac" より優先ã•ã‚Œã¾ã™ã€‚
-
-ã“ã®ã‚±ãƒ¼ã‚¹ã§ã€ãƒžãƒƒãƒã™ã‚‹éƒ¨åˆ†ãŒå…ˆé ­ã§ã‚るアイテムã¯ãã†ã§ãªã„アイテムより優先ã•
-ã‚Œã¾ã™ã€‚例ãˆã°ãƒ‘ターン "foo" ã§ã¯ã‚¢ã‚¤ãƒ†ãƒ  "foobar" ã¯"barfoo" より優先ã•ã‚Œã¾ã™
-。
-
-マッãƒãƒ³ã‚°ä½ç½®ã‚ˆã‚Šå¾Œã®æ–‡å­—æ•°ãŒå°‘ãªã„ã»ã©å„ªå…ˆã•ã‚Œã¾ã™ã€‚例ãˆã°ãƒ‘ターン "bar" ã§
-ã¯ã‚¢ã‚¤ãƒ†ãƒ "foobar" ã¯"foobarbaz"より優先ã•ã‚Œã¾ã™ã€‚
-
-å˜èªžã®å¢ƒç•Œæ–‡å­—ã«ã ã‘マッãƒãƒ³ã‚°ã™ã‚‹ã‚¢ã‚¤ãƒ†ãƒ ã¯å„ªå…ˆã•ã‚Œã¾ã™ã€‚ 例ãˆã°ã€ãƒ‘ターン
-"fb" ã§ã¯ã‚¢ã‚¤ãƒ†ãƒ "fooBarBaz" ã‚„ "foo_bar_baz" ãªã©ãŒå„ªå…ˆã•ã‚Œã¾ã™ã€‚
-
-加ãˆã¦ã€FuzzyFinder ã«ã¯å­¦ç¿’システムãŒã‚ã‚Šã¾ã™ã€‚ç¾åœ¨ã®ãƒ‘ターンã§ã€éŽåŽ»ã«è£œå®Œã•
-ã‚ŒãŸã“ã¨ã®ã‚るアイテムを優先ã—ã¾ã™ã€‚
-
- *fuf-reusing-window*
-目的ã®ãƒãƒƒãƒ•ã‚¡/ファイルãŒé–‹ã‹ã‚Œã¦ã„るウィンドウã®å†åˆ©ç”¨ ~
-
-ウィンドウを分割ã—ã¦ãƒãƒƒãƒ•ã‚¡/ファイルを開ãã¨ãã«ã€ç¾åœ¨ã®ã‚¿ãƒ–ページã§ãã‚ŒãŒé–‹
-ã‹ã‚Œã¦ã„るウィンドウãŒè¦‹ã¤ã‹ã£ãŸå ´åˆã€ãã“ã¸ç§»å‹•ã—ã¾ã™ã€‚別ã®ã‚¿ãƒ–ページã§ãƒãƒƒãƒ•
-ã‚¡/ファイルを開ãã¨ãã«ã€ä»–ã®ã‚¿ãƒ–ページã§ãã‚ŒãŒé–‹ã‹ã‚Œã¦ã„るウィンドウãŒè¦‹ã¤ã‹
-ã£ãŸå ´åˆã€ãã“ã¸ç§»å‹•ã—ã¾ã™ã€‚
-
-常ã«ãƒãƒƒãƒ•ã‚¡/ファイルを新ウィンドウã§é–‹ããŸã„å ´åˆã€'reuse_window'オプションã§
-ã“ã®æ©Ÿèƒ½ã‚’無効ã«ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚
-
- *fuf-hiding-menu*
-補完メニューã®ä¸€æ™‚éžè¡¨ç¤º ~
-
-<C-e> ã§è£œå®Œãƒ¡ãƒ‹ãƒ¥ãƒ¼ã‚’é–‰ã˜ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚ã¾ãŸã€<C-x><C-o>ã§å†åº¦é–‹ãã“ã¨ãŒã§
-ãã¾ã™ã€‚
-
- *fuf-abbreviation* *fuf-multiple-search*
-短縮入力åŠã³è¤‡åˆæ¤œç´¢ ~
-
-|g:fuf_abbrevMap|を設定ã™ã‚‹ã“ã¨ã§ã€å…¨ãƒ¢ãƒ¼ãƒ‰ã§çŸ­ç¸®å…¥åŠ›ã¨è¤‡åˆæ¤œç´¢ãŒåˆ©ç”¨ã§ãã¾ã™ã€‚
-
-例ãˆã°æ¬¡ã®ã‚ˆã†ã«è¨­å®šã—ãŸã¨ã—ã¾ã™:
->
- let g:fuf_abbrevMap = {
- \ "^doc:" : [
- \ "~/project/**/doc/",
- \ ".vim/doc/",
- \ ],
- \ }
-<
-ãã—㦠File モード㧠"doc:txt" ã¨å…¥åŠ›ã™ã‚‹ã¨ã€æ¬¡ã®2ã¤ã®ãƒ‘ターンã®æ¤œç´¢çµæžœã‚’複åˆ
-ã—ã¾ã™:
-
- "~/project/**/doc/*t*x*t*"
- ".vim/doc/*t*x*t*"
-
- *fuf-data-file*
-データファイル ~
-
-FuzzyFinder ã¯è£œå®Œçµ±è¨ˆã€MRUデータã€ãƒ–ックマークãªã©ã‚’|g:fuf_dataDir|以下ã®ãƒ•ã‚¡
-イルã«æ›¸ãè¾¼ã¿ã¾ã™ã€‚
-
-|:FufEditDataFile|コマンドã¯ãƒ‡ãƒ¼ã‚¿ãƒ•ã‚¡ã‚¤ãƒ«ã®ç·¨é›†ã‚’補助ã—ã¾ã™ã€‚ã“ã®ã‚³ãƒžãƒ³ãƒ‰ã‚’実
-è¡Œã™ã‚‹ã¨ã€ãƒ‡ãƒ¼ã‚¿ãƒ•ã‚¡ã‚¤ãƒ«ã‚’ç„¡åãƒãƒƒãƒ•ã‚¡ã«èª­ã¿è¾¼ã¿ã¾ã™ã€‚:write ãªã©ã§æ›¸ãè¾¼ã¿ã‚’
-è¡Œã†ã¨ã€ãƒ‡ãƒ¼ã‚¿ãƒ•ã‚¡ã‚¤ãƒ«ã‚’æ›´æ–°ã—ã¾ã™ã€‚
-
- *fuf-cache*
-キャッシュ ~
-
-一旦キャッシュãŒç”Ÿæˆã•ã‚Œã‚‹ã¨ã€ãƒ¬ã‚¹ãƒãƒ³ã‚¹ã‚’å‘上ã•ã›ã‚‹ãŸã‚自動的ã«ã¯æ›´æ–°ã•ã‚Œã¾ã›
-ん。ã“れを更新ã™ã‚‹ã«ã¯|:FufRenewCache|コマンドを実行ã—ã¦ãã ã•ã„。
-
- *fuf-dot-sequence*
-ドット列ã§è¦ªãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã¸ç§»å‹• ~
-
-ドット列を入力ã™ã‚‹ã“ã¨ã§è¦ªãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã‚’上ãŒã£ã¦ã„ãã“ã¨ãŒã§ãã¾ã™ã€‚パス区切り
-文字直後ã®ãƒ‰ãƒƒãƒˆåˆ—㯠"../" ã®åˆ—ã«å±•é–‹ã•ã‚Œã¾ã™ã€‚
-
- ドット列 展開パターン ~
- /.. /../
- /... /../../
- /.... /../../../
-
- *fuf-how-to-add-mode*
-モードã®è¿½åŠ æ–¹æ³• ~
-
-"mymode" モードを追加ã™ã‚‹ã«ã¯ã€ã‚½ãƒ¼ã‚¹ãƒ•ã‚¡ã‚¤ãƒ«ã‚’ autoload/fuf/mymode.vim ã«ç½®ã
-〠fuf#addMode('mymode') を呼ã³ã¾ã™ã€‚
-
- *fuf-migemo*
-Migemo ã¨ã¯ ~
-
-以下ã®ãƒšãƒ¼ã‚¸ã‚’å‚ç…§ã—ã¦ãã ã•ã„。
- - http://0xcc.net/migemo/
- - http://www.kaoriya.net/#CMIGEMO
-
-
-==============================================================================
-コマンド *fuf-commands*
-
-See also: |fuf-vimrc-example|
-
- *:FufBuffer*
-:FufBuffer [{pattern}]
- Buffer モードを起動ã—ã¾ã™ã€‚
-
- ! 修飾å­ã‚’付ã‘ã¦å®Ÿè¡Œã—ãŸå ´åˆã€ã‚ã„ã¾ã„検索ã§ã¯ãªã部分一致検索を行ã†ã‚ˆ
- ã†ã«ãªã‚Šã¾ã™ã€‚
-
- FuzzyFinder 起動後㫠{pattern} ãŒæŒ¿å…¥ã•ã‚Œã¾ã™ã€‚
-
- *:FufFile*
-:FufFile [{pattern}]
- File モードを起動ã—ã¾ã™ã€‚
-
- ! 修飾å­ã‚’付ã‘ã¦å®Ÿè¡Œã—ãŸå ´åˆã€ã‚ã„ã¾ã„検索ã§ã¯ãªã部分一致検索を行ã†ã‚ˆ
- ã†ã«ãªã‚Šã¾ã™ã€‚
-
- FuzzyFinder 起動後㫠{pattern} ãŒæŒ¿å…¥ã•ã‚Œã¾ã™ã€‚
-
- *:FufFileWithFullCwd*
-:FufFileWithFullCwd [{pattern}]
- カレントディレクトリã®ãƒ•ãƒ«ãƒ‘スをåˆæœŸãƒ‘ターンã¨ã™ã‚‹ä»¥å¤–ã¯|:FufFile|ã¨åŒ
- ã˜ã§ã™ã€‚
-
- *:FufFileWithCurrentBufferDir*
-:FufFileWithCurrentBufferDir [{pattern}]
- カレントãƒãƒƒãƒ•ã‚¡ã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã‚’åˆæœŸãƒ‘ターンã¨ã™ã‚‹ä»¥å¤–ã¯|:FufFile|ã¨åŒ
- ã˜ã§ã™ã€‚
-
- *:FufDir*
-:FufDir [{pattern}]
- Directory モードを起動ã—ã¾ã™ã€‚
-
- ! 修飾å­ã‚’付ã‘ã¦å®Ÿè¡Œã—ãŸå ´åˆã€ã‚ã„ã¾ã„検索ã§ã¯ãªã部分一致検索を行ã†ã‚ˆ
- ã†ã«ãªã‚Šã¾ã™ã€‚
-
- FuzzyFinder 起動後㫠{pattern} ãŒæŒ¿å…¥ã•ã‚Œã¾ã™ã€‚
-
- *:FufDirWithFullCwd*
-:FufDirWithFullCwd [{pattern}]
- カレントディレクトリã®ãƒ•ãƒ«ãƒ‘スをåˆæœŸãƒ‘ターンã¨ã™ã‚‹ä»¥å¤–ã¯|:FufDir|ã¨åŒ
- ã˜ã§ã™ã€‚
-
- *:FufDirWithCurrentBufferDir*
-:FufDirWithCurrentBufferDir [{pattern}]
- カレントãƒãƒƒãƒ•ã‚¡ã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã‚’åˆæœŸãƒ‘ターンã¨ã™ã‚‹ä»¥å¤–ã¯|:FufDir|ã¨åŒ
- ã˜ã§ã™ã€‚
-
- *:FufMruFile*
-:FufMruFile [{pattern}]
- MRU-File モードを起動ã—ã¾ã™ã€‚
-
- ! 修飾å­ã‚’付ã‘ã¦å®Ÿè¡Œã—ãŸå ´åˆã€ã‚ã„ã¾ã„検索ã§ã¯ãªã部分一致検索を行ã†ã‚ˆ
- ã†ã«ãªã‚Šã¾ã™ã€‚
-
- FuzzyFinder 起動後㫠{pattern} ãŒæŒ¿å…¥ã•ã‚Œã¾ã™ã€‚
-
- *:FufMruFileInCwd*
-:FufMruFileInCwd [{pattern}]
- カレントディレクトリ内ã®ãƒ•ã‚¡ã‚¤ãƒ«ã®ã¿ã‚’対象ã¨ã™ã‚‹ä»¥å¤–ã¯
- |:FufMruFile|ã¨åŒã˜ã§ã™ã€‚
-
- *:FufMruCmd*
-:FufMruCmd [{pattern}]
- MRU-Command モードを起動ã—ã¾ã™ã€‚
-
- ! 修飾å­ã‚’付ã‘ã¦å®Ÿè¡Œã—ãŸå ´åˆã€ã‚ã„ã¾ã„検索ã§ã¯ãªã部分一致検索を行ã†ã‚ˆ
- ã†ã«ãªã‚Šã¾ã™ã€‚
-
- FuzzyFinder 起動後㫠{pattern} ãŒæŒ¿å…¥ã•ã‚Œã¾ã™ã€‚
-
- *:FufBookmarkFile*
-:FufBookmarkFile [{pattern}]
- Bookmark-File モードを起動ã—ã¾ã™ã€‚
-
- ! 修飾å­ã‚’付ã‘ã¦å®Ÿè¡Œã—ãŸå ´åˆã€ã‚ã„ã¾ã„検索ã§ã¯ãªã部分一致検索を行ã†ã‚ˆ
- ã†ã«ãªã‚Šã¾ã™ã€‚
-
- FuzzyFinder 起動後㫠{pattern} ãŒæŒ¿å…¥ã•ã‚Œã¾ã™ã€‚
-
- *:FufBookmarkDir*
-:FufBookmarkDir [{pattern}]
- Bookmark-Dir モードを起動ã—ã¾ã™ã€‚
-
- ! 修飾å­ã‚’付ã‘ã¦å®Ÿè¡Œã—ãŸå ´åˆã€ã‚ã„ã¾ã„検索ã§ã¯ãªã部分一致検索を行ã†ã‚ˆ
- ã†ã«ãªã‚Šã¾ã™ã€‚
-
- FuzzyFinder 起動後㫠{pattern} ãŒæŒ¿å…¥ã•ã‚Œã¾ã™ã€‚
-
- *:FufTag*
-:FufTag [{pattern}]
- Tag モードを起動ã—ã¾ã™ã€‚
-
- ! 修飾å­ã‚’付ã‘ã¦å®Ÿè¡Œã—ãŸå ´åˆã€ã‚ã„ã¾ã„検索ã§ã¯ãªã部分一致検索を行ã†ã‚ˆ
- ã†ã«ãªã‚Šã¾ã™ã€‚
-
- FuzzyFinder 起動後㫠{pattern} ãŒæŒ¿å…¥ã•ã‚Œã¾ã™ã€‚
-
- *:FufTagWithCursorWord*
-:FufTagWithCursorWord [{pattern}]
- カーソル下ã®å˜èªžã‚’åˆæœŸãƒ‘ターンã¨ã™ã‚‹ä»¥å¤–ã¯|:FufTag|ã¨åŒã˜ã§ã™ã€‚
-
- *:FufBufferTag*
-:FufBufferTag[!] [{pattern}]
- Buffer-Tag モードを起動ã—ã¾ã™ã€‚
-
- ! 修飾å­ã‚’付ã‘ã¦å®Ÿè¡Œã—ãŸå ´åˆã€ã‚ã„ã¾ã„検索ã§ã¯ãªã部分一致検索を行ã†ã‚ˆ
- ã†ã«ãªã‚Šã¾ã™ã€‚
-
- FuzzyFinder 起動後㫠{pattern} ãŒæŒ¿å…¥ã•ã‚Œã¾ã™ã€‚
-
- *:FufBufferTagAll*
-:FufBufferTagAll[!] [{pattern}]
- カレントãƒãƒƒãƒ•ã‚¡ã ã‘ã§ãªãä»–ã®å…¨ã¦ã®ãƒãƒƒãƒ•ã‚¡ã‹ã‚‰ã‚‚タグを集ã‚る以外ã¯
- |:FufBufferTag|ã¨åŒã˜ã§ã™ã€‚
-
- *:FufBufferTagWithCursorWord*
-:FufBufferTagWithCursorWord[!] [{pattern}]
- カーソル下ã®å˜èªžã‚’åˆæœŸãƒ‘ターンã¨ã™ã‚‹ä»¥å¤–ã¯|:FufBufferTag|ã¨åŒã˜ã§ã™ã€‚
-
- *:FufBufferTagAllWithCursorWord*
-:FufBufferTagAllWithCursorWord[!] [{pattern}]
- カーソル下ã®å˜èªžã‚’åˆæœŸãƒ‘ターンã¨ã™ã‚‹ä»¥å¤–ã¯|:FufBufferTagAll|ã¨åŒã˜ã§ã™
- 。
-
- *:FufBufferTagWithSelectedText*
-:FufBufferTagWithSelectedText[!] [{pattern}]
- 最後ã«é¸æŠžã—ãŸãƒ†ã‚­ã‚¹ãƒˆã‚’åˆæœŸãƒ‘ターンã¨ã™ã‚‹ä»¥å¤–ã¯|:FufBufferTag|ã¨åŒã˜
- ã§ã™ã€‚
-
- *:FufBufferTagAllWithSelectedText*
-:FufBufferTagAllWithSelectedText[!] [{pattern}]
- 最後ã«é¸æŠžã—ãŸãƒ†ã‚­ã‚¹ãƒˆã‚’åˆæœŸãƒ‘ターンã¨ã™ã‚‹ä»¥å¤–ã¯|:FufBufferTagAll|ã¨åŒ
- ã˜ã§ã™ã€‚
-
- *:FufTaggedFile*
-:FufTaggedFile [{pattern}]
- Tagged-File モードを起動ã—ã¾ã™ã€‚
-
- ! 修飾å­ã‚’付ã‘ã¦å®Ÿè¡Œã—ãŸå ´åˆã€ã‚ã„ã¾ã„検索ã§ã¯ãªã部分一致検索を行ã†ã‚ˆ
- ã†ã«ãªã‚Šã¾ã™ã€‚
-
- FuzzyFinder 起動後㫠{pattern} ãŒæŒ¿å…¥ã•ã‚Œã¾ã™ã€‚
-
- *:FufJumpList*
-:FufJumpList [{pattern}]
- Jump-List モードを起動ã—ã¾ã™ã€‚
-
- ! 修飾å­ã‚’付ã‘ã¦å®Ÿè¡Œã—ãŸå ´åˆã€ã‚ã„ã¾ã„検索ã§ã¯ãªã部分一致検索を行ã†ã‚ˆ
- ã†ã«ãªã‚Šã¾ã™ã€‚
-
- FuzzyFinder 起動後㫠{pattern} ãŒæŒ¿å…¥ã•ã‚Œã¾ã™ã€‚
-
- *:FufChangeList*
-:FufChangeList [{pattern}]
- Change-List モードを起動ã—ã¾ã™ã€‚
-
- ! 修飾å­ã‚’付ã‘ã¦å®Ÿè¡Œã—ãŸå ´åˆã€ã‚ã„ã¾ã„検索ã§ã¯ãªã部分一致検索を行ã†ã‚ˆ
- ã†ã«ãªã‚Šã¾ã™ã€‚
-
- FuzzyFinder 起動後㫠{pattern} ãŒæŒ¿å…¥ã•ã‚Œã¾ã™ã€‚
-
- *:FufQuickfix*
-:FufQuickfix [{pattern}]
- Quickfix モードを起動ã—ã¾ã™ã€‚
-
- ! 修飾å­ã‚’付ã‘ã¦å®Ÿè¡Œã—ãŸå ´åˆã€ã‚ã„ã¾ã„検索ã§ã¯ãªã部分一致検索を行ã†ã‚ˆ
- ã†ã«ãªã‚Šã¾ã™ã€‚
-
- FuzzyFinder 起動後㫠{pattern} ãŒæŒ¿å…¥ã•ã‚Œã¾ã™ã€‚
-
- *:FufLine*
-:FufLine [{pattern}]
- Line モードを起動ã—ã¾ã™ã€‚
-
- ! 修飾å­ã‚’付ã‘ã¦å®Ÿè¡Œã—ãŸå ´åˆã€ã‚ã„ã¾ã„検索ã§ã¯ãªã部分一致検索を行ã†ã‚ˆ
- ã†ã«ãªã‚Šã¾ã™ã€‚
-
- FuzzyFinder 起動後㫠{pattern} ãŒæŒ¿å…¥ã•ã‚Œã¾ã™ã€‚
-
- *:FufHelp*
-:FufHelp[!] [{pattern}]
- Help モードを起動ã—ã¾ã™ã€‚
-
- ! 修飾å­ã‚’付ã‘ã¦å®Ÿè¡Œã—ãŸå ´åˆã€ã‚ã„ã¾ã„検索ã§ã¯ãªã部分一致検索を行ã†ã‚ˆ
- ã†ã«ãªã‚Šã¾ã™ã€‚
-
- FuzzyFinder 起動後㫠{pattern} ãŒæŒ¿å…¥ã•ã‚Œã¾ã™ã€‚
-
- *:FufEditDataFile*
-:FufEditDataFile
- データファイルを編集ã™ã‚‹ãŸã‚ã®ãƒãƒƒãƒ•ã‚¡ã‚’é–‹ãã¾ã™ã€‚詳ã—ãã¯
- |fuf-data-file|ã‚’å‚ç…§ã—ã¦ãã ã•ã„。
-
- *:FufCoverageFileRegister*
-:FufCoverageFileRegister
- Coverage-File モードã§æ¤œç´¢ã•ã‚Œã‚‹ã€æ–°ã—ã„検索対象を登録ã—ã¾ã™ã€‚最åˆã«
- ~/* ã®ã‚ˆã†ãª glob パターンを入力ã—ã¾ã™ã€‚ <Esc> を入力ã™ã‚‹ã¾ã§ãƒ‘ターン
- を追加ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚次ã«å¯¾è±¡åを入力ã—ã¾ã™ã€‚
-
- See also: |glob()|, |fuf-coveragefile-mode|
-
- *:FufCoverageFileChange*
-:FufCoverageFileChange [{name}]
- |FufCoverageFileRegister|コマンドã§ç™»éŒ²ã•ã‚Œã¦ã„る中ã‹ã‚‰é¸æŠžã•ã‚ŒãŸæ¤œç´¢
- 対象ã§Coverage-File モードを起動ã—ã¾ã™ã€‚
-
- 対象åãŒä¸Žãˆã‚‰ã‚ŒãŸå ´åˆã€é¸æŠžãƒ—ロセスã¯é£›ã°ã•ã‚Œã¾ã™ã€‚
-
- See also: |fuf-coveragefile-mode|
-
- *:FufBookmarkFileAdd*
-:FufBookmarkFileAdd [{name}]
- カーソル行をブックマークã«è¿½åŠ ã—ã¾ã™ã€‚
-
- See also: |fuf-bookmarkfile-mode|
-
- *:FufBookmarkFileAddAsSelectedText*
-:FufBookmarkFileAddAsSelectedText
- 最後ã«é¸æŠžã•ã‚ŒãŸãƒ†ã‚­ã‚¹ãƒˆã‚’ブックマークåã¨ã™ã‚‹ä»¥å¤–ã¯
- |:FufBookmarkFileAdd|ã¨åŒã˜ã§ã™ã€‚
-
- *:FufBookmarkDirAdd*
-:FufBookmarkDirAdd [{name}]
- ディレクトリをブックマークã«è¿½åŠ ã—ã¾ã™ã€‚
-
- See also: |fuf-bookmarkdir-mode|
-
- *:FufRenewCache*
-:FufRenewCache
- 補完アイテムを作り直ã™ãŸã‚ã«ã‚­ãƒ£ãƒƒã‚·ãƒ¥ã‚’削除ã—ã¾ã™ã€‚詳ã—ãã¯
- |fuf-cache|ã‚’å‚ç…§ã—ã¦ãã ã•ã„。
-
-
-==============================================================================
-オプション *fuf-options*
-
- *fuf-options-for-all-modes*
-全モード用 ~
-
- *g:fuf_modesDisable* >
- let g:fuf_modesDisable = [ 'mrufile', 'mrucmd', ]
-<
- 無効ã«ã™ã‚‹ãƒ¢ãƒ¼ãƒ‰åã®ãƒªã‚¹ãƒˆã€‚ã“ã‚Œã«å«ã¾ã‚Œã‚‹ãƒ¢ãƒ¼ãƒ‰ã¯åˆæœŸåŒ–ã•ã‚Œãšã€ã‚¤ãƒ™ãƒ³
- トã®å‡¦ç†ã‚‚è¡Œã‚ã‚Œã¾ã›ã‚“。
-
- *g:fuf_keyOpen* >
- let g:fuf_keyOpen = '<CR>'
-<
- 補完を確定ã—ã€ãƒãƒƒãƒ•ã‚¡/ファイルを直å‰ã®ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã§é–‹ãキー。
-
- *g:fuf_keyOpenSplit* >
- let g:fuf_keyOpenSplit = '<C-j>'
-<
- 補完を確定ã—ã€ãƒãƒƒãƒ•ã‚¡/ファイルを直å‰ã®ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã‚’分割ã—ã¦é–‹ãキー。
-
- *g:fuf_keyOpenVsplit* >
- let g:fuf_keyOpenVsplit = '<C-k>'
-<
- 補完を確定ã—ã€ãƒãƒƒãƒ•ã‚¡/ファイルを直å‰ã®ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã‚’垂直分割ã—ã¦é–‹ãã‚­
- ー。
-
- *g:fuf_keyOpenTabpage* >
- let g:fuf_keyOpenTabpage = '<C-l>'
-<
- 補完を確定ã—ã€ãƒãƒƒãƒ•ã‚¡/ファイルを別タブページ開ãキー。
-
- *g:fuf_keyPreview* >
- let g:fuf_keyPreview = '<C-@>'
-<
- é¸æŠžã•ã‚Œã¦ã„る補完アイテムã®æƒ…報をコマンドライン領域ã«è¡¨ç¤ºã™ã‚‹ã‚­ãƒ¼ã€‚プ
- レビューをサãƒãƒ¼ãƒˆã™ã‚‹ãƒ¢ãƒ¼ãƒ‰ã§ã®ã¿ä½œç”¨ã—ã¾ã™ã€‚
-
- *g:fuf_keyNextMode* >
- let g:fuf_keyNextMode = '<C-t>'
-<
- 次ã®ãƒ¢ãƒ¼ãƒ‰ã«åˆ‡ã‚Šæ›¿ãˆã‚‹ã‚­ãƒ¼ã€‚
-
- *g:fuf_keyPrevMode* >
- let g:fuf_keyPrevMode = '<C-y>'
-<
- å‰ã®ãƒ¢ãƒ¼ãƒ‰ã«åˆ‡ã‚Šæ›¿ãˆã‚‹ã‚­ãƒ¼ã€‚
-
- *g:fuf_keyPrevPattern* >
- let g:fuf_keyPrevPattern = '<C-s>'
-<
- 履歴ã‹ã‚‰å‰ã®å…¥åŠ›ãƒ‘ターンを呼ã³å‡ºã™ã‚­ãƒ¼ã€‚
-
- *g:fuf_keyNextPattern* >
- let g:fuf_keyNextPattern = '<C-_>'
-<
- 履歴ã‹ã‚‰æ¬¡ã®å…¥åŠ›ãƒ‘ターンを呼ã³å‡ºã™ã‚­ãƒ¼ã€‚
-
- *g:fuf_keySwitchMatching* >
- let g:fuf_keySwitchMatching = '<C-\><C-\>'
-<
- ã‚ã„ã¾ã„マッãƒãƒ³ã‚°ã¨éƒ¨åˆ†ä¸€è‡´ãƒžãƒƒãƒãƒ³ã‚°ã‚’切り替ãˆã‚‹ã‚­ãƒ¼ã€‚
-
- *g:fuf_dataDir* >
- let g:fuf_dataDir = '~/.vim-fuf-data'
-<
- データファイルを置ãディレクトリã®ãƒ‘ス。空文字列を設定ã™ã‚‹ã¨ãƒ•ã‚¡ã‚¤ãƒ«ã¸
- ã®æ›¸ãè¾¼ã¿ã¯è¡Œã‚ã‚Œãªããªã‚Šã¾ã™ã€‚
-
- *g:fuf_abbrevMap* >
- let g:fuf_abbrevMap = {}
-<
- |Dictionary|åž‹ã§ãã‚Œãžã‚Œã®å€¤ã¯|List|åž‹ã§ã™ã€‚入力ã•ã‚ŒãŸãƒ†ã‚­ã‚¹ãƒˆã®ã€ã‚­ãƒ¼
- ã«ãƒžãƒƒãƒã™ã‚‹éƒ¨åˆ†ãŒå¯¾å¿œã™ã‚‹å€¤ã«å±•é–‹ã•ã‚Œã¾ã™ã€‚
-
- *g:fuf_patternSeparator* >
- let g:fuf_patternSeparator = ';'
-<
- 入力パターンをプライマリパターンã¨çµžã‚Šè¾¼ã¿ãƒ‘ターン列ã«åŒºåˆ‡ã‚‹æ–‡å­—列。
-
- *g:fuf_promptHighlight* >
- let g:fuf_promptHighlight = 'Question'
-<
- プロンプトをãƒã‚¤ãƒ©ã‚¤ãƒˆã™ã‚‹ã‚°ãƒ«ãƒ¼ãƒ—å。
-
- *g:fuf_ignoreCase* >
- let g:fuf_ignoreCase = 1
-<
- 真ãªã‚‰ã€å¤§æ–‡å­—å°æ–‡å­—を無視ã—ã¾ã™ã€‚
-
- *g:fuf_splitPathMatching* >
- let g:fuf_splitPathMatching = 1
-<
- 真ãªã‚‰ã€ãƒ—ライマリパターンã®ãƒžãƒƒãƒãƒ³ã‚°ã¯ head 部ã¨tail 部ã«åˆ†ã‘ã¦è¡Œã‚
- ã‚Œã¾ã™ã€‚
-
- See also: |fuf-search-patterns|
-
- *g:fuf_fuzzyRefining* >
- let g:fuf_fuzzyRefining = 0
-<
- 真ãªã‚‰ã€çµžã‚Šè¾¼ã¿ãƒ‘ターンã«ã¤ã„ã¦éƒ¨åˆ†ä¸€è‡´ãƒžãƒƒãƒãƒ³ã‚°ã®ä»£ã‚ã‚Šã«ã‚ã„ã¾ã„マ
- ッãƒãƒ³ã‚°ãŒè¡Œã‚ã‚Œã¾ã™ã€‚
-
- See also: |fuf-search-patterns|
-
- *g:fuf_reuseWindow* >
- let g:fuf_reuseWindow = 1
-<
- 真ãªã‚‰ã€ã™ã§ã«é–‹ã‹ã‚Œã¦ã„ã‚‹ãƒãƒƒãƒ•ã‚¡ã‚’é–‹ãã¨ãã€ç›®çš„ã®ãƒãƒƒãƒ•ã‚¡ã‚’å«ã‚€ã‚¦ã‚£
- ンドウをå†åˆ©ç”¨ã—ã¾ã™ã€‚
-
- *g:fuf_timeFormat* >
- let g:fuf_timeFormat = '(%Y-%m-%d %H:%M:%S)'
-<
- アイテムãŒç™»éŒ²ã•ã‚ŒãŸæ—¥æ™‚ã®æ›¸å¼ã‚’設定ã—ã¾ã™ã€‚書å¼ã®è©³ç´°ã¯|strftime()|ã‚’
- å‚ç…§ã—ã¦ãã ã•ã„。
-
- *g:fuf_learningLimit* >
- let g:fuf_learningLimit = 100
-<
- ä¿æŒã™ã‚‹è£œå®Œçµ±è¨ˆãƒ‡ãƒ¼ã‚¿ã®ãƒ¢ãƒ¼ãƒ‰æ¯Žã®ä¸Šé™å€¤ã§ã™ã€‚
-
- *g:fuf_enumeratingLimit* >
- let g:fuf_enumeratingLimit = 50
-<
- レスãƒãƒ³ã‚¹ã‚’å‘上ã•ã›ã‚‹ãŸã‚ã€è£œå®Œã‚¢ã‚¤ãƒ†ãƒ ã®åˆ—挙をã“ã®æ•°ã«é”ã—ãŸæ™‚点ã§æ‰“
- ã¡åˆ‡ã‚Šã¾ã™ã€‚
-
- *g:fuf_maxMenuWidth* >
- let g:fuf_maxMenuWidth = 78
-<
- é•·ã„補完アイテムã¯ã€ã“ã®é•·ã•ã«åŽã¾ã‚‹ã‚ˆã†çœç•¥ã—ã¦è¡¨ç¤ºã—ã¾ã™ã€‚
-
- *g:fuf_previewHeight* >
- let g:fuf_previewHeight = 0
-<
- プレビューをサãƒãƒ¼ãƒˆã™ã‚‹ãƒ¢ãƒ¼ãƒ‰ã‚’èµ·å‹•ã—ãŸã¨ãã€'cmdheight'ãŒã“ã®å€¤ã«è¨­
- 定ã•ã‚Œã¾ã™ã€‚é¸æŠžã•ã‚Œã¦ã„る補完アイテムã®æƒ…å ±ãŒã‚³ãƒžãƒ³ãƒ‰ãƒ©ã‚¤ãƒ³é ˜åŸŸã«è¡¨ç¤º
- ã•ã‚Œã¾ã™ã€‚0 ãªã‚‰ãƒ—レビュー機能ã¯ç„¡åŠ¹ã«ãªã‚Šã¾ã™ã€‚
-
- *g:fuf_autoPreview* >
- let g:fuf_autoPreview = 0
-<
- 真ãªã‚‰ãƒ—レビューを自動的ã«è¡¨ç¤ºã—ã¾ã™ã€‚
-
- *g:fuf_useMigemo* >
- let g:fuf_useMigemo = 0
-<
- 真ãªã‚‰ migemo を利用ã—ã¾ã™ã€‚
-
- *fuf-options-for-buffer-mode*
-Buffer モード用 ~
-
- *g:fuf_buffer_prompt* >
- let g:fuf_buffer_prompt = '>Buffer[]>'
-<
- プロンプト文字列。"[]" ã¯ã‚¤ãƒ³ã‚¸ã‚±ãƒ¼ã‚¿ã«ç½®æ›ã•ã‚Œã¾ã™ã€‚
-
- *g:fuf_buffer_switchOrder* >
- let g:fuf_buffer_switchOrder = 10
-<
- 次/å‰ã®ãƒ¢ãƒ¼ãƒ‰ã«åˆ‡ã‚Šæ›¿ãˆã‚‹ã¨ãã®ã€ãƒ¢ãƒ¼ãƒ‰ã®é †ä½ã§ã™ã€‚è² æ•°ãªã‚‰ã“ã®ãƒ¢ãƒ¼ãƒ‰
- ã«ã¯åˆ‡ã‚Šæ›¿ãˆã¾ã›ã‚“。
-
- *g:fuf_buffer_mruOrder* >
- let g:fuf_buffer_mruOrder = 1
-<
- 真ãªã‚‰ã€æœ€å¾Œã«ä½¿ã£ãŸæ™‚é–“é †ã«è£œå®Œã‚¢ã‚¤ãƒ†ãƒ ã‚’ソートã—ã¾ã™ã€‚
-
- *g:fuf_buffer_keyDelete* >
- let g:fuf_buffer_keyDelete = '<C-]>'
-<
- é¸æŠžã—ãŸãƒãƒƒãƒ•ã‚¡ã‚’削除ã™ã‚‹ã‚­ãƒ¼ã€‚
-
- *fuf-options-for-file-mode*
-File モード用 ~
-
- *g:fuf_file_prompt* >
- let g:fuf_file_prompt = '>File[]>'
-<
- プロンプト文字列。"[]" ã¯ã‚¤ãƒ³ã‚¸ã‚±ãƒ¼ã‚¿ã«ç½®æ›ã•ã‚Œã¾ã™ã€‚
-
- *g:fuf_file_switchOrder* >
- let g:fuf_file_switchOrder = 20
-<
- 次/å‰ã®ãƒ¢ãƒ¼ãƒ‰ã«åˆ‡ã‚Šæ›¿ãˆã‚‹ã¨ãã®ã€ãƒ¢ãƒ¼ãƒ‰ã®é †ä½ã§ã™ã€‚è² æ•°ãªã‚‰ã“ã®ãƒ¢ãƒ¼ãƒ‰
- ã«ã¯åˆ‡ã‚Šæ›¿ãˆã¾ã›ã‚“。
-
- *g:fuf_file_exclude* >
- let g:fuf_file_exclude = '\v\~$|\.(o|exe|bak|orig|swp)$|(^|[/\\])\.(hg|git|bzr)($|[/\\])'
-<
- 補完リストã‹ã‚‰é™¤å¤–ã—ãŸã„アイテムã®æ­£è¦è¡¨ç¾ãƒ‘ターン。
-
- *fuf-options-for-coveragefile-mode*
-Coverage-File モード用 ~
-
- *g:fuf_coveragefile_prompt* >
- let g:fuf_coveragefile_prompt = '>CoverageFile[]>'
-<
- プロンプト文字列。"[]" ã¯ã‚¤ãƒ³ã‚¸ã‚±ãƒ¼ã‚¿ã«ç½®æ›ã•ã‚Œã¾ã™ã€‚
-
- *g:fuf_coveragefile_switchOrder* >
- let g:fuf_coveragefile_switchOrder = 30
-<
- 次/å‰ã®ãƒ¢ãƒ¼ãƒ‰ã«åˆ‡ã‚Šæ›¿ãˆã‚‹ã¨ãã®ã€ãƒ¢ãƒ¼ãƒ‰ã®é †ä½ã§ã™ã€‚è² æ•°ãªã‚‰ã“ã®ãƒ¢ãƒ¼ãƒ‰
- ã«ã¯åˆ‡ã‚Šæ›¿ãˆã¾ã›ã‚“。
-
- *g:fuf_coveragefile_exclude* >
- let g:fuf_coveragefile_exclude = '\v\~$|\.(o|exe|dll|bak|orig|swp)$|(^|[/\\])\.(hg|git|bzr)($|[/\\])'
-<
- 補完リストã‹ã‚‰é™¤å¤–ã—ãŸã„アイテムã®æ­£è¦è¡¨ç¾ãƒ‘ターン。
-
- *g:fuf_coveragefile_globPatterns* >
- let g:fuf_coveragefile_globPatterns = ['**/.*', '**/*']
-<
- 検索ã•ã‚Œã‚‹ãƒ•ã‚¡ã‚¤ãƒ«ãƒ‘スを得るãŸã‚ã®globパターンã®ãƒªã‚¹ãƒˆã€‚
-
- *fuf-options-for-dir-mode*
-Directory モード用 ~
-
- *g:fuf_dir_prompt* >
- let g:fuf_dir_prompt = '>Dir[]>'
-<
- プロンプト文字列。"[]" ã¯ã‚¤ãƒ³ã‚¸ã‚±ãƒ¼ã‚¿ã«ç½®æ›ã•ã‚Œã¾ã™ã€‚
-
- *g:fuf_dir_switchOrder* >
- let g:fuf_dir_switchOrder = 40
-<
- 次/å‰ã®ãƒ¢ãƒ¼ãƒ‰ã«åˆ‡ã‚Šæ›¿ãˆã‚‹ã¨ãã®ã€ãƒ¢ãƒ¼ãƒ‰ã®é †ä½ã§ã™ã€‚è² æ•°ãªã‚‰ã“ã®ãƒ¢ãƒ¼ãƒ‰
- ã«ã¯åˆ‡ã‚Šæ›¿ãˆã¾ã›ã‚“。
-
- *g:fuf_dir_exclude* >
- let g:fuf_dir_exclude = '\v(^|[/\\])\.(hg|git|bzr)($|[/\\])'
-<
- 補完リストã‹ã‚‰é™¤å¤–ã—ãŸã„アイテムã®æ­£è¦è¡¨ç¾ãƒ‘ターン。
-
- *fuf-options-for-mrufile-mode*
-MRU-File モード用 ~
-
- *g:fuf_mrufile_prompt* >
- let g:fuf_mrufile_prompt = '>MRU-File[]>'
-<
- プロンプト文字列。"[]" ã¯ã‚¤ãƒ³ã‚¸ã‚±ãƒ¼ã‚¿ã«ç½®æ›ã•ã‚Œã¾ã™ã€‚
-
- *g:fuf_mrufile_switchOrder* >
- let g:fuf_mrufile_switchOrder = 50
-<
- 次/å‰ã®ãƒ¢ãƒ¼ãƒ‰ã«åˆ‡ã‚Šæ›¿ãˆã‚‹ã¨ãã®ã€ãƒ¢ãƒ¼ãƒ‰ã®é †ä½ã§ã™ã€‚è² æ•°ãªã‚‰ã“ã®ãƒ¢ãƒ¼ãƒ‰
- ã«ã¯åˆ‡ã‚Šæ›¿ãˆã¾ã›ã‚“。
-
- *g:fuf_mrufile_exclude* >
- let g:fuf_mrufile_exclude = '\v\~$|\.(o|exe|dll|bak|orig|sw[po])$|^(\/\/|\\\\|\/mnt\/|\/media\/)'
-<
- 補完リストã‹ã‚‰é™¤å¤–ã—ãŸã„アイテムã®æ­£è¦è¡¨ç¾ãƒ‘ターン。
-
- *g:fuf_mrufile_maxItem* >
- let g:fuf_mrufile_maxItem = 200
-<
- ä¿æŒã™ã‚‹MRUアイテムã®ä¸Šé™å€¤ã€‚
-
- *g:fuf_mrufile_maxItemDir* >
- let g:fuf_mrufile_maxItemDir = 50
-<
- ä¿æŒã™ã‚‹MRUアイテムã®è¦ªãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒª(周辺検索ã§ä½¿ã‚れる)ã®ä¸Šé™å€¤ã€‚
-
- *g:fuf_mrufile_keyExpand* >
- let g:fuf_mrufile_keyExpand = '<C-]>'
-<
- 検索ã™ã‚‹ç¯„囲を広ã’るキー。
-
- *fuf-options-for-mrucmd-mode*
-MRU-Cmd モード用 ~
-
- *g:fuf_mrucmd_prompt* >
- let g:fuf_mrucmd_prompt = '>MRU-Cmd[]>'
-<
- プロンプト文字列。"[]" ã¯ã‚¤ãƒ³ã‚¸ã‚±ãƒ¼ã‚¿ã«ç½®æ›ã•ã‚Œã¾ã™ã€‚
-
- *g:fuf_mrucmd_switchOrder* >
- let g:fuf_mrucmd_switchOrder = 60
-<
- 次/å‰ã®ãƒ¢ãƒ¼ãƒ‰ã«åˆ‡ã‚Šæ›¿ãˆã‚‹ã¨ãã®ã€ãƒ¢ãƒ¼ãƒ‰ã®é †ä½ã§ã™ã€‚è² æ•°ãªã‚‰ã“ã®ãƒ¢ãƒ¼ãƒ‰
- ã«ã¯åˆ‡ã‚Šæ›¿ãˆã¾ã›ã‚“。
-
- *g:fuf_mrucmd_exclude* >
- let g:fuf_mrucmd_exclude = '^$'
-<
- 補完リストã‹ã‚‰é™¤å¤–ã—ãŸã„アイテムã®æ­£è¦è¡¨ç¾ãƒ‘ターン。
-
- *g:fuf_mrucmd_maxItem* >
- let g:fuf_mrucmd_maxItem = 200
-<
- ä¿æŒã™ã‚‹MRUアイテムã®ä¸Šé™å€¤ã€‚
-
- *fuf-options-for-bookmarkfile-mode*
-Bookmark-File モード用 ~
-
- *g:fuf_bookmarkfile_prompt* >
- let g:fuf_bookmarkfile_prompt = '>BookmarkFile[]>'
-<
- プロンプト文字列。"[]" ã¯ã‚¤ãƒ³ã‚¸ã‚±ãƒ¼ã‚¿ã«ç½®æ›ã•ã‚Œã¾ã™ã€‚
-
- *g:fuf_bookmarkfile_switchOrder* >
- let g:fuf_bookmarkfile_switchOrder = 70
-<
- 次/å‰ã®ãƒ¢ãƒ¼ãƒ‰ã«åˆ‡ã‚Šæ›¿ãˆã‚‹ã¨ãã®ã€ãƒ¢ãƒ¼ãƒ‰ã®é †ä½ã§ã™ã€‚è² æ•°ãªã‚‰ã“ã®ãƒ¢ãƒ¼ãƒ‰
- ã«ã¯åˆ‡ã‚Šæ›¿ãˆã¾ã›ã‚“。
-
- *g:fuf_bookmarkfile_searchRange* >
- let g:fuf_bookmarkfile_searchRange = 400
-<
- ジャンプã™ã‚‹ã¨ãã€ãƒ–ックマークã—ãŸä½ç½®ã‹ã‚‰ã“ã®è¡Œæ•°ã®ç¯„囲内ã§ãƒ–ックマー
- クã—ãŸã¨ãã®ãƒ‘ターンã¨ãƒžãƒƒãƒã™ã‚‹è¡Œã‚’探ã—ã¾ã™ã€‚
-
- *g:fuf_bookmarkfile_keyDelete* >
- let g:fuf_bookmarkfile_keyDelete = '<C-]>'
-<
- é¸æŠžã—ãŸãƒ–ックマークを削除ã™ã‚‹ã‚­ãƒ¼ã€‚
-
- *fuf-options-for-bookmarkdir-mode*
-Bookmark-Dir モード用 ~
-
- *g:fuf_bookmarkdir_prompt* >
- let g:fuf_bookmarkdir_prompt = '>BookmarkDir[]>'
-<
- プロンプト文字列。"[]" ã¯ã‚¤ãƒ³ã‚¸ã‚±ãƒ¼ã‚¿ã«ç½®æ›ã•ã‚Œã¾ã™ã€‚
-
- *g:fuf_bookmarkdir_switchOrder* >
- let g:fuf_bookmarkdir_switchOrder = 80
-<
- 次/å‰ã®ãƒ¢ãƒ¼ãƒ‰ã«åˆ‡ã‚Šæ›¿ãˆã‚‹ã¨ãã®ã€ãƒ¢ãƒ¼ãƒ‰ã®é †ä½ã§ã™ã€‚è² æ•°ãªã‚‰ã“ã®ãƒ¢ãƒ¼ãƒ‰
- ã«ã¯åˆ‡ã‚Šæ›¿ãˆã¾ã›ã‚“。
-
- *g:fuf_bookmarkdir_keyDelete* >
- let g:fuf_bookmarkdir_keyDelete = '<C-]>'
-<
- é¸æŠžã—ãŸãƒ–ックマークを削除ã™ã‚‹ã‚­ãƒ¼ã€‚
-
- *fuf-options-for-tag-mode*
-Tag モード用 ~
-
- *g:fuf_tag_prompt* >
- let g:fuf_tag_prompt = '>Tag[]>'
-<
- プロンプト文字列。"[]" ã¯ã‚¤ãƒ³ã‚¸ã‚±ãƒ¼ã‚¿ã«ç½®æ›ã•ã‚Œã¾ã™ã€‚
-
- *g:fuf_tag_switchOrder* >
- let g:fuf_tag_switchOrder = 90
-<
- 次/å‰ã®ãƒ¢ãƒ¼ãƒ‰ã«åˆ‡ã‚Šæ›¿ãˆã‚‹ã¨ãã®ã€ãƒ¢ãƒ¼ãƒ‰ã®é †ä½ã§ã™ã€‚è² æ•°ãªã‚‰ã“ã®ãƒ¢ãƒ¼ãƒ‰
- ã«ã¯åˆ‡ã‚Šæ›¿ãˆã¾ã›ã‚“。
-
- *fuf-options-for-buffertag-mode*
-For Buffer-Tag モード用 ~
-
- *g:fuf_buffertag_prompt* >
- let g:fuf_buffertag_prompt = '>Buffer-Tag[]>'
-<
- プロンプト文字列。"[]" ã¯ã‚¤ãƒ³ã‚¸ã‚±ãƒ¼ã‚¿ã«ç½®æ›ã•ã‚Œã¾ã™ã€‚
-
- *g:fuf_buffertag_switchOrder* >
- let g:fuf_buffertag_switchOrder = 100
-<
- 次/å‰ã®ãƒ¢ãƒ¼ãƒ‰ã«åˆ‡ã‚Šæ›¿ãˆã‚‹ã¨ãã®ã€ãƒ¢ãƒ¼ãƒ‰ã®é †ä½ã§ã™ã€‚è² æ•°ãªã‚‰ã“ã®ãƒ¢ãƒ¼ãƒ‰
- ã«ã¯åˆ‡ã‚Šæ›¿ãˆã¾ã›ã‚“。
-
- *g:fuf_buffertag_ctagsPath* >
- let g:fuf_buffertag_ctagsPath = 'ctags'
-<
- Ctagsã®å®Ÿè¡Œãƒ•ã‚¡ã‚¤ãƒ«ã®ãƒ‘ス
-
- *fuf-options-for-taggedfile-mode*
-Tagged-File モード用 ~
-
- *g:fuf_taggedfile_prompt* >
- let g:fuf_taggedfile_prompt = '>Tagged-File[]>'
-<
- プロンプト文字列。"[]" ã¯ã‚¤ãƒ³ã‚¸ã‚±ãƒ¼ã‚¿ã«ç½®æ›ã•ã‚Œã¾ã™ã€‚
-
- *g:fuf_taggedfile_switchOrder* >
- let g:fuf_taggedfile_switchOrder = 110
-<
- 次/å‰ã®ãƒ¢ãƒ¼ãƒ‰ã«åˆ‡ã‚Šæ›¿ãˆã‚‹ã¨ãã®ã€ãƒ¢ãƒ¼ãƒ‰ã®é †ä½ã§ã™ã€‚è² æ•°ãªã‚‰ã“ã®ãƒ¢ãƒ¼ãƒ‰
- ã«ã¯åˆ‡ã‚Šæ›¿ãˆã¾ã›ã‚“。
-
- *fuf-options-for-jumplist-mode*
-Jump-List モード用 ~
-
- *g:fuf_jumplist_prompt* >
- let g:fuf_jumplist_prompt = '>Jump-List[]>'
-<
- プロンプト文字列。"[]" ã¯ã‚¤ãƒ³ã‚¸ã‚±ãƒ¼ã‚¿ã«ç½®æ›ã•ã‚Œã¾ã™ã€‚
-
- *g:fuf_jumplist_switchOrder* >
- let g:fuf_jumplist_switchOrder = 120
-<
- 次/å‰ã®ãƒ¢ãƒ¼ãƒ‰ã«åˆ‡ã‚Šæ›¿ãˆã‚‹ã¨ãã®ã€ãƒ¢ãƒ¼ãƒ‰ã®é †ä½ã§ã™ã€‚è² æ•°ãªã‚‰ã“ã®ãƒ¢ãƒ¼ãƒ‰
- ã«ã¯åˆ‡ã‚Šæ›¿ãˆã¾ã›ã‚“。
-
- *fuf-options-for-changelist-mode*
-Change-List モード用 ~
-
- *g:fuf_changelist_prompt* >
- let g:fuf_changelist_prompt = '>Change-List[]>'
-<
- プロンプト文字列。"[]" ã¯ã‚¤ãƒ³ã‚¸ã‚±ãƒ¼ã‚¿ã«ç½®æ›ã•ã‚Œã¾ã™ã€‚
-
- *g:fuf_changelist_switchOrder* >
- let g:fuf_changelist_switchOrder = 130
-<
- 次/å‰ã®ãƒ¢ãƒ¼ãƒ‰ã«åˆ‡ã‚Šæ›¿ãˆã‚‹ã¨ãã®ã€ãƒ¢ãƒ¼ãƒ‰ã®é †ä½ã§ã™ã€‚è² æ•°ãªã‚‰ã“ã®ãƒ¢ãƒ¼ãƒ‰
- ã«ã¯åˆ‡ã‚Šæ›¿ãˆã¾ã›ã‚“。
-
- *fuf-options-for-quickfix-mode*
-Quickfix モード用 ~
-
- *g:fuf_quickfix_prompt* >
- let g:fuf_quickfix_prompt = '>Quickfix[]>'
-<
- プロンプト文字列。"[]" ã¯ã‚¤ãƒ³ã‚¸ã‚±ãƒ¼ã‚¿ã«ç½®æ›ã•ã‚Œã¾ã™ã€‚
-
- *g:fuf_quickfix_switchOrder* >
- let g:fuf_quickfix_switchOrder = 140
-<
- 次/å‰ã®ãƒ¢ãƒ¼ãƒ‰ã«åˆ‡ã‚Šæ›¿ãˆã‚‹ã¨ãã®ã€ãƒ¢ãƒ¼ãƒ‰ã®é †ä½ã§ã™ã€‚è² æ•°ãªã‚‰ã“ã®ãƒ¢ãƒ¼ãƒ‰
- ã«ã¯åˆ‡ã‚Šæ›¿ãˆã¾ã›ã‚“。
-
- *fuf-options-for-line-mode*
-Line モード用 ~
-
- *g:fuf_line_prompt* >
- let g:fuf_line_prompt = '>Line[]>'
-<
- プロンプト文字列。"[]" ã¯ã‚¤ãƒ³ã‚¸ã‚±ãƒ¼ã‚¿ã«ç½®æ›ã•ã‚Œã¾ã™ã€‚
-
- *g:fuf_line_switchOrder* >
- let g:fuf_line_switchOrder = 150
-<
- 次/å‰ã®ãƒ¢ãƒ¼ãƒ‰ã«åˆ‡ã‚Šæ›¿ãˆã‚‹ã¨ãã®ã€ãƒ¢ãƒ¼ãƒ‰ã®é †ä½ã§ã™ã€‚è² æ•°ãªã‚‰ã“ã®ãƒ¢ãƒ¼ãƒ‰
- ã«ã¯åˆ‡ã‚Šæ›¿ãˆã¾ã›ã‚“。
-
- *fuf-options-for-help-mode*
-Help モード用 ~
-
- *g:fuf_help_prompt* >
- let g:fuf_help_prompt = '>Help[]>'
-<
- プロンプト文字列。"[]" ã¯ã‚¤ãƒ³ã‚¸ã‚±ãƒ¼ã‚¿ã«ç½®æ›ã•ã‚Œã¾ã™ã€‚
-
- *g:fuf_help_switchOrder* >
- let g:fuf_help_switchOrder = 160
-<
- 次/å‰ã®ãƒ¢ãƒ¼ãƒ‰ã«åˆ‡ã‚Šæ›¿ãˆã‚‹ã¨ãã®ã€ãƒ¢ãƒ¼ãƒ‰ã®é †ä½ã§ã™ã€‚è² æ•°ãªã‚‰ã“ã®ãƒ¢ãƒ¼ãƒ‰
- ã«ã¯åˆ‡ã‚Šæ›¿ãˆã¾ã›ã‚“。
-
-
-==============================================================================
-vimrc ã®ä¾‹ *fuf-vimrc-example*
-
->
- let g:fuf_modesDisable = []
- let g:fuf_mrufile_maxItem = 400
- let g:fuf_mrucmd_maxItem = 400
- nnoremap <silent> sj :FufBuffer<CR>
- nnoremap <silent> sk :FufFileWithCurrentBufferDir<CR>
- nnoremap <silent> sK :FufFileWithFullCwd<CR>
- nnoremap <silent> s<C-k> :FufFile<CR>
- nnoremap <silent> sl :FufCoverageFileChange<CR>
- nnoremap <silent> sL :FufCoverageFileChange<CR>
- nnoremap <silent> s<C-l> :FufCoverageFileRegister<CR>
- nnoremap <silent> sd :FufDirWithCurrentBufferDir<CR>
- nnoremap <silent> sD :FufDirWithFullCwd<CR>
- nnoremap <silent> s<C-d> :FufDir<CR>
- nnoremap <silent> sn :FufMruFile<CR>
- nnoremap <silent> sN :FufMruFileInCwd<CR>
- nnoremap <silent> sm :FufMruCmd<CR>
- nnoremap <silent> su :FufBookmarkFile<CR>
- nnoremap <silent> s<C-u> :FufBookmarkFileAdd<CR>
- vnoremap <silent> s<C-u> :FufBookmarkFileAddAsSelectedText<CR>
- nnoremap <silent> si :FufBookmarkDir<CR>
- nnoremap <silent> s<C-i> :FufBookmarkDirAdd<CR>
- nnoremap <silent> st :FufTag<CR>
- nnoremap <silent> sT :FufTag!<CR>
- nnoremap <silent> s<C-]> :FufTagWithCursorWord!<CR>
- nnoremap <silent> s, :FufBufferTag<CR>
- nnoremap <silent> s< :FufBufferTag!<CR>
- vnoremap <silent> s, :FufBufferTagWithSelectedText!<CR>
- vnoremap <silent> s< :FufBufferTagWithSelectedText<CR>
- nnoremap <silent> s} :FufBufferTagWithCursorWord!<CR>
- nnoremap <silent> s. :FufBufferTagAll<CR>
- nnoremap <silent> s> :FufBufferTagAll!<CR>
- vnoremap <silent> s. :FufBufferTagAllWithSelectedText!<CR>
- vnoremap <silent> s> :FufBufferTagAllWithSelectedText<CR>
- nnoremap <silent> s] :FufBufferTagAllWithCursorWord!<CR>
- nnoremap <silent> sg :FufTaggedFile<CR>
- nnoremap <silent> sG :FufTaggedFile!<CR>
- nnoremap <silent> so :FufJumpList<CR>
- nnoremap <silent> sp :FufChangeList<CR>
- nnoremap <silent> sq :FufQuickfix<CR>
- nnoremap <silent> sy :FufLine<CR>
- nnoremap <silent> sh :FufHelp<CR>
- nnoremap <silent> se :FufEditDataFile<CR>
- nnoremap <silent> sr :FufRenewCache<CR>
-<
-
-==============================================================================
-ã‚ã°ã†ã¨ *fuf-about* *fuf-contact* *fuf-author*
-
-作者: Takeshi NISHIDA <ns9tks@DELETE-ME.gmail.com>
-ライセンス: MIT Licence
-URL: http://www.vim.org/scripts/script.php?script_id=1984
- http://bitbucket.org/ns9tks/vim-fuzzyfinder/
-
-ãƒã‚°ã‚„è¦æœ›ãªã© ~
-
-ã“ã¡ã‚‰ã¸ã©ã†ãž: http://bitbucket.org/ns9tks/vim-fuzzyfinder/issues/
-
-==============================================================================
- vim:tw=78:ts=8:ft=help:norl:
diff --git a/vim/doc/fuf.txt b/vim/doc/fuf.txt
deleted file mode 100644
index 2e36831..0000000
--- a/vim/doc/fuf.txt
+++ /dev/null
@@ -1,1883 +0,0 @@
-*fuf.txt* buffer/file/command/tag/etc explorer with fuzzy matching.
-
- Copyright (c) 2007-2010 Takeshi NISHIDA
-
-FuzzyFinder *fuzzyfinder* *fuf*
-
-INTRODUCTION |fuf-introduction|
-INSTALLATION |fuf-installation|
-USAGE |fuf-usage|
-MODES |fuf-modes|
-DETAILED TOPICS |fuf-detailed-topics|
-COMMANDS |fuf-commands|
-OPTIONS |fuf-options|
-VIMRC EXAMPLE |fuf-vimrc-example|
-SPECIAL THANKS |fuf-thanks|
-CHANGELOG |fuf-changelog|
-ABOUT |fuf-about|
-
-==============================================================================
-INTRODUCTION *fuf-introduction*
-
-FuzzyFinder provides convenient ways to quickly reach the
-buffer/file/command/bookmark/tag you want. FuzzyFinder searches with the
-fuzzy/partial pattern to which it converted an entered pattern.
-
- Entered pattern Fuzzy pattern Partial pattern ~
->
- abc *a*b*c* *abc*
- dir/file dir/*f*i*l*e* dir/*file*
- d*r/file d*r/*f*i*l*e* d*r/*file*
- ../**/s ../**/*s* ../**/*s*
- (** allows searching a directory tree.)
-<
-You will be happy when:
-
- "./AhLongLongLongLongLongFile.txt"
- "./AhLongLongLongLongLongName.txt"
- "./OhLongLongLongLongLongFile.txt"
- "./OhLongLongLongLongLongName.txt" <- you want :O
-
-Type "ON" and "OhLongLongLongLongLongName.txt" will be selected. :D
-
-FuzzyFinder can search:
-
- - buffers
- - files
- - directories
- - most recently used files
- - files around most recently used files
- - most recently used command-lines
- - bookmarked files
- - bookmarked directories
- - tags
- - files which are included in current tagfiles
- - jump list
- - change list
- - buffer lines
- - quickfix
- - help
-
-FuzzyFinder also provides APIs to use its system of searching files or
-selecting items.
-
-FuzzyFinder supports multibyte characters.
-
-
-==============================================================================
-INSTALLATION *fuf-installation*
-
-Put all files into your runtime directory. If you have the zip file, extract
-it to your runtime directory.
-
-You should place the files as follows:
->
- <your runtime directory>/plugin/fuf.vim
- <your runtime directory>/doc/fuf.txt
- ...
-<
-If you are disgusted to make your runtime directory confused with a lot of
-plugins, put each of the plugins into a directory individually and just add
-the directory path to 'runtimepath'. It's easy to uninstall plugins.
-
-Then update your help tags files to enable help for this plugin. See
-|add-local-help| for details.
-
-Requirements: ~
-
-- L9 library (vimscript #3252)
-
-
-==============================================================================
-USAGE *fuf-usage*
-
-You can launch FuzzyFinder by the following commands:
-
- Command Mode ~
- |:FufBuffer| - Buffer mode (|fuf-buffer-mode|)
- |:FufFile| - File mode (|fuf-file-mode|)
- |:FufCoverageFile| - Coverage-File mode (|fuf-coveragefile-mode|)
- |:FufDir| - Directory mode (|fuf-dir-mode|)
- |:FufMruFile| - MRU-File mode (|fuf-mrufile-mode|)
- |:FufMruCmd| - MRU-Command mode (|fuf-mrucmd-mode|)
- |:FufBookmarkFile| - Bookmark-File mode (|fuf-bookmarkfile-mode|)
- |:FufBookmarkDir| - Bookmark-Dir mode (|fuf-bookmarkdir-mode|)
- |:FufTag| - Tag mode (|fuf-tag-mode|)
- |:FufBufferTag| - Buffer-Tag mode (|fuf-buffertag-mode|)
- |:FufTaggedFile| - Tagged-File mode (|fuf-taggedfile-mode|)
- |:FufJumpList| - Jump-List mode (|fuf-jumplist-mode|)
- |:FufChangeList| - Change-List mode (|fuf-changelist-mode|)
- |:FufQuickfix| - Quickfix mode (|fuf-quickfix-mode|)
- |:FufLine| - Line mode (|fuf-line-mode|)
- |:FufHelp| - Help mode (|fuf-help-mode|)
-
-It is recommended to map these commands.
-
-These commands open 1-line buffer to enter search pattern and start insert
-mode.
-
-FuzzyFinder searchs for matching items with an entered pattern and shows them
-in a completion menu. For more details on pattern matching, see
-|fuf-search-patterns|.
-
-If there are a lot of matching items, FuzzyFinder limits the number of
-enumerating items (|g:fuf_enumeratingLimit|) to speed up a response time, and
-highlights the pattern with "Error" group.
-
-The first item in the completion menu will be selected automatically.
-
-Typing <C-w> deletes one block of an entered pattern before the cursor, like a
-directory name.
-
-with <C-s> (|g:fuf_keyPrevPattern|) and <C-^> (|g:fuf_keyNextPattern|), You
-can recall patterns which have been entered before from history.
-
-You can open a selected item in various ways:
-
- <CR> (|g:fuf_keyOpen|) - opens in a previous window.
- <C-j> (|g:fuf_keyOpenSplit|) - opens in a split window.
- <C-k> (|g:fuf_keyOpenVsplit|) - opens in a vertical-split window.
- <C-l> (|g:fuf_keyOpenTabpage|) - opens in a new tab page.
-
-To cancel and return to previous window, just leave Insert mode.
-
-With <C-\><C-\> (|g:fuf_keySwitchMatching|), You can switch search method
-between fuzzy matching and partial matching.
-
-With <C-t> (|g:fuf_keyNextMode|) and <C-y> (|g:fuf_keyPrevMode|), You can
-switch current mode without leaving Insert mode .
-
-You can preview selected item with <C-@> (|g:fuf_keyPreview|) in some modes.
-Repeating the key on the same item shows another information. The height
-of command-line area is changed to |g:fuf_previewHeight| when you launch a
-mode supporting preview. This feature is available when |g:fuf_previewHeight|
-is not 0.
-
-
-==============================================================================
-MODES *fuf-modes*
-
- *fuf-buffer-mode*
-Buffer mode ~
-
-This mode provides an interface to select a buffer from a list of existing
-buffers and open it.
-
-Press <C-]> (|g:fuf_buffer_keyDelete|) in this mode and selected buffer will
-be deleted.
-
- *fuf-file-mode*
-File mode ~
-
-This mode provides an interface to search a file tree for a file and open it.
-
- *fuf-coveragefile-mode*
-Coverage-File mode ~
-
-This mode provides an interface to select a file from all files of a preset
-coverage and open it.
-
-By default, This mode lists all files under the current working directory
-recursively. (|g:fuf_coveragefile_globPatterns|)
-
-If you want to search other coverage, execute |FufCoverageFileRegister|
-command to register new search coverage and |FufCoverageFileChange| command to
-choose a search coverage and launch Coverage-File mode.
-
-In addition, there is another way to change a search coverage with
-|fuf#setOneTimeVariables()| function.
-
-Example: search only .h and .c files:
->
- call fuf#setOneTimeVariables(['g:fuf_coveragefile_globPatterns', ['**/*.h', '**/*.c']])
- \ | FufCoverageFile
-<
-Example: search your home directory in addition to the default coverage:
->
- call fuf#setOneTimeVariables(['g:fuf_coveragefile_globPatterns', g:fuf_coveragefile_globPatterns + ['~/**/.*', '~/**/*']])
- \ | FufCoverageFile
-<
-
- *fuf-dir-mode*
-Directory mode ~
-
-This mode provides an interface to search a file tree for a directory and
-change the current directory.
-
- *fuf-mrufile-mode*
-MRU-File mode ~
-
-This mode provides an interface to select a file from the most recently used
-files and open it.
-
-Press <C-]> (|g:fuf_mrufile_keyExpand|) in this mode and files around the most
-recently used files are listed. Each time the key is pressed, the search range
-are expanded one level along the directory tree upwardly/downwardly.
-
-This mode is set to disable by default (|g:fuf_modesDisable|) because
-processes for this mode in |BufEnter| and |BufWritePost| could cause
-Performance issue.
-
-See also: |FufMruFileInCwd|
-
- *fuf-mrucmd-mode*
-MRU-Command mode ~
-
-This mode provides an interface to select a command from the most recently
-used commands and execute it.
-
-This mode is set to disable by default (|g:fuf_modesDisable|) because mapping
-<CR> of Command-line mode required by this mode has side effects.
-
- *fuf-bookmarkfile-mode*
-Bookmark-File mode ~
-
-This mode provides an interface to select one of the bookmarks you have added
-beforehand and jump there.
-
-You can add a cursor line to bookmarks by |:FufBookmarkFileAdd| command.
-Execute that command and you will be prompted to enter a bookmark name.
-
-FuzzyFinder adjusts a line number for jump. If a line of bookmarked position
-does not match to a pattern when the bookmark was added, FuzzyFinder searches
-a matching line around bookmarked position. So you can jump to a bookmarked
-line even if the line is out of bookmarked position. If you want to jump to
-bookmarked line number without the adjustment, set
-|g:fuf_bookmarkfile_searchRange| option to 0.
-
-Press <C-]> (|g:fuf_bookmarkfile_keyDelete|) in this mode and selected
-bookmark will be deleted.
-
- *fuf-bookmarkdir-mode*
-Bookmark-Dir mode ~
-
-This mode provides an interface to select one of the bookmarks you have added
-beforehand and change the current directory.
-
-You can add a directory to bookmarks by |:FufBookmarkDirAdd| command. Execute
-that command and you will be prompted to enter a directory path and a
-bookmark name.
-
-Press <C-]> (|g:fuf_bookmarkdir_keyDelete|) in this mode and selected bookmark
-will be deleted.
-
- *fuf-tag-mode*
-Tag mode ~
-
-This mode provides an interface to select a tag and jump to the definition of
-it.
-
-Following mapping is a replacement for <C-]>:
->
- noremap <silent> <C-]> :FufTagWithCursorWord!<CR>
-<
-
- *fuf-buffertag-mode*
-Buffer-Tag mode ~
-
-This mode provides an interface to select a tag of current buffer or all
-buffers and jump to the definition of it.
-
-Tag list is instantly created when FuzzyFinder is launched, so there is no
-need to make tags file in advance.
-
-|FufBufferTag| covers current buffer and |FufBufferTagAll| covers all buffers.
-
-Following mapping is a replacement for <C-]>:
->
- nnoremap <silent> <C-]> :FufBufferTagWithCursorWord!<CR>
- vnoremap <silent> <C-]> :FufBufferTagAllWithSelectedText!<CR>
-<
-or
->
- nnoremap <silent> <C-]> :FufBufferTagAllWithCursorWord!<CR>
- vnoremap <silent> <C-]> :FufBufferTagAllWithSelectedText!<CR>
-<
-This mode is inspired by taglist.vim (vimscript #273) and refered its codes.
-
- *fuf-taggedfile-mode*
-Tagged-File mode ~
-
-This mode provides an interface to select one of the files which are included
-in current tagfiles and open it.
-
- *fuf-jumplist-mode*
-Jump-List mode ~
-
-This mode provides an interface to select one from the |jumplist| of the
-current window and jump there.
-
- *fuf-changelist-mode*
-Change-List mode ~
-
-This mode provides an interface to select one from the |changelist| of the
-current buffer and jump there.
-
- *fuf-quickfix-mode*
-Quickfix mode ~
-
-This mode provides an interface to select one from the |quickfix| list and
-jump there.
-
- *fuf-line-mode*
-Line mode ~
-
-This mode provides an interface to select a line from current buffer and jump
-there.
-
- *fuf-help-mode*
-Help mode ~
-
-This mode provides an interface to select a help tag and jump to the help
-page.
-
- *fuf-givenfile-mode*
-Given-File mode ~
-
-This mode provides an API to open a selected file from a given list.
-
-API function:
->
- function fuf#givenfile#launch(
- \ initialPattern, partialMatching, prompt, items)
-<
- initialPattern - String which is inserted after launching
- FuzzyFinder.
- partialMatching - If non-zero, enable partial matching instead of
- fuzzy matching.
- prompt - Prompt string
- items - List of items.
-
-Example of use:
->
- " Open one of your dotfiles.
- call fuf#givenfile#launch('', 0, '>', split(glob('~/.*'), "\n"))
-<
-
- *fuf-givendir-mode*
-Given-Directory mode ~
-
-This mode provides an API to change current working directory to a selected
-one from a given list.
-
-API function:
->
- function fuf#givendir#launch(
- \ initialPattern, partialMatching, prompt, items)
-<
- initialPattern - String which is inserted after launching
- FuzzyFinder.
- partialMatching - If non-zero, enable partial matching instead of
- fuzzy matching.
- prompt - Prompt string
- items - List of items.
-
-
-Example of use:
->
- " Change current working directory to one of your runtime directory.
- call fuf#givendir#launch('', 0, '>', split(&runtimepath, ','))
-<
-
- *fuf-givencmd-mode*
-Given-Command mode ~
-
-This mode provides an API to execute a selected command from a given list.
-
-A selected command is executed by |feedkeys()|, so it is able to emulate a
-series of key input in Normal mode.
-
-API function:
->
- function fuf#givencmd#launch(
- \ initialPattern, partialMatching, prompt, items)
-<
- initialPattern - String which is inserted after launching
- FuzzyFinder.
- partialMatching - If non-zero, enable partial matching instead of
- fuzzy matching.
- prompt - Prompt string
- items - List of items.
-
-
-Example of use:
->
- function GetAllCommands()
- redir => commands
- silent command
- redir END
- return map((split(commands, "\n")[3:]),
- \ '":" . matchstr(v:val, ''^....\zs\S*'')')
- endfunction
-
- " execute one of the user-defined commands
- call fuf#givencmd#launch('', 0, '>', GetAllCommands())
-
-<
-
- *fuf-callbackfile-mode*
-Callback-File mode ~
-
-This mode provides an API to find and get a file path which is selected by an
-user.
-
-API function:
->
- function fuf#callbackfile#launch(
- \ initialPattern, partialMatching, prompt, exclude, listener)
-<
- initialPattern - String which is inserted after launching
- FuzzyFinder.
- partialMatching - If non-zero, enable partial matching instead of
- fuzzy matching.
- prompt - Prompt string.
- exclude - Regexp pattern for items which you want to exclude
- from completion list.
- listener - |Dictionary| which has 'onComplete' and 'onAbort'.
- They are called at the end of FuzzyFinder.
- listener.onComplete(item, method) is called with 2
- arguments which are a name of selected item and a
- number of open method when completed.
- listener.onAbort() is called when aborted.
-
-Example of use:
->
- let listener = {}
-
- function listener.onComplete(item, method)
- echo "Item: " . a:item . "\nMethod: " . a:method
- endfunction
-
- function listener.onAbort()
- echo "Abort"
- endfunction
-
- " Find a file from current working directory.
- call fuf#callbackfile#launch('', 0, '>', '', listener)
-
- " Find a file from home directory.
- call fuf#callbackfile#launch('~/', 0, '>', '', listener)
-<
-
- *fuf-callbackitem-mode*
-Callback-Item mode ~
-
-This mode provides an API to get an item which is selected from a given list
-by an user.
-
-API function:
->
- function fuf#callbackitem#launch(
- \ initialPattern, partialMatching, prompt, listener, items, forPath)
-<
- initialPattern - String which is inserted after launching
- FuzzyFinder.
- partialMatching - If non-zero, enable partial matching instead of
- fuzzy matching.
- prompt - Prompt string
- listener - |Dictionary| which has 'onComplete' and 'onAbort'.
- They are called at the end of FuzzyFinder.
- listener.onComplete(item, method) is called with 2
- arguments which are a name of selected item and a
- number of open method when completed.
- listener.onAbort() is called when aborted.
- items - List of items.
- forPath - If non-zero, use a matching method for files.
-
-Example of use:
->
- let listener = {}
-
- function listener.onComplete(item, method)
- echo "Item: " . a:item . "\nMethod: " . a:method
- endfunction
-
- function listener.onAbort()
- echo "Abort"
- endfunction
-
- " Select an item from a given list.
- call fuf#callbackitem#launch('', 0, '>', listener, ['ed', 'vi', 'vim'], 0)
-
- " Select a file from a given list.
- call fuf#callbackitem#launch('', 0, '>', listener, ['../foo/bar', 'baz'], 1)
-<
-
-==============================================================================
-DETAILED TOPICS *fuf-detailed-topics*
-
- *fuf-setting-one-time-option* *fuf#setOneTimeVariables()*
-Setting One-Time Options ~
-
-If you want to set one-time options only for the next FuzzyFinder,
-|fuf#setOneTimeVariables()| function will be of help. This function is used as
-follows:
->
- call fuf#setOneTimeVariables(['g:fuf_ignoreCase', 0], ['&lines', 50])
-<
-This function takes 0 or more arguments and each of them is a pair of a
-variable name and its value. Specified options will be set practically next
-time FuzzyFinder is launched, and restored when FuzzyFinder is closed.
-
- *fuf-search-patterns*
-Search Patterns ~
-
-You can enter one primary pattern and zero or more refining patterns as search
-patterns. An entered pattern is separated by ";" (|g:fuf_patternSeparator|),
-and the first pattern is a primary pattern and the rest of patterns is a
-refining pattern.
->
- primary refining refining
- |----------| |-------| |----|
- >MruFile>bookmark.vim;autoload/;/home/
-<
-A refining pattern is used to narrow down the list of matching items by
-another pattern.
-
-With a primary pattern, FuzzyFinder does fuzzy matching or partial matching,
-which you specified. With a refining pattern, FuzzyFinder does partial
-matching by default. (|g:fuf_fuzzyRefining|)
-
-When you enter a number as refining pattern, it also can match the index of
-each item.
-
-In a mode which targets a static set of file paths (such as Buffer or MRU-File
-mode, not File or Directory) and |g:fuf_splitPathMatching| is non-zero,
-matching with a primary pattern is divided into head part and tail part and
-done individually.
->
- head tail
- |------||-----|
- foo/bar/baz.vim
-
- fuzzy matching example:
- +----------------+---------+---------+---------+
- | item \ pattern | foo/bar | foo/ | bar |
- +----------------+---------+---------+---------+
- | foo/bar | match | match | match |
- | foo/abc | unmatch | match | unmatch |
- | abc/bar | unmatch | unmatch | match |
- | foobar | unmatch | unmatch | match |
- | foooo/barrrr | match | match | match |
- | foooo/fooooo | unmatch | match | unmatch |
- +----------------+---------+---------+---------+
-<
-refining pattern can match anywhere on each path in the above case.
-
- *fuf-sorting-of-completion-items*
-Sorting Of Completion Items ~
-
-FuzzyFinder sorts completion items with some rules.
-
-An item, one part of which is matched with a whole pattern, is placed upper.
-E.g., with the pattern "bc", the item "abc" is placed upper than "bac".
-
-In the above case, items, each having matching part at the head of itself, are
-placed upper than others. E.g., with the pattern "foo", the item "foobar" is
-placed upper than "foobarbaz".
-
-And the shorter the length of the item after matching position puts it higher.
-E.g., with the pattern "bar", the item "foobar" is placed upper than
-"foobarbaz".
-
-If a pattern matches an item at only word boundaries of it, the item is placed
-upper. E.g., with a pattern "fb", items such as "fooBarBaz" and "foo_bar_baz"
-is placed upper.
-
-Plus, FuzzyFinder has a learning system. An item which has been completed in
-the past with current pattern is placed upper.
-
- *fuf-reusing-window*
-Reusing Of A Window Containing Target Buffer/File ~
-
-If a window containing target buffer is found in current tab page when
-FuzzyFinder is going to open the buffer in a split new window, move to it. If
-a window containing target buffer is found in other tab page when FuzzyFinder
-is going to open the buffer in a new tab page, move to it.
-
-You can disable that feature via 'reuse_window' options if always want to open
-a buffer in a new window.
-
- *fuf-hiding-menu*
-To Hide The Completion Menu Temporarily In FuzzyFinder ~
-
-You can close it by <C-e> and reopen it by <C-x><C-o>.
-
- *fuf-abbreviation* *fuf-multiple-search*
-Abbreviations And Multiple Search ~
-
-You can use abbreviations and multiple search in all modes by setting
-|g:fuf_abbrevMap| option.
-
-For example, set as below:
->
- let g:fuf_abbrevMap = {
- \ "^doc:" : [
- \ "~/project/**/doc/",
- \ ".vim/doc/",
- \ ],
- \ }
-<
-and enter "doc:txt" in File mode, then FuzzyFinder searches by the following
-patterns:
-
- "~/project/**/doc/*t*x*t*"
- ".vim/doc/*t*x*t*"
-
-and show concatenated search results.
-
- *fuf-data-file*
-Data File ~
-
-FuzzyFinder writes completion statistics, MRU data, bookmark, etc to files
-under |g:fuf_dataDir|.
-
-|:FufEditDataFile| command is helpful in editing your data files. This command
-reads the data file in new unnamed buffer. Write the buffer and the data file
-will be updated.
-
- *fuf-cache*
-Cache ~
-
-Once a cache was created, It is not automatically updated to speed up the
-response time by default. To update it, use |:FufRenewCache| command.
-
- *fuf-dot-sequence*
-Going Up Parent Directories With Dot Sequence ~
-
-You can go up parent directories with entering dot sequence. Dot sequence
-after a path separator is expanded to "../" sequence.
-
- Dot sequence Expanded pattern ~
- /.. /../
- /... /../../
- /.... /../../../
-
- *fuf-how-to-add-mode*
-How To Add Mode ~
-
-To add "mymode" mode, put the source file at autoload/fuf/mymode.vim and call
-fuf#addMode("mymode") .
-
- *fuf-migemo*
-What Is Migemo ~
-
-Migemo is a search method for Japanese language.
-
-
-==============================================================================
-COMMANDS *fuf-commands*
-
-See also: |fuf-vimrc-example|
-
- *:FufBuffer*
-:FufBuffer[!] [{pattern}]
- Launchs Buffer mode.
-
- If a command was executed with a ! modifier, it does partial matching
- instead of fuzzy matching.
-
- {pattern} will be inserted after launching FuzzyFinder.
-
- *:FufFile*
-:FufFile[!] [{pattern}]
- Launchs File mode.
-
- If a command was executed with a ! modifier, it does partial matching
- instead of fuzzy matching.
-
- {pattern} will be inserted after launching FuzzyFinder.
-
- *:FufFileWithFullCwd*
-:FufFileWithFullCwd[!] [{pattern}]
- Is mostly the same as |:FufFile|, except that initial pattern is a
- full path of current working directory.
-
- *:FufFileWithCurrentBufferDir*
-:FufFileWithCurrentBufferDir[!] [{pattern}]
- Is mostly the same as |:FufFile|, except that initial pattern is a
- path of directory current buffer is in.
-
- *:FufCoverageFile*
-:FufCoverageFile[!] [{pattern}]
- Launchs Coverage-File mode.
-
- If a command was executed with a ! modifier, it does partial matching
- instead of fuzzy matching.
-
- {pattern} will be inserted after launching FuzzyFinder.
-
- *:FufDir*
-:FufDir[!] [{pattern}]
- Launchs Directory mode.
-
- If a command was executed with a ! modifier, it does partial matching
- instead of fuzzy matching.
-
- {pattern} will be inserted after launching FuzzyFinder.
-
- *:FufDirWithFullCwd*
-:FufDirWithFullCwd[!] [{pattern}]
- Is mostly the same as |:FufDir|, except that initial pattern is a full
- path of current working directory.
-
- *:FufDirWithCurrentBufferDir*
-:FufDirWithCurrentBufferDir[!] [{pattern}]
- Is mostly the same as |:FufDir|, except that initial pattern is a path
- of directory current buffer is in.
-
- *:FufMruFile*
-:FufMruFile[!] [{pattern}]
- Launchs MRU-File mode.
-
- If a command was executed with a ! modifier, it does partial matching
- instead of fuzzy matching.
-
- {pattern} will be inserted after launching FuzzyFinder.
-
- *:FufMruFileInCwd*
-:FufMruFileInCwd[!] [{pattern}]
- Is mostly the same as |:FufMruFile|, except that files
- only in current working directory are listed.
-
- *:FufMruCmd*
-:FufMruCmd[!] [{pattern}]
- Launchs MRU-Command mode.
-
- If a command was executed with a ! modifier, it does partial matching
- instead of fuzzy matching.
-
- {pattern} will be inserted after launching FuzzyFinder.
-
- *:FufBookmarkFile*
-:FufBookmarkFile[!] [{pattern}]
- Launchs Bookmark-File mode.
-
- If a command was executed with a ! modifier, it does partial matching
- instead of fuzzy matching.
-
- {pattern} will be inserted after launching FuzzyFinder.
-
- *:FufBookmarkDir*
-:FufBookmarkDir[!] [{pattern}]
- Launchs Bookmark-Dir mode.
-
- If a command was executed with a ! modifier, it does partial matching
- instead of fuzzy matching.
-
- {pattern} will be inserted after launching FuzzyFinder.
-
- *:FufTag*
-:FufTag[!] [{pattern}]
- Launchs Tag mode.
-
- If a command was executed with a ! modifier, it does partial matching
- instead of fuzzy matching.
-
- {pattern} will be inserted after launching FuzzyFinder.
-
- *:FufTagWithCursorWord*
-:FufTagWithCursorWord[!] [{pattern}]
- Is mostly the same as |:FufTag|, except that initial pattern is the
- word under the cursor.
-
- *:FufBufferTag*
-:FufBufferTag[!] [{pattern}]
- Launchs Buffer-Tag mode.
-
- If a command was executed with a ! modifier, it does partial matching
- instead of fuzzy matching.
-
- {pattern} will be inserted after launching FuzzyFinder.
-
- *:FufBufferTagAll*
-:FufBufferTagAll[!] [{pattern}]
- Is mostly the same as |:FufBufferTag|, except that tags are gathered
- from all other buffers in addition to the current one.
-
- *:FufBufferTagWithCursorWord*
-:FufBufferTagWithCursorWord[!] [{pattern}]
- Is mostly the same as |:FufBufferTag|, except that initial pattern is
- the word under the cursor.
-
- *:FufBufferTagAllWithCursorWord*
-:FufBufferTagAllWithCursorWord[!] [{pattern}]
- Is mostly the same as |:FufBufferTagAll|, except that initial pattern
- is the word under the cursor.
-
- *:FufBufferTagWithSelectedText*
-:FufBufferTagWithSelectedText[!] [{pattern}]
- Is mostly the same as |:FufBufferTag|, except that initial pattern is
- the last selected text.
-
- *:FufBufferTagAllWithSelectedText*
-:FufBufferTagAllWithSelectedText[!] [{pattern}]
- Is mostly the same as |:FufBufferTagAll|, except that initial pattern
- is the last selected text.
-
- *:FufTaggedFile*
-:FufTaggedFile[!] [{pattern}]
- Launchs Tagged-File mode.
-
- If a command was executed with a ! modifier, it does partial matching
- instead of fuzzy matching.
-
- {pattern} will be inserted after launching FuzzyFinder.
-
- *:FufJumpList*
-:FufJumpList[!] [{pattern}]
- Launchs Jump-List mode.
-
- If a command was executed with a ! modifier, it does partial matching
- instead of fuzzy matching.
-
- {pattern} will be inserted after launching FuzzyFinder.
-
- *:FufChangeList*
-:FufChangeList[!] [{pattern}]
- Launchs Change-List mode.
-
- If a command was executed with a ! modifier, it does partial matching
- instead of fuzzy matching.
-
- {pattern} will be inserted after launching FuzzyFinder.
-
- *:FufQuickfix*
-:FufQuickfix[!] [{pattern}]
- Launchs Quickfix mode.
-
- If a command was executed with a ! modifier, it does partial matching
- instead of fuzzy matching.
-
- {pattern} will be inserted after launching FuzzyFinder.
-
- *:FufLine*
-:FufLine[!] [{pattern}]
- Launchs Line mode.
-
- If a command was executed with a ! modifier, it does partial matching
- instead of fuzzy matching.
-
- {pattern} will be inserted after launching FuzzyFinder.
-
- *:FufHelp*
-:FufHelp[!] [{pattern}]
- Launchs Help mode.
-
- If a command was executed with a ! modifier, it does partial matching
- instead of fuzzy matching.
-
- {pattern} will be inserted after launching FuzzyFinder.
-
- *:FufEditDataFile*
-:FufEditDataFile
- Opens a buffer for editing your data files. See |fuf-data-file| for
- details.
-
- *:FufCoverageFileRegister*
-:FufCoverageFileRegister
- Registers new search coverage to be searched in Coverage-File mode.
- First, input glob patterns, like ~/* . You can add patterns unless
- typing <Esc>. Next, input coverage name.
-
- See also: |glob()|, |fuf-coveragefile-mode|
-
- *:FufCoverageFileChange*
-:FufCoverageFileChange [{name}]
- Launchs Coverage-File mode with a chosen coverage, registered with
- |FufCoverageFileRegister| command.
-
- If location name is given, the choise process will be skipped.
-
- See also: |fuf-coveragefile-mode|
-
- *:FufBookmarkFileAdd*
-:FufBookmarkFileAdd [{name}]
- Adds a cursor line to bookmarks.
-
- See also: |fuf-bookmarkfile-mode|
-
- *:FufBookmarkFileAddAsSelectedText*
-:FufBookmarkFileAddAsSelectedText
- Is mostly the same as |:FufBookmarkFileAdd|, except that initial
- pattern is the last selected one.
-
- *:FufBookmarkDirAdd*
-:FufBookmarkDirAdd [{name}]
- Adds a directory to bookmarks.
-
- See also: |fuf-bookmarkdir-mode|
-
- *:FufRenewCache*
-:FufRenewCache
- Removes caches to renew completion items. See |fuf-cache| for details.
-
-
-==============================================================================
-OPTIONS *fuf-options*
-
- *fuf-options-for-all-modes*
-For All Modes ~
-
- *g:fuf_modesDisable* >
- let g:fuf_modesDisable = [ 'mrufile', 'mrucmd', ]
-<
- List of mode names to disable.
-
- Modes which are listed will never be initialized and never handle any
- event.
-
- *g:fuf_keyOpen* >
- let g:fuf_keyOpen = '<CR>'
-<
- Key mapped to select completion item or finish input and open a
- buffer/file in previous window.
-
- *g:fuf_keyOpenSplit* >
- let g:fuf_keyOpenSplit = '<C-j>'
-<
- Key mapped to select completion item or finish input and open a
- buffer/file in split new window
-
- *g:fuf_keyOpenVsplit* >
- let g:fuf_keyOpenVsplit = '<C-k>'
-<
- Key mapped to select completion item or finish input and open a
- buffer/file in vertical-split new window.
-
- *g:fuf_keyOpenTabpage* >
- let g:fuf_keyOpenTabpage = '<C-l>'
-<
-
- Key mapped to select completion item or finish input and open a
- buffer/file in a new tab page.
-
- *g:fuf_keyPreview* >
- let g:fuf_keyPreview = '<C-@>'
-<
-
- Key mapped to show information of selected completion item on
- command-line area. This key makes sense only in modes supporting
- preview.
-
- *g:fuf_keyNextMode* >
- let g:fuf_keyNextMode = '<C-t>'
-<
- Key mapped to switch to next mode.
-
- *g:fuf_keyPrevMode* >
- let g:fuf_keyPrevMode = '<C-y>'
-<
- Key mapped to switch to previous mode.
-
- *g:fuf_keyPrevPattern* >
- let g:fuf_keyPrevPattern = '<C-s>'
-<
- Key mapped to recall previous entered patten from history.
-
- *g:fuf_keyNextPattern* >
- let g:fuf_keyNextPattern = '<C-_>'
-<
- Key mapped to recall next entered patten from history.
-
- *g:fuf_keySwitchMatching* >
- let g:fuf_keySwitchMatching = '<C-\><C-\>'
-<
- Key mapped to switch between fuzzy matching and partial matching.
-
- *g:fuf_dataDir* >
- let g:fuf_dataDir = '~/.vim-fuf-data'
-<
- Directory path to which data files is put. If empty string,
- FuzzyFinder does not write data files.
-
- *g:fuf_abbrevMap* >
- let g:fuf_abbrevMap = {}
-<
- |Dictionary|. Each value must be a |List|. All matchs of a
- key in entered text is expanded with the value.
-
- *g:fuf_patternSeparator* >
- let g:fuf_patternSeparator = ';'
-<
- String which sparates a input pattern into a primary pattern and
- refining patterns.
-
- *g:fuf_promptHighlight* >
- let g:fuf_promptHighlight = 'Question'
-<
- a highlight group name for a prompt string.
-
- *g:fuf_ignoreCase* >
- let g:fuf_ignoreCase = 1
-<
- If non-zero, FuzzyFinder ignores case in search patterns.
-
- *g:fuf_splitPathMatching* >
- let g:fuf_splitPathMatching = 1
-<
- If non-zero, matching with a primary pattern is divided into head part
- and tail part and done individually.
-
- See also: |fuf-search-patterns|
-
- *g:fuf_fuzzyRefining* >
- let g:fuf_fuzzyRefining = 0
-<
- If non-zero, fuzzy matching is done with refining pattern instead of
- partial matching.
-
- See also: |fuf-search-patterns|
-
- *g:fuf_reuseWindow* >
- let g:fuf_reuseWindow = 1
-<
- If non-zero and when FuzzyFinder opens a buffer which has already been
- opened, it reuses a window containing the target buffer.
-
- *g:fuf_timeFormat* >
- let g:fuf_timeFormat = '(%Y-%m-%d %H:%M:%S)'
-<
- String to format time string. See |strftime()| for details.
-
- *g:fuf_learningLimit* >
- let g:fuf_learningLimit = 100
-<
- Ceiling for the number of completion statistics to be stored.
-
- *g:fuf_enumeratingLimit* >
- let g:fuf_enumeratingLimit = 50
-<
- To speed up the response time, FuzzyFinder ends enumerating completion
- items when found over this.
-
- *g:fuf_maxMenuWidth* >
- let g:fuf_maxMenuWidth = 78
-<
- If a length of a completion item is more than this, it is snipped in
- completion menu.
-
- *g:fuf_previewHeight* >
- let g:fuf_previewHeight = 0
-<
- 'cmdheight' is set to this when a mode supporting preview is launched.
- Information of selected completion item will be shown on command-line
- area. If zero, preview feature is disabled.
-
- *g:fuf_autoPreview* >
- let g:fuf_autoPreview = 0
-<
- If non-zero, previews will be shown automatically.
-
- *g:fuf_useMigemo* >
- let g:fuf_useMigemo = 0
-<
- If non-zero, FuzzyFinder uses Migemo.
-
- *fuf-options-for-buffer-mode*
-For Buffer Mode ~
-
- *g:fuf_buffer_prompt* >
- let g:fuf_buffer_prompt = '>Buffer[]>'
-<
- Prompt string. "[]" will be substituted with indicators.
-
- *g:fuf_buffer_switchOrder* >
- let g:fuf_buffer_switchOrder = 10
-<
- Number of order for switching to the next/previous mode. If negative
- number, Fuzzyfinder never switches to this mode.
-
- *g:fuf_buffer_mruOrder* >
- let g:fuf_buffer_mruOrder = 1
-<
- If non-zero, completion items is sorted in order of recently used.
-
- *g:fuf_buffer_keyDelete* >
- let g:fuf_buffer_keyDelete = '<C-]>'
-<
- Key mapped to delete selected buffer.
-
- *fuf-options-for-file-mode*
-For File Mode ~
-
- *g:fuf_file_prompt* >
- let g:fuf_file_prompt = '>File[]>'
-<
- Prompt string. "[]" will be substituted with indicators.
-
- *g:fuf_file_switchOrder* >
- let g:fuf_file_switchOrder = 20
-<
- Number of order for switching to the next/previous mode. If negative
- number, Fuzzyfinder never switches to this mode.
-
- *g:fuf_file_exclude* >
- let g:fuf_file_exclude = '\v\~$|\.(o|exe|dll|bak|orig|swp)$|(^|[/\\])\.(hg|git|bzr)($|[/\\])'
-<
- Regexp pattern for items which you want to exclude from completion
- list.
-
- *fuf-options-for-coveragefile-mode*
-For Coverage-File Mode ~
-
- *g:fuf_coveragefile_prompt* >
- let g:fuf_coveragefile_prompt = '>CoverageFile[]>'
-<
- Prompt string. "[]" will be substituted with indicators.
-
- *g:fuf_coveragefile_switchOrder* >
- let g:fuf_coveragefile_switchOrder = 30
-<
- Number of order for switching to the next/previous mode. If negative
- number, Fuzzyfinder never switches to this mode.
-
- *g:fuf_coveragefile_exclude* >
- let g:fuf_coveragefile_exclude = '\v\~$|\.(o|exe|dll|bak|orig|swp)$|(^|[/\\])\.(hg|git|bzr)($|[/\\])'
-<
- Regexp pattern for items which you want to exclude from completion
- list.
-
- *g:fuf_coveragefile_globPatterns* >
- let g:fuf_coveragefile_globPatterns = ['**/.*', '**/*']
-<
- List of glob patterns to get file paths to be searched.
-
- See also: |glob()|
-
- *fuf-options-for-dir-mode*
-For Directory Mode ~
-
- *g:fuf_dir_prompt* >
- let g:fuf_dir_prompt = '>Dir[]>'
-<
- Prompt string. "[]" will be substituted with indicators.
-
- *g:fuf_dir_switchOrder* >
- let g:fuf_dir_switchOrder = 40
-<
- Number of order for switching to the next/previous mode. If negative
- number, Fuzzyfinder never switches to this mode.
-
- *g:fuf_dir_exclude* >
- let g:fuf_dir_exclude = '\v(^|[/\\])\.(hg|git|bzr)($|[/\\])'
-<
- Regexp pattern for items which you want to exclude from completion
- list.
-
- *fuf-options-for-mrufile-mode*
-For MRU-File Mode ~
-
- *g:fuf_mrufile_prompt* >
- let g:fuf_mrufile_prompt = '>MRU-File[]>'
-<
- Prompt string. "[]" will be substituted with indicators.
-
- *g:fuf_mrufile_switchOrder* >
- let g:fuf_mrufile_switchOrder = 50
-<
- Number of order for switching to the next/previous mode. If negative
- number, Fuzzyfinder never switches to this mode.
-
- *g:fuf_mrufile_exclude* >
- let g:fuf_mrufile_exclude = '\v\~$|\.(o|exe|dll|bak|orig|sw[po])$|^(\/\/|\\\\|\/mnt\/|\/media\/)'
-<
- Regexp pattern for items which you want to exclude from completion
- list.
-
- *g:fuf_mrufile_maxItem* >
- let g:fuf_mrufile_maxItem = 200
-<
- Ceiling for the number of MRU items to be stored.
-
- *g:fuf_mrufile_maxItemDir* >
- let g:fuf_mrufile_maxItemDir = 50
-<
- Ceiling for the number of parent directories of MRU items to be
- stored, which are used for around search.
-
- *g:fuf_mrufile_keyExpand* >
- let g:fuf_mrufile_keyExpand = '<C-]>'
-<
- Key mapped to expand search range.
-
- *fuf-options-for-mrucmd-mode*
-For MRU-Cmd Mode ~
-
- *g:fuf_mrucmd_prompt* >
- let g:fuf_mrucmd_prompt = '>MRU-Cmd[]>'
-<
- Prompt string. "[]" will be substituted with indicators.
-
- *g:fuf_mrucmd_switchOrder* >
- let g:fuf_mrucmd_switchOrder = 60
-<
- Number of order for switching to the next/previous mode. If negative
- number, Fuzzyfinder never switches to this mode.
-
- *g:fuf_mrucmd_exclude* >
- let g:fuf_mrucmd_exclude = '^$'
-<
- Regexp pattern for items which you want to exclude from completion
- list.
-
- *g:fuf_mrucmd_maxItem* >
- let g:fuf_mrucmd_maxItem = 200
-<
- This is the ceiling for the number of MRU items to be stored.
-
- *fuf-options-for-bookmarkfile-mode*
-For Bookmark-File Mode ~
-
- *g:fuf_bookmarkfile_prompt* >
- let g:fuf_bookmarkfile_prompt = '>BookmarkFile[]>'
-<
- Prompt string. "[]" will be substituted with indicators.
-
- *g:fuf_bookmarkfile_switchOrder* >
- let g:fuf_bookmarkfile_switchOrder = 70
-<
- Number of order for switching to the next/previous mode. If negative
- number, Fuzzyfinder never switches to this mode.
-
- *g:fuf_bookmarkfile_searchRange* >
- let g:fuf_bookmarkfile_searchRange = 400
-<
- Number of lines which FuzzyFinder searches a matching line from
- bookmarked position within.
-
- *g:fuf_bookmarkfile_keyDelete* >
- let g:fuf_bookmarkfile_keyDelete = '<C-]>'
-<
- Key mapped to delete selected bookmark.
-
- *fuf-options-for-bookmarkdir-mode*
-For Bookmark-Dir Mode ~
-
- *g:fuf_bookmarkdir_prompt* >
- let g:fuf_bookmarkdir_prompt = '>BookmarkDir[]>'
-<
- Prompt string. "[]" will be substituted with indicators.
-
- *g:fuf_bookmarkdir_switchOrder* >
- let g:fuf_bookmarkdir_switchOrder = 80
-<
- Number of order for switching to the next/previous mode. If negative
- number, Fuzzyfinder never switches to this mode.
-
- *g:fuf_bookmarkdir_keyDelete* >
- let g:fuf_bookmarkdir_keyDelete = '<C-]>'
-<
- Key mapped to delete selected bookmark.
-
- *fuf-options-for-tag-mode*
-For Tag Mode ~
-
- *g:fuf_tag_prompt* >
- let g:fuf_tag_prompt = '>Tag[]>'
-<
- Prompt string. "[]" will be substituted with indicators.
-
- *g:fuf_tag_switchOrder* >
- let g:fuf_tag_switchOrder = 90
-<
- Number of order for switching to the next/previous mode. If negative
- number, Fuzzyfinder never switches to this mode.
-
- *fuf-options-for-buffertag-mode*
-For Buffer-Tag Mode ~
-
- *g:fuf_buffertag_prompt* >
- let g:fuf_buffertag_prompt = '>Buffer-Tag[]>'
-<
- Prompt string. "[]" will be substituted with indicators.
-
- *g:fuf_buffertag_switchOrder* >
- let g:fuf_buffertag_switchOrder = 100
-<
- Number of order for switching to the next/previous mode. If negative
- number, Fuzzyfinder never switches to this mode.
-
- *g:fuf_buffertag_ctagsPath* >
- let g:fuf_buffertag_ctagsPath = 'ctags'
-<
- Executable file path of Ctags.
-
- *fuf-options-for-taggedfile-mode*
-For Tagged-File Mode ~
-
- *g:fuf_taggedfile_prompt* >
- let g:fuf_taggedfile_prompt = '>Tagged-File[]>'
-<
- Prompt string. "[]" will be substituted with indicators.
-
- *g:fuf_taggedfile_switchOrder* >
- let g:fuf_taggedfile_switchOrder = 110
-<
- Number of order for switching to the next/previous mode. If negative
- number, Fuzzyfinder never switches to this mode.
-
- *fuf-options-for-jumplist-mode*
-For Jump-List Mode ~
-
- *g:fuf_jumplist_prompt* >
- let g:fuf_jumplist_prompt = '>Jump-List[]>'
-<
- Prompt string. "[]" will be substituted with indicators.
-
- *g:fuf_jumplist_switchOrder* >
- let g:fuf_jumplist_switchOrder = 120
-<
- Number of order for switching to the next/previous mode. If negative
- number, Fuzzyfinder never switches to this mode.
-
- *fuf-options-for-changelist-mode*
-For Change-List Mode ~
-
- *g:fuf_changelist_prompt* >
- let g:fuf_changelist_prompt = '>Change-List[]>'
-<
- Prompt string. "[]" will be substituted with indicators.
-
- *g:fuf_changelist_switchOrder* >
- let g:fuf_changelist_switchOrder = 130
-<
- Number of order for switching to the next/previous mode. If negative
- number, Fuzzyfinder never switches to this mode.
-
- *fuf-options-for-quickfix-mode*
-For Quickfix Mode ~
-
- *g:fuf_quickfix_prompt* >
- let g:fuf_quickfix_prompt = '>Quickfix[]>'
-<
- Prompt string. "[]" will be substituted with indicators.
-
- *g:fuf_quickfix_switchOrder* >
- let g:fuf_quickfix_switchOrder = 140
-<
- Number of order for switching to the next/previous mode. If negative
- number, Fuzzyfinder never switches to this mode.
-
- *fuf-options-for-line-mode*
-For Line Mode ~
-
- *g:fuf_line_prompt* >
- let g:fuf_line_prompt = '>Line[]>'
-<
- Prompt string. "[]" will be substituted with indicators.
-
- *g:fuf_line_switchOrder* >
- let g:fuf_line_switchOrder = 150
-<
- Number of order for switching to the next/previous mode. If negative
- number, Fuzzyfinder never switches to this mode.
-
- *fuf-options-for-help-mode*
-For Help Mode ~
-
- *g:fuf_help_prompt* >
- let g:fuf_help_prompt = '>Help[]>'
-<
- Prompt string. "[]" will be substituted with indicators.
-
- *g:fuf_help_switchOrder* >
- let g:fuf_help_switchOrder = 160
-<
- Number of order for switching to the next/previous mode. If negative
- number, Fuzzyfinder never switches to this mode.
-
-
-==============================================================================
-VIMRC EXAMPLE *fuf-vimrc-example*
-
->
- let g:fuf_modesDisable = []
- let g:fuf_mrufile_maxItem = 400
- let g:fuf_mrucmd_maxItem = 400
- nnoremap <silent> sj :FufBuffer<CR>
- nnoremap <silent> sk :FufFileWithCurrentBufferDir<CR>
- nnoremap <silent> sK :FufFileWithFullCwd<CR>
- nnoremap <silent> s<C-k> :FufFile<CR>
- nnoremap <silent> sl :FufCoverageFileChange<CR>
- nnoremap <silent> sL :FufCoverageFileChange<CR>
- nnoremap <silent> s<C-l> :FufCoverageFileRegister<CR>
- nnoremap <silent> sd :FufDirWithCurrentBufferDir<CR>
- nnoremap <silent> sD :FufDirWithFullCwd<CR>
- nnoremap <silent> s<C-d> :FufDir<CR>
- nnoremap <silent> sn :FufMruFile<CR>
- nnoremap <silent> sN :FufMruFileInCwd<CR>
- nnoremap <silent> sm :FufMruCmd<CR>
- nnoremap <silent> su :FufBookmarkFile<CR>
- nnoremap <silent> s<C-u> :FufBookmarkFileAdd<CR>
- vnoremap <silent> s<C-u> :FufBookmarkFileAddAsSelectedText<CR>
- nnoremap <silent> si :FufBookmarkDir<CR>
- nnoremap <silent> s<C-i> :FufBookmarkDirAdd<CR>
- nnoremap <silent> st :FufTag<CR>
- nnoremap <silent> sT :FufTag!<CR>
- nnoremap <silent> s<C-]> :FufTagWithCursorWord!<CR>
- nnoremap <silent> s, :FufBufferTag<CR>
- nnoremap <silent> s< :FufBufferTag!<CR>
- vnoremap <silent> s, :FufBufferTagWithSelectedText!<CR>
- vnoremap <silent> s< :FufBufferTagWithSelectedText<CR>
- nnoremap <silent> s} :FufBufferTagWithCursorWord!<CR>
- nnoremap <silent> s. :FufBufferTagAll<CR>
- nnoremap <silent> s> :FufBufferTagAll!<CR>
- vnoremap <silent> s. :FufBufferTagAllWithSelectedText!<CR>
- vnoremap <silent> s> :FufBufferTagAllWithSelectedText<CR>
- nnoremap <silent> s] :FufBufferTagAllWithCursorWord!<CR>
- nnoremap <silent> sg :FufTaggedFile<CR>
- nnoremap <silent> sG :FufTaggedFile!<CR>
- nnoremap <silent> so :FufJumpList<CR>
- nnoremap <silent> sp :FufChangeList<CR>
- nnoremap <silent> sq :FufQuickfix<CR>
- nnoremap <silent> sy :FufLine<CR>
- nnoremap <silent> sh :FufHelp<CR>
- nnoremap <silent> se :FufEditDataFile<CR>
- nnoremap <silent> sr :FufRenewCache<CR>
-<
-
-==============================================================================
-SPECIAL THANKS *fuf-thanks*
-
-- Vincent Wang
-- Ingo Karkat
-- Nikolay Golubev
-- Brian Doyle
-- id:secondlife
-- Nathan Neff
-
-
-==============================================================================
-CHANGELOG *fuf-changelog*
-
-4.2.2:
- - Fixed a bug that unloaded buffers weren't covered by FufBufferTagAll.
-
-4.2.1:
- - Improved response of Buffer-Tag mode.
- - Fixed a bug that buffers which had been opened weren't listed in
- Coverage-File mode
- - Fixed a bug that tag entries including tab characters weren't parsed
- correctly in Coverage-File mode
-
-4.2:
- - L9 library (vimscript #3252) version 1.1 is required.
- - Added Buffer-Tag mode, inspired by taglist.vim (vimscript #273).
- - Added :FufMruFileInCwd command.
-
-4.1.1:
- - Fixed a bug causing a error in MRU-File mode.
-
-4.1:
- - Added Bookmark-Dir mode.
- - Added Bookmark-File mode and removed Bookmark mode.
- - Changed the filename to store data of Coverage-File mode, from
- '~/.vim-fuf-data/coveragefile/items' to
- '~/.vim-fuf-data/coveragefile/coverages' .
- - Fixed a bug that floating point numbers weren't evaluated correctly and
- caused errors on some non-English locales.
- - Removed Around-MRU-File mode and integrated its feature to MRU-File mode.
-
-4.0:
- - From this version, L9 library (vimscript #3252) is required.
- - Added Coverage-File mode for users wanting something like TextMate's
- command-t. (But I've never used it.)
- - Added Around-MRU-File mode. (Too slow. There is room for improvement.)
- - Added new feature which deletes selected buffer with FuzzyFinder and
- g:fuf_buffer_keyDelete option.
- - Added new feature which allows to set one-time options/variables with
- fuf#setOneTimeVariables() function.
- - Added g:fuf_dataDir option and removed g:fuf_infoFile,
- g:g:fuf_tag_cache_dir, g:fuf_taggedfile_cache_dir, and
- g:fuf_help_cache_dir options.
- - Added :FufEditDataFile command and removed :FufEditInfo command.
- - Added g:fuf_fuzzyRefining option.
- - Added new feature which is auto-preview and g:fuf_autoPreview option.
- - Changed the default value of g:fuf_previewHeight to 0 in order to disable
- preview feature. There is an unfixable problem which is caused by a Vim's
- bug.
- - Changed the default value of g:fuf_modesDisable option.
- - Changed the default value of g:fuf_*_switchOrder options.
- - Improved speed of changing buffers.
- - Improved the way to add user-defined mode.
- - Fixed a bug that FuzzyFinder caused reseting window layout.
- - Removed g:fuf_smartBs option. Use <C-w> instead.
-
-3.5:
- - Added Line mode.
- - Added Help mode.
- - Added key mapping to switch between fuzzy matching and partial matching.
- - Changed the default values of g:fuf_file_exclude for ignoring "*.dll".
- - Changed Tag mode and Tagged-File mode to cache parsed data to files in
- "~/.vim-fuf-cache/".
- - Fixed a bug that repeating preview key produced no effect.
- - Fixed a bug that File mode and Directory mode didn't list items in a
- directory whose name includes uppercase characters. (Thanks, ryo7000)
-
-3.4:
- - Added new feature which makes it possible to preview selected completion
- item.
- - Changed matching rules and added g:fuf_splitPathMatching.
- - Changed sorting rules.
- - Changed the default values of g:fuf_file_exclude and g:fuf_dir_exclude in
- order to ignore ".hg", ".git", and ".bzr" directories.
- - Changed the default value of g:fuf_mrufile_exclude in order to ignore
- network files (\\*) on Windows and ignore /mnt/* and /media/* on Unix like
- systems.
- - Fixed a bug that an exclude pattern of File, Dir, and Callback-File mode
- can't be changed.
-
-3.3:
- - Added Jump-List mode, Change-List mode, and Quickfix mode which enable
- jumps with jump list, change list, and quickfix list.
- - Added new feature which deletes selected bookmark with FuzzyFinder and
- g:fuf_bookmark_keyDelete option.
- - Changed default values of g:fuf_keyPrevPattern.
- - Changed to show error message when incompatible with a installed vim.
-
-3.2:
- - Added g:fuf_promptHighlight option to integrate such options for each
- mode.
- - Changed APIs of Given-File, Given-Directory, Given-Command, Callback-File,
- and Callback-Item modes to be able to set a prompt string.
- - Changed default values of g:fuf_keyPrevPattern and g:fuf_keyNextPattern.
- - Fixed a bug that MRU-File data was not updated When a file was opened with
- FuzzyFinder.
- - Fixed a bug with scoring matchings for sorting. Thanks to Vincent.
- - Brought back the removed feature which is switching to an other mode in
- FuzzyFinder.
-
-3.1:
- - Added new feature to recall patterns which have been entered before from
- history.
-
-3.0:
- - Redesigned the whole plugin for improvements of maintainability and
- performance. "fuzzyfinder" is abbreviated to "fuf" in the sorce code and
- filenames. All commands and options are renamed.
- - Added new feature which is refining pattern.
- - Improved the rules for sorting completion items. Thanks to the suggestion
- by Nathan, the rule for boundary matching was implemented.
- - Changed to open one line buffer of FuzzyFinder with :topleft command
- instead of :leftabove. The window will alway appear at the top and occupy
- the full with of the vim window. Thanks to Jan Christoph.
- - Changed default filename of information file.
- - Changed MRU-File mode and MRU-Command mode to be disabled by default
- due to performance and side effect issues.
- - Removed the feature which is switching to an other mode in FuzzyFinder.
- - Removed the feature which is temporarily switching 'ignorecase' in
- FuzzyFinder.
-
-2.22.3:
- - Fixed a bug that Fuzzyfinder could not open files with '$' in the name on
- Windows.
-
-2.22.2:
- - Changed to consider a length of a date/time string when abbreviates long
- completion items.
- - Fixed a bug that '**/' pattern did not search for files directly under the
- current working directory in File mode. Thanks to Martin for reporting.
-
-2.22.1:
- - Fixed a bug that Fuzzyfinder could not expand abbreviations to patterns
- including '\' correctly.
- - Fixed to show item number in Given-File, Given-Directory, and
- Given-Command mode.
-
-2.22.0:
- - More improved the abbreviation method for long completion items.
- - Added Given-File mode for third-party script to select a file from a given
- list and open.
- - Added Given-Directory mode for third-party script to select a directory
- from a given list and change current working directory to it.
- - Added Given-Command mode for third-party script to select a command from a
- given list and execute.
- - Changed ways to launch Callback-File mode and Callback-item mode.
-
-2.21.0:
- - Improved a method of trimming long completion items. Thanks to Andy,
- pyrhockz, and Nathan.
- - Changed not to map command-line <CR> for MRU-Command mode if
- g:FuzzyFinderOptions.MruCmd.mode_available is set 0 before loading
- fuzzyfinder.vim.
- - Added Callback-File mode and Callback-Item mode for third-party script to
- find a file/directory or an item from a given list using Fuzzyfinder.
- - Changed not to append ".." to a completion menu in File/Directory mode.
- Use dot sequence feature.
- - Changed default value of g:FuzzyFinderOptions.File.excluded_path option.
- - Changed default value of g:FuzzyFinderOptions.Dir.excluded_path option.
- - Fixed a bug that couldn't jump to a tag. Thanks to Thinca.
-
-2.20:
- - Added help files which are doc/fuzzyfinder.txt and doc/fuzzyfinder.jax.
- - Fixed a bug that an error occurs if current directory included spaces.
- Thanks id:cho45 and id:secondlife.
- - Implemented a feature to reuse a window containing target buffer.
- - Added g:FuzzyFinderOptions.Buffer.reuse_window option.
- - Added g:FuzzyFinderOptions.File.reuse_window option.
- - Added g:FuzzyFinderOptions.MruFile.reuse_window option.
- - Added g:FuzzyFinderOptions.Bookmark.reuse_window option.
- - Added g:FuzzyFinderOptions.TaggedFile.reuse_window option.
- - Changed to use 'omnifunc' instead of 'completefunc'. Now you can use <C-u>
- to delete all entered characters.
- - Changed default value of g:FuzzyFinderOptions.Base.key_open_tab option.
- - Changed default value of g:FuzzyFinderOptions.Base.key_next_mode option.
- - Changed default value of g:FuzzyFinderOptions.Base.key_prev_mode option.
- - Changed default value of g:FuzzyFinderOptions.Base.key_ignore_case option.
- - Changed to truncate long completion items from the head instead of tail.
- - Added g:FuzzyFinderOptions.Base.max_menu_width option instead of
- g:FuzzyFinderOptions.Base.trim_length option.
- - Added :FuzzyFinderFileWithFullCwd command.
- - Added :FuzzyFinderFileWithCurrentBufferDir command.
- - Added :FuzzyFinderDirWithFullCwd command.
- - Added :FuzzyFinderDirWithCurrentBufferDir command.
- - Added :FuzzyFinderTagWithCursorWord command.
- - Renamed :FuzzyFinderRemoveCache command to :FuzzyFinderRenewCache.
-
-2.19:
- - Changed MRU-File mode that always formats completion items to be relative
- to the home directory.
- - Fixed a bug that a file was opened in an unintended window with Tag List
- plugin. Thanks Alexey.
- - Fixed a bug that garbage characters were entered when switched current
- mode. Thanks id:lugecy.
-
-2.18:
- - Improved rules for the sorting of completion items.
- - Changed not to learn a completion if an entered pattern is empty.
- - Fixed a bug that Buffer mode did not work. Thanks ryo7000.
-
-2.17:
- - Introduced a learning system for the sorting of completion items.
- - Added g:FuzzyFinderOptions.Base.learning_limit option.
- - Changed the specification of the information file. Please remove your
- information file for Fuzzyfinder.
-
-2.16:
- - Improved response time by caching in MRU-File mode.
- - Fixed a bug in Bookmark mode that Fuzzyfinder did not jump to the
- Bookmarked line number when Bookmarked pattern was not found.
-
-2.15:
- - Added Bookmark mode.
- - Removed Favorite-file mode. Use Bookmark mode instead.
- - Fixed not to record a entry of input() in MRU-Command mode.
-
-2.14:
- - Changed to show buffer status in Buffer mode.
- - Fixed a bug that an error occurs when nonexistent buffer-name was entered
- in Buffer mode. Thanks Maxim Kim.
- - Added 'enumerating_limit' option. Thanks id:secondlife.
- - Removed 'matching_limit' option. Use 'enumerating_limit' instead.
-
-2.13:
- - Fixed a bug that a directory disappeared when a file in that directory was
- being opened in File/Mru-File mode.
-
-2.12:
- - Changed to be able to show completion items in the order of recently used
- in Buffer mode.
- - Added g:FuzzyFinderOptions.Buffer.mru_order option.
-
-2.11:
- - Changed that a dot sequence of entered pattern is expanded to parent
- directories in File/Dir mode.
- E.g.: "foo/...bar" -> "foo/../../bar"
- - Fixed a bug that a prompt string was excessively inserted.
-
-2.10:
- - Changed not to show a current buffer in a completion menu.
- - Fixed a bug that a filename to open was not been escaped.
- - Added 'prompt' option.
- - Added 'prompt_highlight' option.
- - Removed g:FuzzyFinderOptions.MruFile.no_special_buffer option.
-
-2.9:
- - Enhanced <BS> behavior in Fuzzyfinder and added 'smart_bs' option.
- - Fixed a bug that entered pattern was not been escaped.
- - Fixed not to insert "zv" with "c/pattern<CR>" command in Normal mode.
- - Avoid the slow down problem caused by filereadable() check for the MRU
- information in BufEnter/BufWritePost.
-
-2.8.1:
- - Fixed a bug caused by the non-escaped buffer name "[Fuzzyfinder]".
- - Fixed a command to open in a new tab page in Buffer mode.
-2.8:
- - Added 'trim_length' option.
- - Added 'switch_order' option.
- - Fixed a bug that entered command did not become the newest in the history.
- - Fixed a bug that folds could not open with <CR> in a command-line when
- searching.
- - Removed 'excluded_indicator' option. Now a completion list in Buffer mode
- is the same as a result of :buffers.
-
-2.7:
- - Changed to find an item whose index is matched with the number suffixed
- with entered pattern.
- - Fixed the cache bug after changing current directory in File mode.
-
-2.6.2:
- - Fixed not to miss changes in options when updates the MRU information.
-
-2.6.1:
- - Fixed a bug related to floating-point support.
- - Added support for GetLatestVimScripts.
-
-2.6:
- - Revived MRU-command mode. The problem with a command-line abbreviation was
- solved.
- - Changed the specification of the information file.
- - Added :FuzzyFinderEditInfo command.
-
-2.5.1:
- - Fixed to be able to match "foo/./bar" by "foo/**/bar" in File mode.
- - Fixed to be able to open a space-containing file in File mode.
- - Fixed to honor the current working directory properly in File mode.
-
-2.5:
- - Fixed the bug that a wrong initial text is entered after switching to a
- next mode.
- - Fixed the bug that it does not return to previous window after leaving
- Fuzzyfinder one.
-
-2.4:
- - Fixed the bug that Fuzzyfinder fails to open a file caused by auto-cd
- plugin/script.
-
-2.3:
- - Added a key mapping to open items in a new tab page and
- g:FuzzyFinderOptions.Base.key_open_tab option.
- - Changed to show Fuzzyfinder window above last window even if 'splitbelow'
- was set.
- - Changed to set nocursorline and nocursorcolumn in Fuzzyfinder.
- - Fixed not to push up a buffer number unlimitedly.
-
-2.2:
- - Added new feature, which is the partial matching.
- - Fixed the bug that an error occurs when "'" was entered.
-
-2.1:
- - Restructured the option system AGAIN. Sorry :p
- - Changed to inherit a typed text when switching a mode without leaving
- Insert mode.
- - Changed commands which launch explorers to be able to take a argument for
- initial text.
- - Changed to complete file names by relative path and not full path in the
- buffer/mru-file/tagged-file mode.
- - Changed to highlight a typed text when the completion item was not found
- or the completion process was aborted.
- - Changed to create caches for each tag file and not working directory in
- the tag/tagged-file mode.
- - Fixed the bug that the buffer mode couldn't open a unnamed buffer.
- - Added 'matching_limit' option.
- - Removed 'max_match' option. Use 'matching_limit' option instead.
- - Removed 'initial_text' option. Use command argument instead.
- - Removed the MRU-command mode.
-
-2.0:
- - Added the tag mode.
- - Added the tagged-file mode.
- - Added :FuzzyFinderRemoveCache command.
- - Restructured the option system. many options are changed names or default
- values of some options.
- - Changed to hold and reuse caches of completion lists by default.
- - Changed to set filetype 'fuzzyfinder'.
- - Disabled the MRU-command mode by default because there are problems.
- - Removed FuzzyFinderAddMode command.
-
-1.5:
- - Added the directory mode.
- - Fixed the bug that it caused an error when switch a mode in Insert mode.
- - Changed g:FuzzyFinder_KeySwitchMode type to a list.
-
-1.4:
- - Changed the specification of the information file.
- - Added the MRU-commands mode.
- - Renamed :FuzzyFinderAddFavorite command to :FuzzyFinderAddFavFile.
- - Renamed g:FuzzyFinder_MruModeVars option to g:FuzzyFinder_MruFileModeVars.
- - Renamed g:FuzzyFinder_FavoriteModeVars option to
- g:FuzzyFinder_FavFileModeVars.
- - Changed to show registered time of each item in MRU/favorite mode.
- - Added 'timeFormat' option for MRU/favorite modes.
-
-1.3:
- - Fixed a handling of multi-byte characters.
-
-1.2:
- - Added support for Migemo. (Migemo is Japanese search method.)
-
-1.1:
- - Added the favorite mode.
- - Added new features, which are abbreviations and multiple search.
- - Added 'abbrevMap' option for each mode.
- - Added g:FuzzyFinder_MruModeVars['ignoreSpecialBuffers'] option.
- - Fixed the bug that it did not work correctly when a user have mapped <C-p>
- or <Down>.
-
-1.0:
- - Added the MRU mode.
- - Added commands to add and use original mode.
- - Improved the sorting algorithm for completion items.
- - Added 'initialInput' option to automatically insert a text at the
- beginning of a mode.
- - Changed that 'excludedPath' option works for the entire path.
- - Renamed some options.
- - Changed default values of some options.
- - Packed the mode-specific options to dictionaries.
- - Removed some options.
-
-0.6:
- - Fixed some bugs.
-
-0.5:
- - Improved response by aborting processing too many items.
- - Changed to be able to open a buffer/file not only in previous window but
- also in new window.
- - Fixed a bug that recursive searching with '**' does not work.
- - Added g:FuzzyFinder_CompletionItemLimit option.
- - Added g:FuzzyFinder_KeyOpen option.
-
-0.4:
- - Improved response of the input.
- - Improved the sorting algorithm for completion items. It is based on the
- matching level. 1st is perfect matching, 2nd is prefix matching, and 3rd
- is fuzzy matching.
- - Added g:FuzzyFinder_ExcludePattern option.
- - Removed g:FuzzyFinder_WildIgnore option.
- - Removed g:FuzzyFinder_EchoPattern option.
- - Removed g:FuzzyFinder_PathSeparator option.
- - Changed the default value of g:FuzzyFinder_MinLengthFile from 1 to 0.
-
-0.3:
- - Added g:FuzzyFinder_IgnoreCase option.
- - Added g:FuzzyFinder_KeyToggleIgnoreCase option.
- - Added g:FuzzyFinder_EchoPattern option.
- - Changed the open command in a buffer mode from ":edit" to ":buffer" to
- avoid being reset cursor position.
- - Changed the default value of g:FuzzyFinder_KeyToggleMode from <C-Space> to
- <F12> because <C-Space> does not work on some CUI environments.
- - Changed to avoid being loaded by Vim before 7.0.
- - Fixed a bug with making a fuzzy pattern which has '\'.
-
-0.2:
- - A bug it does not work on Linux is fixed.
-
-0.1:
- - First release.
-
-
-==============================================================================
-ABOUT *fuf-about* *fuf-contact* *fuf-author*
-
-Author: Takeshi NISHIDA <ns9tks@DELETE-ME.gmail.com>
-Licence: MIT Licence
-URL: http://www.vim.org/scripts/script.php?script_id=1984
- http://bitbucket.org/ns9tks/vim-fuzzyfinder/
-
-Bugs/Issues/Suggestions/Improvements ~
-
-Please submit to http://bitbucket.org/ns9tks/vim-fuzzyfinder/issues/ .
-
-==============================================================================
- vim:tw=78:ts=8:ft=help:norl:
diff --git a/vim/doc/l9.jax b/vim/doc/l9.jax
deleted file mode 100644
index c84d45f..0000000
--- a/vim/doc/l9.jax
+++ /dev/null
@@ -1,55 +0,0 @@
-*l9.txt* Vimスクリプトライブラリ
-
- Copyright (c) 2009-2010 Takeshi NISHIDA
-
-l9 *l9*
-
-æ¦‚è¦ |l9-introduction|
-インストール |l9-installation|
-使ã„æ–¹ |l9-usage|
-CHANGELOG |l9-changelog|
-ã‚ã°ã†ã¨ |l9-about|
-
-==============================================================================
-æ¦‚è¦ *l9-introduction*
-
-l9ã¯Vimスクリプトã®é–¢æ•°ã‚„コマンドをæä¾›ã™ã‚‹ãƒ©ã‚¤ãƒ–ラリã§ã™ã€‚
-
-
-==============================================================================
- インストール *l9-installation*
-
-ZIPファイルをランタイムディレクトリã«å±•é–‹ã—ã¾ã™ã€‚
-
-以下ã®ã‚ˆã†ã«ãƒ•ã‚¡ã‚¤ãƒ«ãŒé…ç½®ã•ã‚Œã‚‹ã¯ãšã§ã™ã€‚
->
- <your runtime directory>/plugin/l9.vim
- <your runtime directory>/doc/l9.txt
- ...
-<
-ã‚‚ã—ランタイムディレクトリãŒå¤šæ•°ã®ãƒ—ラグインã§ã”ã¡ã‚ƒã”ã¡ã‚ƒã«ãªã‚‹ã®ãŒå«Œãªã‚‰ã€å„
-プラグインを個別ã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã«é…ç½®ã—ã€ãã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã®ãƒ‘スを 'runtimepath'
-ã«è¿½åŠ ã—ã¦ãã ã•ã„。アンインストールも楽ã«ãªã‚Šã¾ã™ã€‚
-
-ãã®å¾Œã€ãƒ˜ãƒ«ãƒ—を有効ã«ã™ã‚‹ãŸã‚ã«ã‚¿ã‚°ãƒ•ã‚¡ã‚¤ãƒ«ã‚’æ›´æ–°ã—ã¦ãã ã•ã„。詳ã—ãã¯
-|add-local-help|ã‚’å‚ç…§ã—ã¦ãã ã•ã„。
-
-==============================================================================
-使ã„æ–¹ *l9-usage*
-
-ソースコードをå‚ç…§ã—ã¦ãã ã•ã„。
-
-==============================================================================
-ã‚ã°ã†ã¨ *l9-about* *l9-contact* *l9-author*
-
-作者: Takeshi NISHIDA <ns9tks@DELETE-ME.gmail.com>
-ライセンス: MIT Licence
-URL: http://www.vim.org/scripts/script.php?script_id=3252
- http://bitbucket.org/ns9tks/vim-l9/
-
-ãƒã‚°ã‚„è¦æœ›ãªã© ~
-
-ã“ã¡ã‚‰ã¸ã©ã†ãž: http://bitbucket.org/ns9tks/vim-l9/issues/
-
-==============================================================================
- vim:tw=78:ts=8:ft=help:norl:
diff --git a/vim/doc/l9.txt b/vim/doc/l9.txt
deleted file mode 100644
index 8664ad4..0000000
--- a/vim/doc/l9.txt
+++ /dev/null
@@ -1,73 +0,0 @@
-*l9.txt* Vim-script library
-
- Copyright (c) 2009-2010 Takeshi NISHIDA
-
-l9 *l9*
-
-INTRODUCTION |l9-introduction|
-INSTALLATION |l9-installation|
-USAGE |l9-usage|
-CHANGELOG |l9-changelog|
-ABOUT |l9-about|
-
-==============================================================================
-INTRODUCTION *l9-introduction*
-
-l9 is a Vim-script library, which provides some utility functions and commands
-for programming in Vim.
-
-==============================================================================
- INSTALLATION *l9-installation*
-
-Put all files into your runtime directory. If you have the zip file, extract
-it to your runtime directory.
-
-You should place the files as follows:
->
- <your runtime directory>/plugin/l9.vim
- <your runtime directory>/doc/l9.txt
- ...
-<
-If you are disgusted to make your runtime directory confused with a lot of
-plugins, put each of the plugins into a directory individually and just add
-the directory path to 'runtimepath'. It's easy to uninstall the plugin.
-
-Then update your help tags files to enable fuzzyfinder help. See
-|add-local-help| for details.
-
-==============================================================================
-USAGE *l9-usage*
-
-See source code.
-
-==============================================================================
-CHANGELOG *l9-changelog*
-
-1.1:
- - Added l9#zip()
- - Added l9#tempvariables#getList()
- - Changed l9#guardScriptLoading()
- - Removed l9#tempvariables#swap()
-
-1.0.1:
- - Fixed a bug that floating point numbers weren't evaluated correctly and
- caused errors on some non-English locales.
-
-1.0:
- - First release.
-
-
-==============================================================================
-ABOUT *l9-about* *l9-contact* *l9-author*
-
-Author: Takeshi NISHIDA <ns9tks@DELETE-ME.gmail.com>
-Licence: MIT Licence
-URL: http://www.vim.org/scripts/script.php?script_id=3252
- http://bitbucket.org/ns9tks/vim-l9/
-
-Bugs/Issues/Suggestions/Improvements ~
-
-Please submit to http://bitbucket.org/ns9tks/vim-l9/issues/ .
-
-==============================================================================
- vim:tw=78:ts=8:ft=help:norl:
diff --git a/vim/doc/matchit.txt b/vim/doc/matchit.txt
deleted file mode 100644
index 8a3a96e..0000000
--- a/vim/doc/matchit.txt
+++ /dev/null
@@ -1,406 +0,0 @@
-*matchit.txt* Extended "%" matching
-
-For instructions on installing this file, type
- :help matchit-install
-inside Vim.
-
-For Vim version 6.3. Last change: 2007 Aug 29
-
-
- VIM REFERENCE MANUAL by Benji Fisher
-
-*matchit* *matchit.vim*
-
-1. Extended matching with "%" |matchit-intro|
-2. Activation |matchit-activate|
-3. Configuration |matchit-configure|
-4. Supporting a New Language |matchit-newlang|
-5. Known Bugs and Limitations |matchit-bugs|
-
-The functionality mentioned here is a plugin, see |add-plugin|.
-This plugin is only available if 'compatible' is not set.
-You can avoid loading this plugin by setting the "loaded_matchit" variable
-in your |vimrc| file: >
- :let loaded_matchit = 1
-
-{Vi does not have any of this}
-
-==============================================================================
-1. Extended matching with "%" *matchit-intro*
-
- *matchit-%*
-% Cycle forward through matching groups, such as "if", "else", "endif",
- as specified by |b:match_words|.
-
- *g%* *v_g%* *o_g%*
-g% Cycle backwards through matching groups, as specified by
- |b:match_words|. For example, go from "if" to "endif" to "else".
-
- *[%* *v_[%* *o_[%*
-[% Go to [count] previous unmatched group, as specified by
- |b:match_words|. Similar to |[{|.
-
- *]%* *v_]%* *o_]%*
-]% Go to [count] next unmatched group, as specified by
- |b:match_words|. Similar to |]}|.
-
- *v_a%*
-a% In Visual mode, select the matching group, as specified by
- |b:match_words|, containing the cursor. Similar to |v_a[|.
- A [count] is ignored, and only the first character of the closing
- pattern is selected.
-
-In Vim, as in plain vi, the percent key, |%|, jumps the cursor from a brace,
-bracket, or paren to its match. This can be configured with the 'matchpairs'
-option. The matchit plugin extends this in several ways:
-
- You can match whole words, such as "if" and "endif", not just
- single characters. You can also specify a |regular-expression|.
- You can define groups with more than two words, such as "if",
- "else", "endif". Banging on the "%" key will cycle from the "if" to
- the first "else", the next "else", ..., the closing "endif", and back
- to the opening "if". Nested structures are skipped. Using |g%| goes
- in the reverse direction.
- By default, words inside comments and strings are ignored, unless
- the cursor is inside a comment or string when you type "%". If the
- only thing you want to do is modify the behavior of "%" so that it
- behaves this way, you do not have to define |b:match_words|, since the
- script uses the 'matchpairs' option as well as this variable.
-
-See |matchit-details| for details on what the script does, and |b:match_words|
-for how to specify matching patterns.
-
-MODES: *matchit-modes* *matchit-v_%* *matchit-o_%*
-
-Mostly, % and related motions (|g%| and |[%| and |]%|) work just like built-in
-|motion| commands in |Operator-pending| and |Visual| modes. However, you
-cannot make these motions |linewise| or |characterwise|, since the |:omap|s
-that define them start with "v" in order to make the default behavior
-inclusive. (See |o_v|.) In other words, "dV%" will not work. The
-work-around is to go through Visual mode: "V%d" will work.
-
-LANGUAGES: *matchit-languages*
-
-Currently, the following languages are supported: Ada, ASP with VBS, Csh,
-DTD, Entity, Essbase, Fortran, HTML, JSP (same as HTML), LaTeX, Lua, Pascal,
-SGML, Shell, Tcsh, Vim, XML. Other languages may already have support via
-the default |filetype-plugin|s in the standard vim distribution.
-
-To support a new language, see |matchit-newlang| below.
-
-DETAILS: *matchit-details* *matchit-parse*
-
-Here is an outline of what matchit.vim does each time you hit the "%" key. If
-there are |backref|s in |b:match_words| then the first step is to produce a
-version in which these back references have been eliminated; if there are no
-|backref|s then this step is skipped. This step is called parsing. For
-example, "\(foo\|bar\):end\1" is parsed to yield
-"\(foo\|bar\):end\(foo\|bar\)". This can get tricky, especially if there are
-nested groups. If debugging is turned on, the parsed version is saved as
-|b:match_pat|.
-
- *matchit-choose*
-Next, the script looks for a word on the current line that matches the pattern
-just constructed. It includes the patterns from the 'matchpairs' option.
-The goal is to do what you expect, which turns out to be a little complicated.
-The script follows these rules:
-
- Insist on a match that ends on or after the cursor.
- Prefer a match that includes the cursor position (that is, one that
- starts on or before the cursor).
- Prefer a match that starts as close to the cursor as possible.
- If more than one pattern in |b:match_words| matches, choose the one
- that is listed first.
-
-Examples:
-
- Suppose you >
- :let b:match_words = '<:>,<tag>:</tag>'
-< and hit "%" with the cursor on or before the "<" in "a <tag> is born".
- The pattern '<' comes first, so it is preferred over '<tag>', which
- also matches. If the cursor is on the "t", however, then '<tag>' is
- preferred, because this matches a bit of text containing the cursor.
- If the two groups of patterns were reversed then '<' would never be
- preferred.
-
- Suppose you >
- :let b:match_words = 'if:end if'
-< (Note the space!) and hit "%" with the cursor at the end of "end if".
- Then "if" matches, which is probably not what you want, but if the
- cursor starts on the "end " then "end if" is chosen. (You can avoid
- this problem by using a more complicated pattern.)
-
-If there is no match, the cursor does not move. (Before version 1.13 of the
-script, it would fall back on the usual behavior of |%|). If debugging is
-turned on, the matched bit of text is saved as |b:match_match| and the cursor
-column of the start of the match is saved as |b:match_col|.
-
-Next, the script looks through |b:match_words| (original and parsed versions)
-for the group and pattern that match. If debugging is turned on, the group is
-saved as |b:match_ini| (the first pattern) and |b:match_tail| (the rest). If
-there are |backref|s then, in addition, the matching pattern is saved as
-|b:match_word| and a table of translations is saved as |b:match_table|. If
-there are |backref|s, these are determined from the matching pattern and
-|b:match_match| and substituted into each pattern in the matching group.
-
-The script decides whether to search forwards or backwards and chooses
-arguments for the |searchpair()| function. Then, the cursor is moved to the
-start of the match, and |searchpair()| is called. By default, matching
-structures inside strings and comments are ignored. This can be changed by
-setting |b:match_skip|.
-
-==============================================================================
-2. Activation *matchit-activate*
-
-You can use this script as a plugin, by copying it to your plugin directory.
-See |add-global-plugin| for instructions. You can also add a line to your
-|vimrc| file, such as >
- :source $VIMRUNTIME/macros/matchit.vim
-or >
- :runtime macros/matchit.vim
-Either way, the script should start working the next time you start up Vim.
-
-(Earlier versions of the script did nothing unless a |buffer-variable| named
-|b:match_words| was defined. Even earlier versions contained autocommands
-that set this variable for various file types. Now, |b:match_words| is
-defined in many of the default |filetype-plugin|s instead.)
-
-For a new language, you can add autocommands to the script or to your vimrc
-file, but the recommended method is to add a line such as >
- let b:match_words = '\<foo\>:\<bar\>'
-to the |filetype-plugin| for your language. See |b:match_words| below for how
-this variable is interpreted.
-
-TROUBLESHOOTING *matchit-troubleshoot*
-
-The script should work in most installations of Vim. It may not work if Vim
-was compiled with a minimal feature set, for example if the |+syntax| option
-was not enabled. If your Vim has support for syntax compiled in, but you do
-not have |syntax| highlighting turned on, matchit.vim should work, but it may
-fail to skip matching groups in comments and strings. If the |filetype|
-mechanism is turned off, the |b:match_words| variable will probably not be
-defined automatically.
-
-==============================================================================
-3. Configuration *matchit-configure*
-
-There are several variables that govern the behavior of matchit.vim. Note
-that these are variables local to the buffer, not options, so use |:let| to
-define them, not |:set|. Some of these variables have values that matter; for
-others, it only matters whether the variable has been defined. All of these
-can be defined in the |filetype-plugin| or autocommand that defines
-|b:match_words| or "on the fly."
-
-The main variable is |b:match_words|. It is described in the section below on
-supporting a new language.
-
- *MatchError* *matchit-hl* *matchit-highlight*
-MatchError is the highlight group for error messages from the script. By
-default, it is linked to WarningMsg. If you do not want to be bothered by
-error messages, you can define this to be something invisible. For example,
-if you use the GUI version of Vim and your command line is normally white, you
-can do >
- :hi MatchError guifg=white guibg=white
-<
- *b:match_ignorecase*
-If you >
- :let b:match_ignorecase = 1
-then matchit.vim acts as if 'ignorecase' is set: for example, "end" and "END"
-are equivalent. If you >
- :let b:match_ignorecase = 0
-then matchit.vim treats "end" and "END" differently. (There will be no
-b:match_infercase option unless someone requests it.)
-
- *b:match_debug*
-Define b:match_debug if you want debugging information to be saved. See
-|matchit-debug|, below.
-
- *b:match_skip*
-If b:match_skip is defined, it is passed as the skip argument to
-|searchpair()|. This controls when matching structures are skipped, or
-ignored. By default, they are ignored inside comments and strings, as
-determined by the |syntax| mechanism. (If syntax highlighting is turned off,
-nothing is skipped.) You can set b:match_skip to a string, which evaluates to
-a non-zero, numerical value if the match is to be skipped or zero if the match
-should not be skipped. In addition, the following special values are
-supported by matchit.vim:
- s:foo becomes (current syntax item) =~ foo
- S:foo becomes (current syntax item) !~ foo
- r:foo becomes (line before cursor) =~ foo
- R:foo becomes (line before cursor) !~ foo
-(The "s" is meant to suggest "syntax", and the "r" is meant to suggest
-"regular expression".)
-
-Examples:
-
- You can get the default behavior with >
- :let b:match_skip = 's:comment\|string'
-<
- If you want to skip matching structures unless they are at the start
- of the line (ignoring whitespace) then you can >
- :let b:match_skip = 'R:^\s*'
-< Do not do this if strings or comments can span several lines, since
- the normal syntax checking will not be done if you set b:match_skip.
-
- In LaTeX, since "%" is used as the comment character, you can >
- :let b:match_skip = 'r:%'
-< Unfortunately, this will skip anything after "\%", an escaped "%". To
- allow for this, and also "\\%" (an excaped backslash followed by the
- comment character) you can >
- :let b:match_skip = 'r:\(^\|[^\\]\)\(\\\\\)*%'
-<
- See the $VIMRUNTIME/ftplugin/vim.vim for an example that uses both
- syntax and a regular expression.
-
-==============================================================================
-4. Supporting a New Language *matchit-newlang*
- *b:match_words*
-In order for matchit.vim to support a new language, you must define a suitable
-pattern for |b:match_words|. You may also want to set some of the
-|matchit-configure| variables, as described above. If your language has a
-complicated syntax, or many keywords, you will need to know something about
-Vim's |regular-expression|s.
-
-The format for |b:match_words| is similar to that of the 'matchpairs' option:
-it is a comma (,)-separated list of groups; each group is a colon(:)-separated
-list of patterns (regular expressions). Commas and backslashes that are part
-of a pattern should be escaped with backslashes ('\:' and '\,'). It is OK to
-have only one group; the effect is undefined if a group has only one pattern.
-A simple example is >
- :let b:match_words = '\<if\>:\<endif\>,'
- \ . '\<while\>:\<continue\>:\<break\>:\<endwhile\>'
-(In Vim regular expressions, |\<| and |\>| denote word boundaries. Thus "if"
-matches the end of "endif" but "\<if\>" does not.) Then banging on the "%"
-key will bounce the cursor between "if" and the matching "endif"; and from
-"while" to any matching "continue" or "break", then to the matching "endwhile"
-and back to the "while". It is almost always easier to use |literal-string|s
-(single quotes) as above: '\<if\>' rather than "\\<if\\>" and so on.
-
-Exception: If the ":" character does not appear in b:match_words, then it is
-treated as an expression to be evaluated. For example, >
- :let b:match_words = 'GetMatchWords()'
-allows you to define a function. This can return a different string depending
-on the current syntax, for example.
-
-Once you have defined the appropriate value of |b:match_words|, you will
-probably want to have this set automatically each time you edit the
-appropriate file type. The recommended way to do this is by adding the
-definition to a |filetype-plugin| file.
-
-Tips: Be careful that your initial pattern does not match your final pattern.
-See the example above for the use of word-boundary expressions. It is usually
-better to use ".\{-}" (as many as necessary) instead of ".*" (as many as
-possible). See |\{-|. For example, in the string "<tag>label</tag>", "<.*>"
-matches the whole string whereas "<.\{-}>" and "<[^>]*>" match "<tag>" and
-"</tag>".
-
- *matchit-spaces* *matchit-s:notend*
-If "if" is to be paired with "end if" (Note the space!) then word boundaries
-are not enough. Instead, define a regular expression s:notend that will match
-anything but "end" and use it as follows: >
- :let s:notend = '\%(\<end\s\+\)\@<!'
- :let b:match_words = s:notend . '\<if\>:\<end\s\+if\>'
-< *matchit-s:sol*
-This is a simplified version of what is done for Ada. The s:notend is a
-|script-variable|. Similarly, you may want to define a start-of-line regular
-expression >
- :let s:sol = '\%(^\|;\)\s*'
-if keywords are only recognized after the start of a line or after a
-semicolon (;), with optional white space.
-
- *matchit-backref* *matchit-\1*
-In any group, the expressions |\1|, |\2|, ..., |\9| refer to parts of the
-INITIAL pattern enclosed in |\(|escaped parentheses|\)|. These are referred
-to as back references, or backrefs. For example, >
- :let b:match_words = '\<b\(o\+\)\>:\(h\)\1\>'
-means that "bo" pairs with "ho" and "boo" pairs with "hoo" and so on. Note
-that "\1" does not refer to the "\(h\)" in this example. If you have
-"\(nested \(parentheses\)\) then "\d" refers to the d-th "\(" and everything
-up to and including the matching "\)": in "\(nested\(parentheses\)\)", "\1"
-refers to everything and "\2" refers to "\(parentheses\)". If you use a
-variable such as |s:notend| or |s:sol| in the previous paragraph then remember
-to count any "\(" patterns in this variable. You do not have to count groups
-defined by |\%(\)|.
-
-It should be possible to resolve back references from any pattern in the
-group. For example, >
- :let b:match_words = '\(foo\)\(bar\):more\1:and\2:end\1\2'
-would not work because "\2" cannot be determined from "morefoo" and "\1"
-cannot be determined from "andbar". On the other hand, >
- :let b:match_words = '\(\(foo\)\(bar\)\):\3\2:end\1'
-should work (and have the same effect as "foobar:barfoo:endfoobar"), although
-this has not been thoroughly tested.
-
-You can use |zero-width| patterns such as |\@<=| and |\zs|. (The latter has
-not been thouroughly tested in matchit.vim.) For example, if the keyword "if"
-must occur at the start of the line, with optional white space, you might use
-the pattern "\(^\s*\)\@<=if" so that the cursor will end on the "i" instead of
-at the start of the line. For another example, if HTML had only one tag then
-one could >
- :let b:match_words = '<:>,<\@<=tag>:<\@<=/tag>'
-so that "%" can bounce between matching "<" and ">" pairs or (starting on
-"tag" or "/tag") between matching tags. Without the |\@<=|, the script would
-bounce from "tag" to the "<" in "</tag>", and another "%" would not take you
-back to where you started.
-
-DEBUGGING *matchit-debug* *:MatchDebug*
-
-If you are having trouble figuring out the appropriate definition of
-|b:match_words| then you can take advantage of the same information I use when
-debugging the script. This is especially true if you are not sure whether
-your patterns or my script are at fault! To make this more convenient, I have
-made the command :MatchDebug, which defines the variable |b:match_debug| and
-creates a Matchit menu. This menu makes it convenient to check the values of
-the variables described below. You will probably also want to read
-|matchit-details| above.
-
-Defining the variable |b:match_debug| causes the script to set the following
-variables, each time you hit the "%" key. Several of these are only defined
-if |b:match_words| includes |backref|s.
-
- *b:match_pat*
-The b:match_pat variable is set to |b:match_words| with |backref|s parsed.
- *b:match_match*
-The b:match_match variable is set to the bit of text that is recognized as a
-match.
- *b:match_col*
-The b:match_col variable is set to the cursor column of the start of the
-matching text.
- *b:match_wholeBR*
-The b:match_wholeBR variable is set to the comma-separated group of patterns
-that matches, with |backref|s unparsed.
- *b:match_iniBR*
-The b:match_iniBR variable is set to the first pattern in |b:match_wholeBR|.
- *b:match_ini*
-The b:match_ini variable is set to the first pattern in |b:match_wholeBR|,
-with |backref|s resolved from |b:match_match|.
- *b:match_tail*
-The b:match_tail variable is set to the remaining patterns in
-|b:match_wholeBR|, with |backref|s resolved from |b:match_match|.
- *b:match_word*
-The b:match_word variable is set to the pattern from |b:match_wholeBR| that
-matches |b:match_match|.
- *b:match_table*
-The back reference '\'.d refers to the same thing as '\'.b:match_table[d] in
-|b:match_word|.
-
-==============================================================================
-5. Known Bugs and Limitations *matchit-bugs*
-
-Just because I know about a bug does not mean that it is on my todo list. I
-try to respond to reports of bugs that cause real problems. If it does not
-cause serious problems, or if there is a work-around, a bug may sit there for
-a while. Moral: if a bug (known or not) bothers you, let me know.
-
-The various |:vmap|s defined in the script (%, |g%|, |[%|, |]%|, |a%|) may
-have undesired effects in Select mode |Select-mode-mapping|. At least, if you
-want to replace the selection with any character in "ag%[]" there will be a
-pause of |'updatetime'| first.
-
-It would be nice if "\0" were recognized as the entire pattern. That is, it
-would be nice if "foo:\end\0" had the same effect as "\(foo\):\end\1". I may
-try to implement this in a future version. (This is not so easy to arrange as
-you might think!)
-
-==============================================================================
-vim:tw=78:fo=tcq2:
diff --git a/vim/doc/snipMate.txt b/vim/doc/snipMate.txt
deleted file mode 100644
index 704d44a..0000000
--- a/vim/doc/snipMate.txt
+++ /dev/null
@@ -1,286 +0,0 @@
-*snipMate.txt* Plugin for using TextMate-style snippets in Vim.
-
-snipMate *snippet* *snippets* *snipMate*
-Last Change: July 13, 2009
-
-|snipMate-description| Description
-|snipMate-syntax| Snippet syntax
-|snipMate-usage| Usage
-|snipMate-settings| Settings
-|snipMate-features| Features
-|snipMate-disadvantages| Disadvantages to TextMate
-|snipMate-contact| Contact
-
-For Vim version 7.0 or later.
-This plugin only works if 'compatible' is not set.
-{Vi does not have any of these features.}
-
-==============================================================================
-DESCRIPTION *snipMate-description*
-
-snipMate.vim implements some of TextMate's snippets features in Vim. A
-snippet is a piece of often-typed text that you can insert into your
-document using a trigger word followed by a <tab>.
-
-For instance, in a C file using the default installation of snipMate.vim, if
-you type "for<tab>" in insert mode, it will expand a typical for loop in C: >
-
- for (i = 0; i < count; i++) {
-
- }
-
-
-To go to the next item in the loop, simply <tab> over to it; if there is
-repeated code, such as the "i" variable in this example, you can simply
-start typing once it's highlighted and all the matches specified in the
-snippet will be updated. To go in reverse, use <shift-tab>.
-
-==============================================================================
-SYNTAX *snippet-syntax*
-
-Snippets can be defined in two ways. They can be in their own file, named
-after their trigger in 'snippets/<filetype>/<trigger>.snippet', or they can be
-defined together in a 'snippets/<filetype>.snippets' file. Note that dotted
-'filetype' syntax is supported -- e.g., you can use >
-
- :set ft=html.eruby
-
-to activate snippets for both HTML and eRuby for the current file.
-
-The syntax for snippets in *.snippets files is the following: >
-
- snippet trigger
- expanded text
- more expanded text
-
-Note that the first hard tab after the snippet trigger is required, and not
-expanded in the actual snippet. The syntax for *.snippet files is the same,
-only without the trigger declaration and starting indentation.
-
-Also note that snippets must be defined using hard tabs. They can be expanded
-to spaces later if desired (see |snipMate-indenting|).
-
-"#" is used as a line-comment character in *.snippets files; however, they can
-only be used outside of a snippet declaration. E.g.: >
-
- # this is a correct comment
- snippet trigger
- expanded text
- snippet another_trigger
- # this isn't a comment!
- expanded text
-<
-This should hopefully be obvious with the included syntax highlighting.
-
- *snipMate-${#}*
-Tab stops ~
-
-By default, the cursor is placed at the end of a snippet. To specify where the
-cursor is to be placed next, use "${#}", where the # is the number of the tab
-stop. E.g., to place the cursor first on the id of a <div> tag, and then allow
-the user to press <tab> to go to the middle of it:
- >
- snippet div
- <div id="${1}">
- ${2}
- </div>
-<
- *snipMate-placeholders* *snipMate-${#:}* *snipMate-$#*
-Placeholders ~
-
-Placeholder text can be supplied using "${#:text}", where # is the number of
-the tab stop. This text then can be copied throughout the snippet using "$#",
-given # is the same number as used before. So, to make a C for loop: >
-
- snippet for
- for (${2:i}; $2 < ${1:count}; $1++) {
- ${4}
- }
-
-This will cause "count" to first be selected and change if the user starts
-typing. When <tab> is pressed, the "i" in ${2}'s position will be selected;
-all $2 variables will default to "i" and automatically be updated if the user
-starts typing.
-NOTE: "$#" syntax is used only for variables, not for tab stops as in TextMate.
-
-Variables within variables are also possible. For instance: >
-
- snippet opt
- <option value="${1:option}">${2:$1}</option>
-
-Will, as usual, cause "option" to first be selected and update all the $1
-variables if the user starts typing. Since one of these variables is inside of
-${2}, this text will then be used as a placeholder for the next tab stop,
-allowing the user to change it if he wishes.
-
-To copy a value throughout a snippet without supplying default text, simply
-use the "${#:}" construct without the text; e.g.: >
-
- snippet foo
- ${1:}bar$1
-< *snipMate-commands*
-Interpolated Vim Script ~
-
-Snippets can also contain Vim script commands that are executed (via |eval()|)
-when the snippet is inserted. Commands are given inside backticks (`...`); for
-TextMates's functionality, use the |system()| function. E.g.: >
-
- snippet date
- `system("date +%Y-%m-%d")`
-
-will insert the current date, assuming you are on a Unix system. Note that you
-can also (and should) use |strftime()| for this example.
-
-Filename([{expr}] [, {defaultText}]) *snipMate-filename* *Filename()*
-
-Since the current filename is used often in snippets, a default function
-has been defined for it in snipMate.vim, appropriately called Filename().
-
-With no arguments, the default filename without an extension is returned;
-the first argument specifies what to place before or after the filename,
-and the second argument supplies the default text to be used if the file
-has not been named. "$1" in the first argument is replaced with the filename;
-if you only want the filename to be returned, the first argument can be left
-blank. Examples: >
-
- snippet filename
- `Filename()`
- snippet filename_with_default
- `Filename('', 'name')`
- snippet filename_foo
- `filename('$1_foo')`
-
-The first example returns the filename if it the file has been named, and an
-empty string if it hasn't. The second returns the filename if it's been named,
-and "name" if it hasn't. The third returns the filename followed by "_foo" if
-it has been named, and an empty string if it hasn't.
-
- *multi_snip*
-To specify that a snippet can have multiple matches in a *.snippets file, use
-this syntax: >
-
- snippet trigger A description of snippet #1
- expand this text
- snippet trigger A description of snippet #2
- expand THIS text!
-
-In this example, when "trigger<tab>" is typed, a numbered menu containing all
-of the descriptions of the "trigger" will be shown; when the user presses the
-corresponding number, that snippet will then be expanded.
-
-To create a snippet with multiple matches using *.snippet files,
-simply place all the snippets in a subdirectory with the trigger name:
-'snippets/<filetype>/<trigger>/<name>.snippet'.
-
-==============================================================================
-USAGE *snipMate-usage*
-
- *'snippets'* *g:snippets_dir*
-Snippets are by default looked for any 'snippets' directory in your
-'runtimepath'. Typically, it is located at '~/.vim/snippets/' on *nix or
-'$HOME\vimfiles\snippets\' on Windows. To change that location or add another
-one, change the g:snippets_dir variable in your |.vimrc| to your preferred
-directory, or use the |ExtractSnips()|function. This will be used by the
-|globpath()| function, and so accepts the same syntax as it (e.g.,
-comma-separated paths).
-
-ExtractSnipsFile({directory}, {filetype}) *ExtractSnipsFile()* *.snippets*
-
-ExtractSnipsFile() extracts the specified *.snippets file for the given
-filetype. A .snippets file contains multiple snippet declarations for the
-filetype. It is further explained above, in |snippet-syntax|.
-
-ExtractSnips({directory}, {filetype}) *ExtractSnips()* *.snippet*
-
-ExtractSnips() extracts *.snippet files from the specified directory and
-defines them as snippets for the given filetype. The directory tree should
-look like this: 'snippets/<filetype>/<trigger>.snippet'. If the snippet has
-multiple matches, it should look like this:
-'snippets/<filetype>/<trigger>/<name>.snippet' (see |multi_snip|).
-
- *ResetSnippets()*
-The ResetSnippets() function removes all snippets from memory. This is useful
-to put at the top of a snippet setup file for if you would like to |:source|
-it multiple times.
-
- *list-snippets* *i_CTRL-R_<Tab>*
-If you would like to see what snippets are available, simply type <c-r><tab>
-in the current buffer to show a list via |popupmenu-completion|.
-
-==============================================================================
-SETTINGS *snipMate-settings* *g:snips_author*
-
-The g:snips_author string (similar to $TM_FULLNAME in TextMate) should be set
-to your name; it can then be used in snippets to automatically add it. E.g.: >
-
- let g:snips_author = 'Hubert Farnsworth'
- snippet name
- `g:snips_author`
-<
- *snipMate-expandtab* *snipMate-indenting*
-If you would like your snippets to be expanded using spaces instead of tabs,
-just enable 'expandtab' and set 'softtabstop' to your preferred amount of
-spaces. If 'softtabstop' is not set, 'shiftwidth' is used instead.
-
- *snipMate-remap*
-snipMate does not come with a setting to customize the trigger key, but you
-can remap it easily in the two lines it's defined in the 'after' directory
-under 'plugin/snipMate.vim'. For instance, to change the trigger key
-to CTRL-J, just change this: >
-
- ino <tab> <c-r>=TriggerSnippet()<cr>
- snor <tab> <esc>i<right><c-r>=TriggerSnippet()<cr>
-
-to this: >
- ino <c-j> <c-r>=TriggerSnippet()<cr>
- snor <c-j> <esc>i<right><c-r>=TriggerSnippet()<cr>
-
-==============================================================================
-FEATURES *snipMate-features*
-
-snipMate.vim has the following features among others:
- - The syntax of snippets is very similar to TextMate's, allowing
- easy conversion.
- - The position of the snippet is kept transparently (i.e. it does not use
- markers/placeholders written to the buffer), which allows you to escape
- out of an incomplete snippet, something particularly useful in Vim.
- - Variables in snippets are updated as-you-type.
- - Snippets can have multiple matches.
- - Snippets can be out of order. For instance, in a do...while loop, the
- condition can be added before the code.
- - [New] File-based snippets are supported.
- - [New] Triggers after non-word delimiters are expanded, e.g. "foo"
- in "bar.foo".
- - [New] <shift-tab> can now be used to jump tab stops in reverse order.
-
-==============================================================================
-DISADVANTAGES *snipMate-disadvantages*
-
-snipMate.vim currently has the following disadvantages to TextMate's snippets:
- - There is no $0; the order of tab stops must be explicitly stated.
- - Placeholders within placeholders are not possible. E.g.: >
-
- '<div${1: id="${2:some_id}}">${3}</div>'
-<
- In TextMate this would first highlight ' id="some_id"', and if
- you hit delete it would automatically skip ${2} and go to ${3}
- on the next <tab>, but if you didn't delete it it would highlight
- "some_id" first. You cannot do this in snipMate.vim.
- - Regex cannot be performed on variables, such as "${1/.*/\U&}"
- - Placeholders cannot span multiple lines.
- - Activating snippets in different scopes of the same file is
- not possible.
-
-Perhaps some of these features will be added in a later release.
-
-==============================================================================
-CONTACT *snipMate-contact* *snipMate-author*
-
-To contact the author (Michael Sanders), please email:
- msanders42+snipmate <at> gmail <dot> com
-
-I greatly appreciate any suggestions or improvements offered for the script.
-
-==============================================================================
-
-vim:tw=78:ts=8:ft=help:norl:
diff --git a/vim/doc/tags b/vim/doc/tags
deleted file mode 100644
index 3cd29b5..0000000
--- a/vim/doc/tags
+++ /dev/null
@@ -1,382 +0,0 @@
-'snippets' snipMate.txt /*'snippets'*
-.snippet snipMate.txt /*.snippet*
-.snippets snipMate.txt /*.snippets*
-:FufBookmarkDir fuf.txt /*:FufBookmarkDir*
-:FufBookmarkDirAdd fuf.txt /*:FufBookmarkDirAdd*
-:FufBookmarkFile fuf.txt /*:FufBookmarkFile*
-:FufBookmarkFileAdd fuf.txt /*:FufBookmarkFileAdd*
-:FufBookmarkFileAddAsSelectedText fuf.txt /*:FufBookmarkFileAddAsSelectedText*
-:FufBuffer fuf.txt /*:FufBuffer*
-:FufBufferTag fuf.txt /*:FufBufferTag*
-:FufBufferTagAll fuf.txt /*:FufBufferTagAll*
-:FufBufferTagAllWithCursorWord fuf.txt /*:FufBufferTagAllWithCursorWord*
-:FufBufferTagAllWithSelectedText fuf.txt /*:FufBufferTagAllWithSelectedText*
-:FufBufferTagWithCursorWord fuf.txt /*:FufBufferTagWithCursorWord*
-:FufBufferTagWithSelectedText fuf.txt /*:FufBufferTagWithSelectedText*
-:FufChangeList fuf.txt /*:FufChangeList*
-:FufCoverageFile fuf.txt /*:FufCoverageFile*
-:FufCoverageFileChange fuf.txt /*:FufCoverageFileChange*
-:FufCoverageFileRegister fuf.txt /*:FufCoverageFileRegister*
-:FufDir fuf.txt /*:FufDir*
-:FufDirWithCurrentBufferDir fuf.txt /*:FufDirWithCurrentBufferDir*
-:FufDirWithFullCwd fuf.txt /*:FufDirWithFullCwd*
-:FufEditDataFile fuf.txt /*:FufEditDataFile*
-:FufFile fuf.txt /*:FufFile*
-:FufFileWithCurrentBufferDir fuf.txt /*:FufFileWithCurrentBufferDir*
-:FufFileWithFullCwd fuf.txt /*:FufFileWithFullCwd*
-:FufHelp fuf.txt /*:FufHelp*
-:FufJumpList fuf.txt /*:FufJumpList*
-:FufLine fuf.txt /*:FufLine*
-:FufMruCmd fuf.txt /*:FufMruCmd*
-:FufMruFile fuf.txt /*:FufMruFile*
-:FufMruFileInCwd fuf.txt /*:FufMruFileInCwd*
-:FufQuickfix fuf.txt /*:FufQuickfix*
-:FufRenewCache fuf.txt /*:FufRenewCache*
-:FufTag fuf.txt /*:FufTag*
-:FufTagWithCursorWord fuf.txt /*:FufTagWithCursorWord*
-:FufTaggedFile fuf.txt /*:FufTaggedFile*
-:MatchDebug matchit.txt /*:MatchDebug*
-:TComment tcomment.txt /*:TComment*
-:TCommentAs tcomment.txt /*:TCommentAs*
-:TCommentBlock tcomment.txt /*:TCommentBlock*
-:TCommentInline tcomment.txt /*:TCommentInline*
-:TCommentMaybeInline tcomment.txt /*:TCommentMaybeInline*
-:TCommentRight tcomment.txt /*:TCommentRight*
-<C-Y>, zencoding.txt /*<C-Y>,*
-<C-Y>/ zencoding.txt /*<C-Y>\/*
-<C-Y>A zencoding.txt /*<C-Y>A*
-<C-Y>D zencoding.txt /*<C-Y>D*
-<C-Y>N zencoding.txt /*<C-Y>N*
-<C-Y>a zencoding.txt /*<C-Y>a*
-<C-Y>d zencoding.txt /*<C-Y>d*
-<C-Y>i zencoding.txt /*<C-Y>i*
-<C-Y>j zencoding.txt /*<C-Y>j*
-<C-Y>k zencoding.txt /*<C-Y>k*
-<C-Y>n zencoding.txt /*<C-Y>n*
-ExtractSnips() snipMate.txt /*ExtractSnips()*
-ExtractSnipsFile() snipMate.txt /*ExtractSnipsFile()*
-Filename() snipMate.txt /*Filename()*
-MatchError matchit.txt /*MatchError*
-ResetSnippets() snipMate.txt /*ResetSnippets()*
-YRClear yankring.txt /*YRClear*
-YRClear-example yankring.txt /*YRClear-example*
-YRDeleteRange yankring.txt /*YRDeleteRange*
-YRGetElem yankring.txt /*YRGetElem*
-YRGetMultiple yankring.txt /*YRGetMultiple*
-YRGetMultiple-example yankring.txt /*YRGetMultiple-example*
-YRMapsCreate yankring.txt /*YRMapsCreate*
-YRMapsDelete yankring.txt /*YRMapsDelete*
-YRPaste yankring.txt /*YRPaste*
-YRPop yankring.txt /*YRPop*
-YRPop-example yankring.txt /*YRPop-example*
-YRPush yankring.txt /*YRPush*
-YRPush-example yankring.txt /*YRPush-example*
-YRReplace yankring.txt /*YRReplace*
-YRReplace-example yankring.txt /*YRReplace-example*
-YRSearch yankring.txt /*YRSearch*
-YRSearch-example yankring.txt /*YRSearch-example*
-YRShow yankring.txt /*YRShow*
-YRShow-example yankring.txt /*YRShow-example*
-YRToggle yankring.txt /*YRToggle*
-YRYankCount yankring.txt /*YRYankCount*
-YRYankRange yankring.txt /*YRYankRange*
-YRYankRange-example yankring.txt /*YRYankRange-example*
-[% matchit.txt /*[%*
-]% matchit.txt /*]%*
-abc fuf.txt /*abc*
-any-item-example yankring.txt /*any-item-example*
-b:match_col matchit.txt /*b:match_col*
-b:match_debug matchit.txt /*b:match_debug*
-b:match_ignorecase matchit.txt /*b:match_ignorecase*
-b:match_ini matchit.txt /*b:match_ini*
-b:match_iniBR matchit.txt /*b:match_iniBR*
-b:match_match matchit.txt /*b:match_match*
-b:match_pat matchit.txt /*b:match_pat*
-b:match_skip matchit.txt /*b:match_skip*
-b:match_table matchit.txt /*b:match_table*
-b:match_tail matchit.txt /*b:match_tail*
-b:match_wholeBR matchit.txt /*b:match_wholeBR*
-b:match_word matchit.txt /*b:match_word*
-b:match_words matchit.txt /*b:match_words*
-ft-gitcommit-plugin ft-gitcommit-plugin.txt /*ft-gitcommit-plugin*
-fuf fuf.txt /*fuf*
-fuf#setOneTimeVariables() fuf.txt /*fuf#setOneTimeVariables()*
-fuf-abbreviation fuf.txt /*fuf-abbreviation*
-fuf-about fuf.txt /*fuf-about*
-fuf-author fuf.txt /*fuf-author*
-fuf-bookmarkdir-mode fuf.txt /*fuf-bookmarkdir-mode*
-fuf-bookmarkfile-mode fuf.txt /*fuf-bookmarkfile-mode*
-fuf-buffer-mode fuf.txt /*fuf-buffer-mode*
-fuf-buffertag-mode fuf.txt /*fuf-buffertag-mode*
-fuf-cache fuf.txt /*fuf-cache*
-fuf-callbackfile-mode fuf.txt /*fuf-callbackfile-mode*
-fuf-callbackitem-mode fuf.txt /*fuf-callbackitem-mode*
-fuf-changelist-mode fuf.txt /*fuf-changelist-mode*
-fuf-changelog fuf.txt /*fuf-changelog*
-fuf-commands fuf.txt /*fuf-commands*
-fuf-contact fuf.txt /*fuf-contact*
-fuf-coveragefile-mode fuf.txt /*fuf-coveragefile-mode*
-fuf-data-file fuf.txt /*fuf-data-file*
-fuf-detailed-topics fuf.txt /*fuf-detailed-topics*
-fuf-dir-mode fuf.txt /*fuf-dir-mode*
-fuf-dot-sequence fuf.txt /*fuf-dot-sequence*
-fuf-file-mode fuf.txt /*fuf-file-mode*
-fuf-givencmd-mode fuf.txt /*fuf-givencmd-mode*
-fuf-givendir-mode fuf.txt /*fuf-givendir-mode*
-fuf-givenfile-mode fuf.txt /*fuf-givenfile-mode*
-fuf-help-mode fuf.txt /*fuf-help-mode*
-fuf-hiding-menu fuf.txt /*fuf-hiding-menu*
-fuf-how-to-add-mode fuf.txt /*fuf-how-to-add-mode*
-fuf-installation fuf.txt /*fuf-installation*
-fuf-introduction fuf.txt /*fuf-introduction*
-fuf-jumplist-mode fuf.txt /*fuf-jumplist-mode*
-fuf-line-mode fuf.txt /*fuf-line-mode*
-fuf-migemo fuf.txt /*fuf-migemo*
-fuf-modes fuf.txt /*fuf-modes*
-fuf-mrucmd-mode fuf.txt /*fuf-mrucmd-mode*
-fuf-mrufile-mode fuf.txt /*fuf-mrufile-mode*
-fuf-multiple-search fuf.txt /*fuf-multiple-search*
-fuf-options fuf.txt /*fuf-options*
-fuf-options-for-all-modes fuf.txt /*fuf-options-for-all-modes*
-fuf-options-for-bookmarkdir-mode fuf.txt /*fuf-options-for-bookmarkdir-mode*
-fuf-options-for-bookmarkfile-mode fuf.txt /*fuf-options-for-bookmarkfile-mode*
-fuf-options-for-buffer-mode fuf.txt /*fuf-options-for-buffer-mode*
-fuf-options-for-buffertag-mode fuf.txt /*fuf-options-for-buffertag-mode*
-fuf-options-for-changelist-mode fuf.txt /*fuf-options-for-changelist-mode*
-fuf-options-for-coveragefile-mode fuf.txt /*fuf-options-for-coveragefile-mode*
-fuf-options-for-dir-mode fuf.txt /*fuf-options-for-dir-mode*
-fuf-options-for-file-mode fuf.txt /*fuf-options-for-file-mode*
-fuf-options-for-help-mode fuf.txt /*fuf-options-for-help-mode*
-fuf-options-for-jumplist-mode fuf.txt /*fuf-options-for-jumplist-mode*
-fuf-options-for-line-mode fuf.txt /*fuf-options-for-line-mode*
-fuf-options-for-mrucmd-mode fuf.txt /*fuf-options-for-mrucmd-mode*
-fuf-options-for-mrufile-mode fuf.txt /*fuf-options-for-mrufile-mode*
-fuf-options-for-quickfix-mode fuf.txt /*fuf-options-for-quickfix-mode*
-fuf-options-for-tag-mode fuf.txt /*fuf-options-for-tag-mode*
-fuf-options-for-taggedfile-mode fuf.txt /*fuf-options-for-taggedfile-mode*
-fuf-quickfix-mode fuf.txt /*fuf-quickfix-mode*
-fuf-reusing-window fuf.txt /*fuf-reusing-window*
-fuf-search-patterns fuf.txt /*fuf-search-patterns*
-fuf-setting-one-time-option fuf.txt /*fuf-setting-one-time-option*
-fuf-sorting-of-completion-items fuf.txt /*fuf-sorting-of-completion-items*
-fuf-tag-mode fuf.txt /*fuf-tag-mode*
-fuf-taggedfile-mode fuf.txt /*fuf-taggedfile-mode*
-fuf-thanks fuf.txt /*fuf-thanks*
-fuf-usage fuf.txt /*fuf-usage*
-fuf-vimrc-example fuf.txt /*fuf-vimrc-example*
-fuf.txt fuf.txt /*fuf.txt*
-fuzzyfinder fuf.txt /*fuzzyfinder*
-g% matchit.txt /*g%*
-g:fuf_abbrevMap fuf.txt /*g:fuf_abbrevMap*
-g:fuf_autoPreview fuf.txt /*g:fuf_autoPreview*
-g:fuf_bookmarkdir_keyDelete fuf.txt /*g:fuf_bookmarkdir_keyDelete*
-g:fuf_bookmarkdir_prompt fuf.txt /*g:fuf_bookmarkdir_prompt*
-g:fuf_bookmarkdir_switchOrder fuf.txt /*g:fuf_bookmarkdir_switchOrder*
-g:fuf_bookmarkfile_keyDelete fuf.txt /*g:fuf_bookmarkfile_keyDelete*
-g:fuf_bookmarkfile_prompt fuf.txt /*g:fuf_bookmarkfile_prompt*
-g:fuf_bookmarkfile_searchRange fuf.txt /*g:fuf_bookmarkfile_searchRange*
-g:fuf_bookmarkfile_switchOrder fuf.txt /*g:fuf_bookmarkfile_switchOrder*
-g:fuf_buffer_keyDelete fuf.txt /*g:fuf_buffer_keyDelete*
-g:fuf_buffer_mruOrder fuf.txt /*g:fuf_buffer_mruOrder*
-g:fuf_buffer_prompt fuf.txt /*g:fuf_buffer_prompt*
-g:fuf_buffer_switchOrder fuf.txt /*g:fuf_buffer_switchOrder*
-g:fuf_buffertag_ctagsPath fuf.txt /*g:fuf_buffertag_ctagsPath*
-g:fuf_buffertag_prompt fuf.txt /*g:fuf_buffertag_prompt*
-g:fuf_buffertag_switchOrder fuf.txt /*g:fuf_buffertag_switchOrder*
-g:fuf_changelist_prompt fuf.txt /*g:fuf_changelist_prompt*
-g:fuf_changelist_switchOrder fuf.txt /*g:fuf_changelist_switchOrder*
-g:fuf_coveragefile_exclude fuf.txt /*g:fuf_coveragefile_exclude*
-g:fuf_coveragefile_globPatterns fuf.txt /*g:fuf_coveragefile_globPatterns*
-g:fuf_coveragefile_prompt fuf.txt /*g:fuf_coveragefile_prompt*
-g:fuf_coveragefile_switchOrder fuf.txt /*g:fuf_coveragefile_switchOrder*
-g:fuf_dataDir fuf.txt /*g:fuf_dataDir*
-g:fuf_dir_exclude fuf.txt /*g:fuf_dir_exclude*
-g:fuf_dir_prompt fuf.txt /*g:fuf_dir_prompt*
-g:fuf_dir_switchOrder fuf.txt /*g:fuf_dir_switchOrder*
-g:fuf_enumeratingLimit fuf.txt /*g:fuf_enumeratingLimit*
-g:fuf_file_exclude fuf.txt /*g:fuf_file_exclude*
-g:fuf_file_prompt fuf.txt /*g:fuf_file_prompt*
-g:fuf_file_switchOrder fuf.txt /*g:fuf_file_switchOrder*
-g:fuf_fuzzyRefining fuf.txt /*g:fuf_fuzzyRefining*
-g:fuf_help_prompt fuf.txt /*g:fuf_help_prompt*
-g:fuf_help_switchOrder fuf.txt /*g:fuf_help_switchOrder*
-g:fuf_ignoreCase fuf.txt /*g:fuf_ignoreCase*
-g:fuf_jumplist_prompt fuf.txt /*g:fuf_jumplist_prompt*
-g:fuf_jumplist_switchOrder fuf.txt /*g:fuf_jumplist_switchOrder*
-g:fuf_keyNextMode fuf.txt /*g:fuf_keyNextMode*
-g:fuf_keyNextPattern fuf.txt /*g:fuf_keyNextPattern*
-g:fuf_keyOpen fuf.txt /*g:fuf_keyOpen*
-g:fuf_keyOpenSplit fuf.txt /*g:fuf_keyOpenSplit*
-g:fuf_keyOpenTabpage fuf.txt /*g:fuf_keyOpenTabpage*
-g:fuf_keyOpenVsplit fuf.txt /*g:fuf_keyOpenVsplit*
-g:fuf_keyPrevMode fuf.txt /*g:fuf_keyPrevMode*
-g:fuf_keyPrevPattern fuf.txt /*g:fuf_keyPrevPattern*
-g:fuf_keyPreview fuf.txt /*g:fuf_keyPreview*
-g:fuf_keySwitchMatching fuf.txt /*g:fuf_keySwitchMatching*
-g:fuf_learningLimit fuf.txt /*g:fuf_learningLimit*
-g:fuf_line_prompt fuf.txt /*g:fuf_line_prompt*
-g:fuf_line_switchOrder fuf.txt /*g:fuf_line_switchOrder*
-g:fuf_maxMenuWidth fuf.txt /*g:fuf_maxMenuWidth*
-g:fuf_modesDisable fuf.txt /*g:fuf_modesDisable*
-g:fuf_mrucmd_exclude fuf.txt /*g:fuf_mrucmd_exclude*
-g:fuf_mrucmd_maxItem fuf.txt /*g:fuf_mrucmd_maxItem*
-g:fuf_mrucmd_prompt fuf.txt /*g:fuf_mrucmd_prompt*
-g:fuf_mrucmd_switchOrder fuf.txt /*g:fuf_mrucmd_switchOrder*
-g:fuf_mrufile_exclude fuf.txt /*g:fuf_mrufile_exclude*
-g:fuf_mrufile_keyExpand fuf.txt /*g:fuf_mrufile_keyExpand*
-g:fuf_mrufile_maxItem fuf.txt /*g:fuf_mrufile_maxItem*
-g:fuf_mrufile_maxItemDir fuf.txt /*g:fuf_mrufile_maxItemDir*
-g:fuf_mrufile_prompt fuf.txt /*g:fuf_mrufile_prompt*
-g:fuf_mrufile_switchOrder fuf.txt /*g:fuf_mrufile_switchOrder*
-g:fuf_patternSeparator fuf.txt /*g:fuf_patternSeparator*
-g:fuf_previewHeight fuf.txt /*g:fuf_previewHeight*
-g:fuf_promptHighlight fuf.txt /*g:fuf_promptHighlight*
-g:fuf_quickfix_prompt fuf.txt /*g:fuf_quickfix_prompt*
-g:fuf_quickfix_switchOrder fuf.txt /*g:fuf_quickfix_switchOrder*
-g:fuf_reuseWindow fuf.txt /*g:fuf_reuseWindow*
-g:fuf_splitPathMatching fuf.txt /*g:fuf_splitPathMatching*
-g:fuf_tag_prompt fuf.txt /*g:fuf_tag_prompt*
-g:fuf_tag_switchOrder fuf.txt /*g:fuf_tag_switchOrder*
-g:fuf_taggedfile_prompt fuf.txt /*g:fuf_taggedfile_prompt*
-g:fuf_taggedfile_switchOrder fuf.txt /*g:fuf_taggedfile_switchOrder*
-g:fuf_timeFormat fuf.txt /*g:fuf_timeFormat*
-g:fuf_useMigemo fuf.txt /*g:fuf_useMigemo*
-g:snippets_dir snipMate.txt /*g:snippets_dir*
-g:snips_author snipMate.txt /*g:snips_author*
-g:tcomment#syntax_substitute tcomment.txt /*g:tcomment#syntax_substitute*
-g:tcommentBlankLines tcomment.txt /*g:tcommentBlankLines*
-g:tcommentBlockC tcomment.txt /*g:tcommentBlockC*
-g:tcommentBlockC2 tcomment.txt /*g:tcommentBlockC2*
-g:tcommentBlockXML tcomment.txt /*g:tcommentBlockXML*
-g:tcommentGuessFileType tcomment.txt /*g:tcommentGuessFileType*
-g:tcommentGuessFileType_django tcomment.txt /*g:tcommentGuessFileType_django*
-g:tcommentGuessFileType_dsl tcomment.txt /*g:tcommentGuessFileType_dsl*
-g:tcommentGuessFileType_html tcomment.txt /*g:tcommentGuessFileType_html*
-g:tcommentGuessFileType_php tcomment.txt /*g:tcommentGuessFileType_php*
-g:tcommentGuessFileType_tskeleton tcomment.txt /*g:tcommentGuessFileType_tskeleton*
-g:tcommentGuessFileType_vim tcomment.txt /*g:tcommentGuessFileType_vim*
-g:tcommentIgnoreTypes_php tcomment.txt /*g:tcommentIgnoreTypes_php*
-g:tcommentInlineC tcomment.txt /*g:tcommentInlineC*
-g:tcommentInlineXML tcomment.txt /*g:tcommentInlineXML*
-g:tcommentMapLeaderOp1 tcomment.txt /*g:tcommentMapLeaderOp1*
-g:tcommentMapLeaderOp2 tcomment.txt /*g:tcommentMapLeaderOp2*
-g:tcommentOpModeExtra tcomment.txt /*g:tcommentOpModeExtra*
-g:tcommentOptions tcomment.txt /*g:tcommentOptions*
-g:tcommentSyntaxMap tcomment.txt /*g:tcommentSyntaxMap*
-global-example yankring.txt /*global-example*
-i_CTRL-R_<Tab> snipMate.txt /*i_CTRL-R_<Tab>*
-l9 l9.txt /*l9*
-l9-about l9.txt /*l9-about*
-l9-author l9.txt /*l9-author*
-l9-changelog l9.txt /*l9-changelog*
-l9-contact l9.txt /*l9-contact*
-l9-installation l9.txt /*l9-installation*
-l9-introduction l9.txt /*l9-introduction*
-l9-usage l9.txt /*l9-usage*
-l9.txt l9.txt /*l9.txt*
-list-snippets snipMate.txt /*list-snippets*
-matchit matchit.txt /*matchit*
-matchit-% matchit.txt /*matchit-%*
-matchit-\1 matchit.txt /*matchit-\\1*
-matchit-activate matchit.txt /*matchit-activate*
-matchit-backref matchit.txt /*matchit-backref*
-matchit-bugs matchit.txt /*matchit-bugs*
-matchit-choose matchit.txt /*matchit-choose*
-matchit-configure matchit.txt /*matchit-configure*
-matchit-debug matchit.txt /*matchit-debug*
-matchit-details matchit.txt /*matchit-details*
-matchit-highlight matchit.txt /*matchit-highlight*
-matchit-hl matchit.txt /*matchit-hl*
-matchit-intro matchit.txt /*matchit-intro*
-matchit-languages matchit.txt /*matchit-languages*
-matchit-modes matchit.txt /*matchit-modes*
-matchit-newlang matchit.txt /*matchit-newlang*
-matchit-o_% matchit.txt /*matchit-o_%*
-matchit-parse matchit.txt /*matchit-parse*
-matchit-s:notend matchit.txt /*matchit-s:notend*
-matchit-s:sol matchit.txt /*matchit-s:sol*
-matchit-spaces matchit.txt /*matchit-spaces*
-matchit-troubleshoot matchit.txt /*matchit-troubleshoot*
-matchit-v_% matchit.txt /*matchit-v_%*
-matchit.txt matchit.txt /*matchit.txt*
-matchit.vim matchit.txt /*matchit.vim*
-multi_snip snipMate.txt /*multi_snip*
-multiple-items-example yankring.txt /*multiple-items-example*
-o_[% matchit.txt /*o_[%*
-o_]% matchit.txt /*o_]%*
-o_g% matchit.txt /*o_g%*
-snipMate snipMate.txt /*snipMate*
-snipMate-$# snipMate.txt /*snipMate-$#*
-snipMate-${#:} snipMate.txt /*snipMate-${#:}*
-snipMate-${#} snipMate.txt /*snipMate-${#}*
-snipMate-author snipMate.txt /*snipMate-author*
-snipMate-commands snipMate.txt /*snipMate-commands*
-snipMate-contact snipMate.txt /*snipMate-contact*
-snipMate-description snipMate.txt /*snipMate-description*
-snipMate-disadvantages snipMate.txt /*snipMate-disadvantages*
-snipMate-expandtab snipMate.txt /*snipMate-expandtab*
-snipMate-features snipMate.txt /*snipMate-features*
-snipMate-filename snipMate.txt /*snipMate-filename*
-snipMate-indenting snipMate.txt /*snipMate-indenting*
-snipMate-placeholders snipMate.txt /*snipMate-placeholders*
-snipMate-remap snipMate.txt /*snipMate-remap*
-snipMate-settings snipMate.txt /*snipMate-settings*
-snipMate-usage snipMate.txt /*snipMate-usage*
-snipMate.txt snipMate.txt /*snipMate.txt*
-snippet snipMate.txt /*snippet*
-snippet-syntax snipMate.txt /*snippet-syntax*
-snippets snipMate.txt /*snippets*
-tcomment#Comment() tcomment.txt /*tcomment#Comment()*
-tcomment#CommentAs() tcomment.txt /*tcomment#CommentAs()*
-tcomment#DefineType() tcomment.txt /*tcomment#DefineType()*
-tcomment#Operator() tcomment.txt /*tcomment#Operator()*
-tcomment#OperatorAnyway() tcomment.txt /*tcomment#OperatorAnyway()*
-tcomment#OperatorLine() tcomment.txt /*tcomment#OperatorLine()*
-tcomment#OperatorLineAnyway() tcomment.txt /*tcomment#OperatorLineAnyway()*
-tcomment-maps tcomment.txt /*tcomment-maps*
-tcomment.txt tcomment.txt /*tcomment.txt*
-v_<C-Y>, zencoding.txt /*v_<C-Y>,*
-v_[% matchit.txt /*v_[%*
-v_]% matchit.txt /*v_]%*
-v_a% matchit.txt /*v_a%*
-v_g% matchit.txt /*v_g%*
-yankring yankring.txt /*yankring*
-yankring-commands yankring.txt /*yankring-commands*
-yankring-configure yankring.txt /*yankring-configure*
-yankring-contents yankring.txt /*yankring-contents*
-yankring-custom-maps yankring.txt /*yankring-custom-maps*
-yankring-custom-menus yankring.txt /*yankring-custom-menus*
-yankring-description yankring.txt /*yankring-description*
-yankring-globals yankring.txt /*yankring-globals*
-yankring-history yankring.txt /*yankring-history*
-yankring-mappings yankring.txt /*yankring-mappings*
-yankring-tutorial yankring.txt /*yankring-tutorial*
-yankring-visual-example yankring.txt /*yankring-visual-example*
-yankring-window yankring.txt /*yankring-window*
-yankring-window-example yankring.txt /*yankring-window-example*
-yankring.txt yankring.txt /*yankring.txt*
-zencoding zencoding.txt /*zencoding*
-zencoding-balance-tag-inward zencoding.txt /*zencoding-balance-tag-inward*
-zencoding-balance-tag-outward zencoding.txt /*zencoding-balance-tag-outward*
-zencoding-complete-tag zencoding.txt /*zencoding-complete-tag*
-zencoding-contents zencoding.txt /*zencoding-contents*
-zencoding-customize zencoding.txt /*zencoding-customize*
-zencoding-customize-keymappings zencoding.txt /*zencoding-customize-keymappings*
-zencoding-define-tags-behavior zencoding.txt /*zencoding-define-tags-behavior*
-zencoding-expandabbr zencoding.txt /*zencoding-expandabbr*
-zencoding-goto-next-point zencoding.txt /*zencoding-goto-next-point*
-zencoding-goto-previous-point zencoding.txt /*zencoding-goto-previous-point*
-zencoding-indent-size zencoding.txt /*zencoding-indent-size*
-zencoding-install zencoding.txt /*zencoding-install*
-zencoding-introduction zencoding.txt /*zencoding-introduction*
-zencoding-make-anchor-url zencoding.txt /*zencoding-make-anchor-url*
-zencoding-merge-lines zencoding.txt /*zencoding-merge-lines*
-zencoding-quoted-text-url zencoding.txt /*zencoding-quoted-text-url*
-zencoding-remove-tag zencoding.txt /*zencoding-remove-tag*
-zencoding-split-join-tag zencoding.txt /*zencoding-split-join-tag*
-zencoding-todo zencoding.txt /*zencoding-todo*
-zencoding-toggle-comment zencoding.txt /*zencoding-toggle-comment*
-zencoding-tutorial zencoding.txt /*zencoding-tutorial*
-zencoding-update-image-size zencoding.txt /*zencoding-update-image-size*
-zencoding-wrap-wtih-abbreviation zencoding.txt /*zencoding-wrap-wtih-abbreviation*
-zencoding.txt zencoding.txt /*zencoding.txt*
diff --git a/vim/doc/tags-ja b/vim/doc/tags-ja
deleted file mode 100644
index 83fed0f..0000000
--- a/vim/doc/tags-ja
+++ /dev/null
@@ -1,182 +0,0 @@
-!_TAG_FILE_ENCODING utf-8 //
-:FufBookmarkDir fuf.jax /*:FufBookmarkDir*
-:FufBookmarkDirAdd fuf.jax /*:FufBookmarkDirAdd*
-:FufBookmarkFile fuf.jax /*:FufBookmarkFile*
-:FufBookmarkFileAdd fuf.jax /*:FufBookmarkFileAdd*
-:FufBookmarkFileAddAsSelectedText fuf.jax /*:FufBookmarkFileAddAsSelectedText*
-:FufBuffer fuf.jax /*:FufBuffer*
-:FufBufferTag fuf.jax /*:FufBufferTag*
-:FufBufferTagAll fuf.jax /*:FufBufferTagAll*
-:FufBufferTagAllWithCursorWord fuf.jax /*:FufBufferTagAllWithCursorWord*
-:FufBufferTagAllWithSelectedText fuf.jax /*:FufBufferTagAllWithSelectedText*
-:FufBufferTagWithCursorWord fuf.jax /*:FufBufferTagWithCursorWord*
-:FufBufferTagWithSelectedText fuf.jax /*:FufBufferTagWithSelectedText*
-:FufChangeList fuf.jax /*:FufChangeList*
-:FufCoverageFileChange fuf.jax /*:FufCoverageFileChange*
-:FufCoverageFileRegister fuf.jax /*:FufCoverageFileRegister*
-:FufDir fuf.jax /*:FufDir*
-:FufDirWithCurrentBufferDir fuf.jax /*:FufDirWithCurrentBufferDir*
-:FufDirWithFullCwd fuf.jax /*:FufDirWithFullCwd*
-:FufEditDataFile fuf.jax /*:FufEditDataFile*
-:FufFile fuf.jax /*:FufFile*
-:FufFileWithCurrentBufferDir fuf.jax /*:FufFileWithCurrentBufferDir*
-:FufFileWithFullCwd fuf.jax /*:FufFileWithFullCwd*
-:FufHelp fuf.jax /*:FufHelp*
-:FufJumpList fuf.jax /*:FufJumpList*
-:FufLine fuf.jax /*:FufLine*
-:FufMruCmd fuf.jax /*:FufMruCmd*
-:FufMruFile fuf.jax /*:FufMruFile*
-:FufMruFileInCwd fuf.jax /*:FufMruFileInCwd*
-:FufQuickfix fuf.jax /*:FufQuickfix*
-:FufRenewCache fuf.jax /*:FufRenewCache*
-:FufTag fuf.jax /*:FufTag*
-:FufTagWithCursorWord fuf.jax /*:FufTagWithCursorWord*
-:FufTaggedFile fuf.jax /*:FufTaggedFile*
-abc fuf.jax /*abc*
-fuf fuf.jax /*fuf*
-fuf#setOneTimeVariables() fuf.jax /*fuf#setOneTimeVariables()*
-fuf-abbreviation fuf.jax /*fuf-abbreviation*
-fuf-about fuf.jax /*fuf-about*
-fuf-author fuf.jax /*fuf-author*
-fuf-bookmarkdir-mode fuf.jax /*fuf-bookmarkdir-mode*
-fuf-bookmarkfile-mode fuf.jax /*fuf-bookmarkfile-mode*
-fuf-buffer-mode fuf.jax /*fuf-buffer-mode*
-fuf-buffertag-mode fuf.jax /*fuf-buffertag-mode*
-fuf-cache fuf.jax /*fuf-cache*
-fuf-callbackfile-mode fuf.jax /*fuf-callbackfile-mode*
-fuf-callbackitem-mode fuf.jax /*fuf-callbackitem-mode*
-fuf-changelist-mode fuf.jax /*fuf-changelist-mode*
-fuf-commands fuf.jax /*fuf-commands*
-fuf-contact fuf.jax /*fuf-contact*
-fuf-coveragefile-mode fuf.jax /*fuf-coveragefile-mode*
-fuf-data-file fuf.jax /*fuf-data-file*
-fuf-detailed-topics fuf.jax /*fuf-detailed-topics*
-fuf-dir-mode fuf.jax /*fuf-dir-mode*
-fuf-dot-sequence fuf.jax /*fuf-dot-sequence*
-fuf-file-mode fuf.jax /*fuf-file-mode*
-fuf-givencmd-mode fuf.jax /*fuf-givencmd-mode*
-fuf-givendir-mode fuf.jax /*fuf-givendir-mode*
-fuf-givenfile-mode fuf.jax /*fuf-givenfile-mode*
-fuf-help-mode fuf.jax /*fuf-help-mode*
-fuf-hiding-menu fuf.jax /*fuf-hiding-menu*
-fuf-how-to-add-mode fuf.jax /*fuf-how-to-add-mode*
-fuf-installation fuf.jax /*fuf-installation*
-fuf-introduction fuf.jax /*fuf-introduction*
-fuf-jumplist-mode fuf.jax /*fuf-jumplist-mode*
-fuf-line-mode fuf.jax /*fuf-line-mode*
-fuf-migemo fuf.jax /*fuf-migemo*
-fuf-modes fuf.jax /*fuf-modes*
-fuf-mrucmd-mode fuf.jax /*fuf-mrucmd-mode*
-fuf-mrufile-mode fuf.jax /*fuf-mrufile-mode*
-fuf-multiple-search fuf.jax /*fuf-multiple-search*
-fuf-options fuf.jax /*fuf-options*
-fuf-options-for-all-modes fuf.jax /*fuf-options-for-all-modes*
-fuf-options-for-bookmarkdir-mode fuf.jax /*fuf-options-for-bookmarkdir-mode*
-fuf-options-for-bookmarkfile-mode fuf.jax /*fuf-options-for-bookmarkfile-mode*
-fuf-options-for-buffer-mode fuf.jax /*fuf-options-for-buffer-mode*
-fuf-options-for-buffertag-mode fuf.jax /*fuf-options-for-buffertag-mode*
-fuf-options-for-changelist-mode fuf.jax /*fuf-options-for-changelist-mode*
-fuf-options-for-coveragefile-mode fuf.jax /*fuf-options-for-coveragefile-mode*
-fuf-options-for-dir-mode fuf.jax /*fuf-options-for-dir-mode*
-fuf-options-for-file-mode fuf.jax /*fuf-options-for-file-mode*
-fuf-options-for-help-mode fuf.jax /*fuf-options-for-help-mode*
-fuf-options-for-jumplist-mode fuf.jax /*fuf-options-for-jumplist-mode*
-fuf-options-for-line-mode fuf.jax /*fuf-options-for-line-mode*
-fuf-options-for-mrucmd-mode fuf.jax /*fuf-options-for-mrucmd-mode*
-fuf-options-for-mrufile-mode fuf.jax /*fuf-options-for-mrufile-mode*
-fuf-options-for-quickfix-mode fuf.jax /*fuf-options-for-quickfix-mode*
-fuf-options-for-tag-mode fuf.jax /*fuf-options-for-tag-mode*
-fuf-options-for-taggedfile-mode fuf.jax /*fuf-options-for-taggedfile-mode*
-fuf-quickfix-mode fuf.jax /*fuf-quickfix-mode*
-fuf-reusing-window fuf.jax /*fuf-reusing-window*
-fuf-search-patterns fuf.jax /*fuf-search-patterns*
-fuf-setting-one-time-option fuf.jax /*fuf-setting-one-time-option*
-fuf-sorting-of-completion-items fuf.jax /*fuf-sorting-of-completion-items*
-fuf-tag-mode fuf.jax /*fuf-tag-mode*
-fuf-taggedfile-mode fuf.jax /*fuf-taggedfile-mode*
-fuf-usage fuf.jax /*fuf-usage*
-fuf-vimrc-example fuf.jax /*fuf-vimrc-example*
-fuf.jax fuf.jax /*fuf.jax*
-fuzzyfinder fuf.jax /*fuzzyfinder*
-g:fuf_abbrevMap fuf.jax /*g:fuf_abbrevMap*
-g:fuf_autoPreview fuf.jax /*g:fuf_autoPreview*
-g:fuf_bookmarkdir_keyDelete fuf.jax /*g:fuf_bookmarkdir_keyDelete*
-g:fuf_bookmarkdir_prompt fuf.jax /*g:fuf_bookmarkdir_prompt*
-g:fuf_bookmarkdir_switchOrder fuf.jax /*g:fuf_bookmarkdir_switchOrder*
-g:fuf_bookmarkfile_keyDelete fuf.jax /*g:fuf_bookmarkfile_keyDelete*
-g:fuf_bookmarkfile_prompt fuf.jax /*g:fuf_bookmarkfile_prompt*
-g:fuf_bookmarkfile_searchRange fuf.jax /*g:fuf_bookmarkfile_searchRange*
-g:fuf_bookmarkfile_switchOrder fuf.jax /*g:fuf_bookmarkfile_switchOrder*
-g:fuf_buffer_keyDelete fuf.jax /*g:fuf_buffer_keyDelete*
-g:fuf_buffer_mruOrder fuf.jax /*g:fuf_buffer_mruOrder*
-g:fuf_buffer_prompt fuf.jax /*g:fuf_buffer_prompt*
-g:fuf_buffer_switchOrder fuf.jax /*g:fuf_buffer_switchOrder*
-g:fuf_buffertag_ctagsPath fuf.jax /*g:fuf_buffertag_ctagsPath*
-g:fuf_buffertag_prompt fuf.jax /*g:fuf_buffertag_prompt*
-g:fuf_buffertag_switchOrder fuf.jax /*g:fuf_buffertag_switchOrder*
-g:fuf_changelist_prompt fuf.jax /*g:fuf_changelist_prompt*
-g:fuf_changelist_switchOrder fuf.jax /*g:fuf_changelist_switchOrder*
-g:fuf_coveragefile_exclude fuf.jax /*g:fuf_coveragefile_exclude*
-g:fuf_coveragefile_globPatterns fuf.jax /*g:fuf_coveragefile_globPatterns*
-g:fuf_coveragefile_prompt fuf.jax /*g:fuf_coveragefile_prompt*
-g:fuf_coveragefile_switchOrder fuf.jax /*g:fuf_coveragefile_switchOrder*
-g:fuf_dataDir fuf.jax /*g:fuf_dataDir*
-g:fuf_dir_exclude fuf.jax /*g:fuf_dir_exclude*
-g:fuf_dir_prompt fuf.jax /*g:fuf_dir_prompt*
-g:fuf_dir_switchOrder fuf.jax /*g:fuf_dir_switchOrder*
-g:fuf_enumeratingLimit fuf.jax /*g:fuf_enumeratingLimit*
-g:fuf_file_exclude fuf.jax /*g:fuf_file_exclude*
-g:fuf_file_prompt fuf.jax /*g:fuf_file_prompt*
-g:fuf_file_switchOrder fuf.jax /*g:fuf_file_switchOrder*
-g:fuf_fuzzyRefining fuf.jax /*g:fuf_fuzzyRefining*
-g:fuf_help_prompt fuf.jax /*g:fuf_help_prompt*
-g:fuf_help_switchOrder fuf.jax /*g:fuf_help_switchOrder*
-g:fuf_ignoreCase fuf.jax /*g:fuf_ignoreCase*
-g:fuf_jumplist_prompt fuf.jax /*g:fuf_jumplist_prompt*
-g:fuf_jumplist_switchOrder fuf.jax /*g:fuf_jumplist_switchOrder*
-g:fuf_keyNextMode fuf.jax /*g:fuf_keyNextMode*
-g:fuf_keyNextPattern fuf.jax /*g:fuf_keyNextPattern*
-g:fuf_keyOpen fuf.jax /*g:fuf_keyOpen*
-g:fuf_keyOpenSplit fuf.jax /*g:fuf_keyOpenSplit*
-g:fuf_keyOpenTabpage fuf.jax /*g:fuf_keyOpenTabpage*
-g:fuf_keyOpenVsplit fuf.jax /*g:fuf_keyOpenVsplit*
-g:fuf_keyPrevMode fuf.jax /*g:fuf_keyPrevMode*
-g:fuf_keyPrevPattern fuf.jax /*g:fuf_keyPrevPattern*
-g:fuf_keyPreview fuf.jax /*g:fuf_keyPreview*
-g:fuf_keySwitchMatching fuf.jax /*g:fuf_keySwitchMatching*
-g:fuf_learningLimit fuf.jax /*g:fuf_learningLimit*
-g:fuf_line_prompt fuf.jax /*g:fuf_line_prompt*
-g:fuf_line_switchOrder fuf.jax /*g:fuf_line_switchOrder*
-g:fuf_maxMenuWidth fuf.jax /*g:fuf_maxMenuWidth*
-g:fuf_modesDisable fuf.jax /*g:fuf_modesDisable*
-g:fuf_mrucmd_exclude fuf.jax /*g:fuf_mrucmd_exclude*
-g:fuf_mrucmd_maxItem fuf.jax /*g:fuf_mrucmd_maxItem*
-g:fuf_mrucmd_prompt fuf.jax /*g:fuf_mrucmd_prompt*
-g:fuf_mrucmd_switchOrder fuf.jax /*g:fuf_mrucmd_switchOrder*
-g:fuf_mrufile_exclude fuf.jax /*g:fuf_mrufile_exclude*
-g:fuf_mrufile_keyExpand fuf.jax /*g:fuf_mrufile_keyExpand*
-g:fuf_mrufile_maxItem fuf.jax /*g:fuf_mrufile_maxItem*
-g:fuf_mrufile_maxItemDir fuf.jax /*g:fuf_mrufile_maxItemDir*
-g:fuf_mrufile_prompt fuf.jax /*g:fuf_mrufile_prompt*
-g:fuf_mrufile_switchOrder fuf.jax /*g:fuf_mrufile_switchOrder*
-g:fuf_patternSeparator fuf.jax /*g:fuf_patternSeparator*
-g:fuf_previewHeight fuf.jax /*g:fuf_previewHeight*
-g:fuf_promptHighlight fuf.jax /*g:fuf_promptHighlight*
-g:fuf_quickfix_prompt fuf.jax /*g:fuf_quickfix_prompt*
-g:fuf_quickfix_switchOrder fuf.jax /*g:fuf_quickfix_switchOrder*
-g:fuf_reuseWindow fuf.jax /*g:fuf_reuseWindow*
-g:fuf_splitPathMatching fuf.jax /*g:fuf_splitPathMatching*
-g:fuf_tag_prompt fuf.jax /*g:fuf_tag_prompt*
-g:fuf_tag_switchOrder fuf.jax /*g:fuf_tag_switchOrder*
-g:fuf_taggedfile_prompt fuf.jax /*g:fuf_taggedfile_prompt*
-g:fuf_taggedfile_switchOrder fuf.jax /*g:fuf_taggedfile_switchOrder*
-g:fuf_timeFormat fuf.jax /*g:fuf_timeFormat*
-g:fuf_useMigemo fuf.jax /*g:fuf_useMigemo*
-l9 l9.jax /*l9*
-l9-about l9.jax /*l9-about*
-l9-author l9.jax /*l9-author*
-l9-contact l9.jax /*l9-contact*
-l9-installation l9.jax /*l9-installation*
-l9-introduction l9.jax /*l9-introduction*
-l9-usage l9.jax /*l9-usage*
-l9.txt l9.jax /*l9.txt*
diff --git a/vim/doc/tcomment.txt b/vim/doc/tcomment.txt
deleted file mode 100644
index c0c0f17..0000000
--- a/vim/doc/tcomment.txt
+++ /dev/null
@@ -1,342 +0,0 @@
-*tcomment.txt* An easily extensible & universal comment plugin
- Author: Thomas Link, micathom AT gmail com?subject=vim
-
-tcomment provides easy to use, file-type sensible comments for Vim. It
-can handle embedded syntax.
-
-TComment works like a toggle, i.e., it will comment out text that
-contains uncommented lines, and it will remove comment markup for
-already commented text (i.e. text that contains no uncommented lines).
-
-If the file-type is properly defined, TComment will figure out which
-comment string to use. Otherwise you use |tcomment#DefineType()| to
-override the default choice.
-
-TComment can properly handle an embedded syntax, e.g., ruby/python/perl
-regions in vim scripts, HTML or JavaScript in php code etc.
-
-Demo:
-http://vimsomnia.blogspot.com/2010/11/tcomment-vim-plugin.html
-
-
- *tcomment-maps*
-Key bindings~
-
-Most of the time the default toggle keys will do what you want (or to be
-more precise: what I think you want it to do ;-).
-
- *g:tcommentMapLeaderOp1*
- *g:tcommentMapLeaderOp2*
-As operator (the prefix can be customized via g:tcommentMapLeaderOp1
-and g:tcommentMapLeaderOp2):
-
- gc{motion} :: Toggle comments (for small comments within one line
- the &filetype_inline style will be used, if
- defined)
- gcc :: Toggle comment for the current line
- gC{motion} :: Comment region
- gCc :: Comment the current line
-
-By default the cursor stays put. If you want the cursor to the end of
-the commented text, set |g:tcommentOpModeExtra| to '>' (but this may not
-work properly with exclusive motions).
-
-Primary key maps:
-
- <c-_><c-_> :: :TComment
- <c-_><space> :: :TComment <QUERY COMMENT-BEGIN ?COMMENT-END>
- <c-_>b :: :TCommentBlock
- <c-_>a :: :TCommentAs <QUERY COMMENT TYPE>
- <c-_>n :: :TCommentAs &filetype <QUERY COUNT>
- <c-_>s :: :TCommentAs &filetype_<QUERY COMMENT SUBTYPE>
- <c-_>i :: :TCommentInline
- <c-_>r :: :TCommentRight
- <c-_>p :: Comment the current inner paragraph
-
-A secondary set of key maps is defined for normal mode.
-
- <Leader>__ :: :TComment
- <Leader>_p :: Comment the current inner paragraph
- <Leader>_<space> :: :TComment <QUERY COMMENT-BEGIN ?COMMENT-END>
- <Leader>_i :: :TCommentInline
- <Leader>_r :: :TCommentRight
- <Leader>_b :: :TCommentBlock
- <Leader>_a :: :TCommentAs <QUERY COMMENT TYPE>
- <Leader>_n :: :TCommentAs &filetype <QUERY COUNT>
- <Leader>_s :: :TCommentAs &filetype_<QUERY COMMENT SUBTYPE>
-
-
------------------------------------------------------------------------
-Install~
-
-Edit the vba file and type: >
-
- :so %
-
-See :help vimball for details. If you have difficulties or use vim 7.0,
-please make sure, you have the current version of vimball (vimscript
-#1502) installed or update your runtime.
-
-
-========================================================================
-Contents~
-
- :TComment ........................... |:TComment|
- :TCommentAs ......................... |:TCommentAs|
- :TCommentRight ...................... |:TCommentRight|
- :TCommentBlock ...................... |:TCommentBlock|
- :TCommentInline ..................... |:TCommentInline|
- :TCommentMaybeInline ................ |:TCommentMaybeInline|
- g:tcommentBlankLines ................ |g:tcommentBlankLines|
- g:tcommentOpModeExtra ............... |g:tcommentOpModeExtra|
- g:tcommentOptions ................... |g:tcommentOptions|
- g:tcommentGuessFileType ............. |g:tcommentGuessFileType|
- g:tcommentGuessFileType_dsl ......... |g:tcommentGuessFileType_dsl|
- g:tcommentGuessFileType_php ......... |g:tcommentGuessFileType_php|
- g:tcommentGuessFileType_html ........ |g:tcommentGuessFileType_html|
- g:tcommentGuessFileType_tskeleton ... |g:tcommentGuessFileType_tskeleton|
- g:tcommentGuessFileType_vim ......... |g:tcommentGuessFileType_vim|
- g:tcommentGuessFileType_django ...... |g:tcommentGuessFileType_django|
- g:tcommentIgnoreTypes_php ........... |g:tcommentIgnoreTypes_php|
- g:tcomment#syntax_substitute ........ |g:tcomment#syntax_substitute|
- g:tcommentSyntaxMap ................. |g:tcommentSyntaxMap|
- g:tcommentBlockC .................... |g:tcommentBlockC|
- g:tcommentBlockC2 ................... |g:tcommentBlockC2|
- g:tcommentInlineC ................... |g:tcommentInlineC|
- g:tcommentBlockXML .................. |g:tcommentBlockXML|
- g:tcommentInlineXML ................. |g:tcommentInlineXML|
- tcomment#DefineType ................. |tcomment#DefineType()|
- tcomment#Comment .................... |tcomment#Comment()|
- tcomment#Operator ................... |tcomment#Operator()|
- tcomment#OperatorLine ............... |tcomment#OperatorLine()|
- tcomment#OperatorAnyway ............. |tcomment#OperatorAnyway()|
- tcomment#OperatorLineAnyway ......... |tcomment#OperatorLineAnyway()|
- tcomment#CommentAs .................. |tcomment#CommentAs()|
-
-
-========================================================================
-plugin/tcomment.vim~
-
- *:TComment*
-:[range]TComment[!] ?ARGS...
- If there is a visual selection that begins and ends in the same line,
- then |:TCommentInline| is used instead.
- The optional range defaults to the current line. With a bang '!',
- always comment the line.
-
- ARGS... are either (see also |tcomment#Comment()|):
- 1. a list of key=value pairs
- 2. 1-2 values for: ?commentBegin, ?commentEnd
-
- *:TCommentAs*
-:[range]TCommentAs[!] commenttype ?ARGS...
- TCommentAs requires g:tcomment_{filetype} to be defined.
- With a bang '!', always comment the line.
-
- ARGS... are either (see also |tcomment#Comment()|):
- 1. a list of key=value pairs
- 2. 1-2 values for: ?commentBegin, ?commentEnd
-
- *:TCommentRight*
-:[range]TCommentRight[!] ?ARGS...
- Comment the text to the right of the cursor. If a visual selection was
- made (be it block-wise or not), all lines are commented out at from
- the current cursor position downwards.
- With a bang '!', always comment the line.
-
- ARGS... are either (see also |tcomment#Comment()|):
- 1. a list of key=value pairs
- 2. 1-2 values for: ?commentBegin, ?commentEnd
-
- *:TCommentBlock*
-:[range]TCommentBlock[!] ?ARGS...
- Comment as "block", e.g. use the {&ft}_block comment style. The
- commented text isn't indented or reformated.
- With a bang '!', always comment the line.
-
- ARGS... are either (see also |tcomment#Comment()|):
- 1. a list of key=value pairs
- 2. 1-2 values for: ?commentBegin, ?commentEnd
-
- *:TCommentInline*
-:[range]TCommentInline[!] ?ARGS...
- Use the {&ft}_inline comment style.
- With a bang '!', always comment the line.
-
- ARGS... are either (see also |tcomment#Comment()|):
- 1. a list of key=value pairs
- 2. 1-2 values for: ?commentBegin, ?commentEnd
-
- *:TCommentMaybeInline*
-:[range]TCommentMaybeInline[!] ?ARGS...
- With a bang '!', always comment the line.
-
- ARGS... are either (see also |tcomment#Comment()|):
- 1. a list of key=value pairs
- 2. 1-2 values for: ?commentBegin, ?commentEnd
-
-
-========================================================================
-autoload/tcomment.vim~
-
- *g:tcommentBlankLines*
-g:tcommentBlankLines (default: 1)
- If true, comment blank lines too
-
- *g:tcommentOpModeExtra*
-g:tcommentOpModeExtra (default: '')
- Modifies how the operator works.
- > ... Move the cursor to the end of the comment
-
- *g:tcommentOptions*
-g:tcommentOptions (default: {})
- Other key-value options used by |tcomment#Comment()|.
-
- Example: If you want to put the opening comment marker always in
- the first column regardless of the block's indentation, put this
- into your |vimrc| file: >
- let g:tcommentOptions = {'col': 1}
-<
-
- *g:tcommentGuessFileType*
-g:tcommentGuessFileType (default: 0)
- Guess the file type based on syntax names always or for some fileformat only
- If non-zero, try to guess filetypes.
- tcomment also checks g:tcommentGuessFileType_{&filetype} for
- filetype specific values.
-
- Values:
- 0 ... don't guess
- 1 ... guess
- FILETYPE ... assume this filetype
-
- *g:tcommentGuessFileType_dsl*
-g:tcommentGuessFileType_dsl (default: 'xml')
- For dsl documents, assumet filetype = xml.
-
- *g:tcommentGuessFileType_php*
-g:tcommentGuessFileType_php (default: 'html')
- In php documents, the php part is usually marked as phpRegion. We
- thus assume that the buffers default comment style isn't php but
- html.
-
- *g:tcommentGuessFileType_html*
-g:tcommentGuessFileType_html (default: 1)
-
- *g:tcommentGuessFileType_tskeleton*
-g:tcommentGuessFileType_tskeleton (default: 1)
-
- *g:tcommentGuessFileType_vim*
-g:tcommentGuessFileType_vim (default: 1)
-
- *g:tcommentGuessFileType_django*
-g:tcommentGuessFileType_django (default: 1)
-
- *g:tcommentIgnoreTypes_php*
-g:tcommentIgnoreTypes_php (default: 'sql')
- In php files, some syntax regions are wongly highlighted as sql
- markup. We thus ignore sql syntax when guessing the filetype in
- php files.
-
- *g:tcomment#syntax_substitute*
-g:tcomment#syntax_substitute (default: {...})
-
- *g:tcommentSyntaxMap*
-g:tcommentSyntaxMap (default: {...})
- tcomment guesses filetypes based on the name of the current syntax
- region. This works well if the syntax names match
- /filetypeSomeName/. Other syntax names have to be explicitly
- mapped onto the corresponding filetype.
-
- *g:tcommentBlockC*
-g:tcommentBlockC (default: {...})
- Generic c-like block comments.
-
- *g:tcommentBlockC2*
-g:tcommentBlockC2 (default: {...})
- Generic c-like block comments (alternative markup).
-
- *g:tcommentInlineC*
-g:tcommentInlineC (default: "/* %s */")
- Generic c-like comments.
-
- *g:tcommentBlockXML*
-g:tcommentBlockXML (default: "<!--%s-->\n ")
- Generic xml-like block comments.
-
- *g:tcommentInlineXML*
-g:tcommentInlineXML (default: "<!-- %s -->")
- Generic xml-like comments.
-
- *tcomment#DefineType()*
-tcomment#DefineType(name, commentdef)
- If you don't explicitly define a comment style, |:TComment| will use
- 'commentstring' instead. We override the default values here in order
- to have a blank after the comment marker. Block comments work only if
- we explicitly define the markup.
-
- The comment definition can be either a string or a dictionary.
-
- If it is a string:
- The format for block comments is similar to 'commentstrings' with the
- exception that the format strings for blocks can contain a second line
- that defines how "middle lines" (see :h format-comments) should be
- displayed.
-
- If it is a dictionary:
- See the help on the args argument of |tcomment#Comment|.
-
- *tcomment#Comment()*
-tcomment#Comment(beg, end, ...)
- tcomment#Comment(line1, line2, ?commentMode, ?commentAnyway, ?args...)
- args... are either:
- 1. a list of key=value pairs where known keys are (see also
- |g:tcommentOptions|):
- as=STRING ... Use a specific comment definition
- col=N ... Start the comment at column N (in block mode; must
- be smaller than |indent()|)
- mode=STRING ... See the notes below on the "commentMode" argument
- begin=STRING ... Comment prefix
- end=STRING ... Comment postfix
- middle=STRING ... Middle line comments in block mode
- rxbeg=N ... Regexp to find the substring of "begin" that
- should be multipied by "count"
- rxend=N ... The above for "end"
- rxmid=N ... The above for "middle"
- 2. 1-2 values for: ?commentPrefix, ?commentPostfix
- 3. a dictionary (internal use only)
-
- commentMode:
- G ... guess the value of commentMode
- B ... block (use extra lines for the comment markers)
- i ... maybe inline, guess
- I ... inline
- R ... right (comment the line right of the cursor)
- v ... visual
- o ... operator
- By default, each line in range will be commented by adding the comment
- prefix and postfix.
-
- *tcomment#Operator()*
-tcomment#Operator(type, ...)
-
- *tcomment#OperatorLine()*
-tcomment#OperatorLine(type)
-
- *tcomment#OperatorAnyway()*
-tcomment#OperatorAnyway(type)
-
- *tcomment#OperatorLineAnyway()*
-tcomment#OperatorLineAnyway(type)
-
- *tcomment#CommentAs()*
-tcomment#CommentAs(beg, end, commentAnyway, filetype, ?args...)
- Where args is either:
- 1. A count NUMBER
- 2. An args list (see the notes on the "args" argument of
- |tcomment#Comment()|)
- comment text as if it were of a specific filetype
-
-
-
-vim:tw=78:fo=tcq2:isk=!-~,^*,^|,^":ts=8:ft=help:norl:
diff --git a/vim/doc/yankring.txt b/vim/doc/yankring.txt
deleted file mode 100644
index 41460f1..0000000
--- a/vim/doc/yankring.txt
+++ /dev/null
@@ -1,1467 +0,0 @@
-*yankring.txt* For Vim version 7.0.
-
-Author: David Fishburn August 29, 2009
-Version: 11.0
-
-For instructions on installing this file, type
- :help add-local-help |add-local-help| inside Vim.
-
-Homepage: http://vim.sourceforge.net/script.php?script_id=1234
-
-
-==============================================================================
-1. Contents *yankring* *yankring-contents*
-
- 1. Contents...............................: |yankring-contents|
- 2. Description............................: |yankring-description|
- 3. Configuration..........................: |yankring-configure|
- 3.1 Global Variables...................: |yankring-globals|
- 3.2 Default Keys.......................: |yankring-mappings|
- 3.3 Customizing Maps...................: |yankring-custom-maps|
- 3.4 Customizing Menus..................: |yankring-custom-menus|
- 4. Using the YankRing Window..............: |yankring-window|
- 5. Commands...............................: |yankring-commands|
- 5.1 YRToggle..........................: |YRToggle|
- 5.2 YRClear...........................: |YRClear|
- 5.3 YRShow............................: |YRShow|
- 5.5 YRGetElem.........................: |YRGetElem|
- 5.6 YRGetMultiple.....................: |YRGetMultiple|
- 5.7 YRPush............................: |YRPush|
- 5.8 YRPop.............................: |YRPop|
- 5.9 YRYankCount.......................: |YRYankCount|
- 5.10 YRYankRange.......................: |YRYankRange|
- 5.11 YRDeleteRange.....................: |YRDeleteRange|
- 5.12 YRPaste...........................: |YRPaste|
- 5.13 YRReplace.........................: |YRReplace|
- 5.14 YRMapsCreate......................: |YRMapsCreate|
- 5.15 YRMapsDelete......................: |YRMapsDelete|
- 5.16 YRSearch..........................: |YRSearch|
- 5.17 YRRunAfterMaps....................: |yankring-custom-maps|
- 6. Tutorial...............................: |yankring-tutorial|
- 6.1 YRShow............................: |YRShow-example|
- 6.2 YRReplace.........................: |YRReplace-example|
- 6.3 YRPush............................: |YRPush-example|
- 6.4 YRClear...........................: |YRClear-example|
- 6.8 YRPop.............................: |YRPop-example|
- 6.9 Visual modes......................: |yankring-visual-example|
- 6.10 Using ranges......................: |YRYankRange-example|
- 6.11 :global...........................: |global-example|
- 6.12 YRSearch..........................: |YRSearch-example|
- 7. History................................: |yankring-history|
-
-
-==============================================================================
-2. Description *yankring-description*
-
-Vim already maintains a list of numbered registers containing the last 9
-deletes. These previous deletes can be referenced using [register]p, so
-"1p will paste the last delete, "2p the 2nd last delete. For more
-information see |quote_number|.
-
-Vim does not provide any mechanism to reference previously yanked text.
-In Emacs this feature is called the "kill ring".
-
-The YankRing plugin allows the user to configure the number of yanked
-and deleted text. After text has been pasted, it can be replaced with
-a previous value from the yankring.
-
-As of version 3.0, the yankring's content will persist (by default)
-between starting and stopping Vim.
-
-The plugin can be toggled on and off, and supports:
- Ranges
- Registers
- Counts
- All visual modes
- All motions
- All text-objects
-
-If you have any suggestions for the improvement of this plugin, see the
-yankring.vim file for my email address. Suggestions / bug reports are
-always welcome.
-
-For details on the changes between versions see |yankring-history|.
-
-
-==============================================================================
-3. Configuration *yankring-configure*
-
-The YankRing allows the user to choose which keys are to be assigned to
-the various commands. By default, the YankRing chose keys identical
-with Vim's standard behaviour/keys.
-
-3.1 Global Variables *yankring-globals*
-
-You can customize the YankRing by setting various global variables in
-your |.vimrc|.
->
- yankring_max_history
-< Default: 100
- Controls how many elements to save in the yankring. >
- let g:yankring_max_history = 100
- yankring_min_element_length
-< Default: 1
- If the yanked element has a length less than this value
- if will not be added to the YankRing. This can be useful if
- you want to bypass single letter deletes by adding the
- following to your .vimrc: >
- let g:yankring_min_element_length = 2
- yankring_max_element_length
-< Default: 1048576 (1M)
- Will truncate a new entry to the specified maximum. If
- g:yankring_max_element_length is set to 0, there is no limit. >
- let g:yankring_max_element_length = 4194304 " 4M
- yankring_max_display
-< Default: 500
- When the YankRing window is opened, each element is displayed on a
- separate line. Since each yank could be very large, the display of
- the element is limited to the above default. >
- let g:yankring_max_display = 70
- yankring_enabled
-< Default: 1
- If you do not want to YankRing enabled by default, set this
- variable in your |vimrc|. >
- let g:yankring_enabled = 0 " Disables the yankring
- yankring_persist
-< Default: 1
- If you have enabled the storing of global variables in the |viminfo|
- file, the YankRing will be default persist the contents of the ring
- between starting and stopping Vim. To disable this feature: >
- let g:yankring_persist = 0
- yankring_share_between_instances
-< Default: 1
- By default, any instance of Vim will share the same yankring
- history file. But if want each instance to have their own history
- you can set this option to 0. Setting g:yankring_persist = 0 and
- g:yankring_share_between_instances = 0 will ensure no 2 instances
- of Vim share the same YankRing history AND the history is not
- remembered the next time Vim is started. >
- let g:yankring_share_between_instances = 0
- yankring_dot_repeat_yank
-< Default: Based on the Vim cpoption setting
- By default Vim will not repeat (using '.') yanking of text. This can
- be controlled via the |'cpoptions'| setting. The YankRing now respects
- the cpoptions setting, if 'y' is included and you press '.', the
- previous yank command is repeated and added to the yankring.
- You can also add this behaviour by setting this in your |vimrc|: >
- let g:yankring_dot_repeat_yank = 1
- yankring_ignore_duplicate
-< Default: 1
- Duplicates will not be added to the YankRing by default. If a
- duplicate is found, that element will be moved to the top of the
- yankring. This can be controlled by setting this in your |vimrc|: >
- let g:yankring_ignore_duplicate = 0
- yankring_map_dot
-< Default: 1
- If the '.' (repeat) command should be mapped by the yankring. Since
- most of the normal commands yy,dd,dw,... are mapped by the yankring,
- if g:yankring_map_dot is false the . operator will not repeat these
- operations. The YankRing tracks several of the internal Vim registers
- and decides whether an action was the result of the YankRing or an
- action outside of it. If the previous action was a result of the
- yankring, it will be executed again. If it was an action outside of
- the yankring, it asks Vim to repeat the command. >
- let g:yankring_map_dot = 1
- yankring_paste_using_g
-< Default: 1
- By default [p] and [P] are mapped to interact with the yankring. This
- option controls whether [gp] and [gP] are also mapped. Setting this
- option to 0 will not create these maps. >
- let g:yankring_paste_using_g = 1
- yankring_window_use_separate
-< Default: 1
- This is a new feature as of the 2.0 release. The YankRing now uses a
- separate split buffer to display the yankring. There are many buffer
- specific maps that allow you to operate over the various elements from
- within the yankring. Setting this option to 0, uses the 1.0
- interface. >
- let g:yankring_window_use_separate = 0
- yankring_window_auto_close
-< Default: 1
- By default once you choose an option in the YankRing buffer, the
- action is performed and the buffer window is closed, returning you to
- the original buffer. This option can be toggled from within the
- YankRing buffer by pressing [a]. The YankRing buffer status line
- visually indicates where auto close is enabled or disabled. There are
- many times where you need to paste (or delete) many items from the
- yankring. Pressing [a], disables auto close, allows you to paste many
- items, and finally you can press [a] to re-enable auto close, followed
- by [q] to quit the buffer window. >
- let g:yankring_window_auto_close = 1
- yankring_window_use_horiz
-< Default: 1
- When the YankRing window is opened, it uses a horizontal split at the
- bottom of the Vim window. It can optionally use a vertical split by
- setting this option to 0. >
- let g:yankring_window_use_horiz = 0 " Use vertical split
- yankring_window_height
-< Default: 1
- If using a horizontal split, this option controls how high to make
- the window. >
- let g:yankring_window_height = 8
- yankring_window_width
-< Default: 1
- If using a vertical split, this option controls how wide to make the
- window. >
- let g:yankring_window_width = 30
- yankring_window_use_bottom
-< Default: 1
- If using a horizontal split, this option control whether the window is
- opened at the top or bottom of the Vim window. Setting this option to
- 0 forces the window to open at the top of the Vim window. >
- let g:yankring_window_use_bottom = 1
- yankring_window_use_right
-< Default: 1
- If using a vertical split, this option control whether the window is
- opened on the left or right side of the Vim window. To force the
- window to open on the left side, set this option to 0. >
- let g:yankring_window_use_right = 1
- yankring_window_increment
-< Default: 1
- If using a vertical split the default width of the vertical window may
- be too narrow to view enough of the elements. Pressing [<space>] will
- increase the size of the window by this number of columns. Pressing
- [<space>] again will toggle it back to the original size. >
- let g:yankring_window_increment = 50
- yankring_manage_numbered_reg
-< Default: 0
- Vim already maintains a list of numbered registers containing the last
- yanked item and the previous 9 deletes. These items can be referenced
- using [register]p, so "0p will paste the last yank, "1p will paste the
- last delete, "2p the 2nd last delete. For more information see
- |quote_number|.
- If you wish the YankRing to maintain these numbered registers so
- the top 10 elements in the YankRing are in the numbered reqisters 0-9
- you can put the following in your |vimrc| >
- let g:yankring_manage_numbered_reg = 1
- yankring_ignore_operator
-< Default: 'g~ gu gU ! = gq g? > < zf g@'
- There are a number of Vim operations which do not change any
- registers, and therefore should not be captured by the yankring.
- This list is used to ignore the appropriate operators.
- You can put the following in your |vimrc| >
- let g:yankring_ignore_operator = 'g~ gu gU ! = gq g? > < zf g@'
- yankring_history_dir
-< Default: $HOME
- The YankRing stores the text in a file. This global variable
- allows you to customize where the file(s) will be stored.
- You can put the following in your |vimrc| >
- let g:yankring_history_dir = '$VIM'
- yankring_history_file
-< Default: 'yankring_history'
- The history filename prefix can be controlled by setting this
- variable.
- You can put the following in your |vimrc| >
- let g:yankring_history_file = 'my_yankring_history_file'
- yankring_clipboard_monitor
-< Default: 1
- When flipping between applications I find I often copy text
- and attempt to use it inside of Vim. This is typically easy
- by simply using "+p, but there are times when I will repeatedly
- want to use the same text later on. By default, the YankRing
- will detect when Vim regains focus and check if the clipboard
- has changed since it last checked. If so, it will add the contents
- of the clipboard to the YankRing. To disable this feature
- you can put the following in your |vimrc| >
- let g:yankring_clipboard_monitor = 0
- yankring_paste_check_default_buffer
-< Default: 1
- If the default register has changed without the YankRing registering
- the change the YankRing will paste the top item from the history
- rather than what is currently in the default register.
- This option allows you to control the behaviour. Plugins can
- intentionally change the default buffer which the YankRing has
- no way to noticing. To disable this feature you can put the following
- in your |vimrc| >
- let g:yankring_paste_check_default_buffer = 0
- yankring_default_menu_mode
-< - Menus are useful for a number of reasons:
- See a list of available commands.
- Remember what the shortcut maps are.
- Have a floating menu when using the plugin a lot.
- Quick reference guide.
- There are four settings that will control the placement
- of the menu:
- "0": Turns the menu off.
- "1": Turns the 'Yankring' menu on with no menu shortcut.
- "2": Turns the 'Yankring 'menu on with <alt>-y as the shortcut.
- "3": Turns the 'Plugin -> YankRing' menu on with <alt>-y as
- the shortcut.
- This option defaults to a value of 3 and can be changed
- by adding the following to your vimrc: >
- :let g:yankring_default_menu_mode = 3
- yankring_menu_root
-< - Can be used in conjuction with g:yankring_default_menu_mode = 3 but
- it also allows you to control the fullname and location of the
- YankRing menu. To create the menu: 'MyPlugins -> YankRing' you
- can create the following variable: >
- :let g:yankring_menu_root = 'MyPlugin.&YankRing'
- yankring_menu_priority
-< - Menus are created in a documented order by Vim (|menu-priority|).
- This option allows you to override the setting and shift the
- YankRing menu item to the left between the Edit and Tools menu. >
- :let g:yankring_menu_priority = 30
-
-<
-3.2 Default Keys *yankring-mappings*
-
-You can choose to override the default keys by creating these global
-variables in your |vimrc|.
->
- yankring_n_keys
-< n - normal mode
- Default Vim 7.2:
- 'Y D x X'
- Default Vim 7.1 and below:
- 'x yy dd yw dw ye de yE dE yiw diw yaw daw y$ d$ Y D yG dG ygg dgg'
-
- With the introduction of some new features in Vim 7.2 it is no longer
- necessary to list all cmds which the YankRing will act upon.
- The yankring_n_keys only lists actions which an omap cannot be used.
- Using the yankring_separator, the above list is parsed and
- individual mappings are created. For each of the above normal
- commands the YankRing will include the text those commands
- acted upon. There are many ways to accomplish the same result
- in Vim, if you do not see a common key stroke you regularly use
- simply add the following to your |vimrc| with the additional
- keys you wished mapped. >
- let g:yankring_n_keys = 'Y D x X'
- yankring_o_keys
-< o - omap mode
- Default:
- Standard motions: 'b B w W e E d y $ G ;'
- Vim text objects: ' iw iW aw aW as is ap ip a] a[ i] i['
- 'a) a( ab i) i( ib a> a< i> i< at it '
- 'a} a{ aB i} i{ iB a" a'' a` i" i'' i`'
-
- As of Vim 7.2 omaps are used to capture changes to the registers
- in Vim. All of the standard motion commands are captured.
- New to YankRing 5.0 all default Vim text objects are also
- captured.
- Using the yankring_separator, the above list is parsed and
- individual mappings are created. For each of the above normal
- commands the YankRing will include the text those commands
- acted upon. There are many ways to accomplish the same result
- in Vim, if you do not see a common key stroke you regularly use
- simply add the following to your |vimrc| with the additional
- keys you wished mapped. >
- let g:yankring_o_keys = 'b B w W e E d y $ G ; iw iW aw aW'
- yankring_zap_keys
-< Default: 'f F t T / ?'
- omaps are enough for most operations except for f and t.
- These motions prompt the user for a character or string which
- they should act upon. These must be treated as a special case
- in YankRing. >
- let g:yankring_zap_keys = 'f t'
- yankring_ignore_operator
-< Default: 'g~ gu gU ! = gq g? > < zf g@'
- There are certain motions which do not update any registers
- in Vim. If the registers are not changed, there is nothing
- the YankRing can capture. This list instructs the YankRing
- to ignore any action for these keys. >
- let g:yankring_ignore_operator = 'g~ gu gU'
- yankring_v_key
-< v - visual mode
- Default: y
- Yanks visually select text. >
- yankring_del_v_key
-< n - normal mode
- Default: d
- The visually select text is included in the YankRing and deleted. >
- yankring_paste_n_bkey
-< n - normal mode
- b - before
- Default: P
- The default Vim paste key will retrieve from the yankring. This
- will paste the text BEFORE the current position.
- There is a special check to see if the text in the default paste
- register is the same as what is in the current position of the
- yankring. If it is not, we assume the user used some other
- mechanism to yank text (ie yt<character>). If this is the case
- we paste the text in the default paste buffer. Using <C-P> the
- text can be replaced with the current entry from the yankring.
- Since there are many ways to do things in Vim, this provides
- the best integration. >
- yankring_paste_n_akey
-< n - normal mode
- a - after
- Default: p
- The default Vim paste key will retrieve from the yankring. This
- will paste the text AFTER the current position.
- There is a special check to see if the text in the default paste
- register is the same as what is in the current position of the
- yankring. If it is not, we assume the user used some other
- mechanism to yank text (ie yt<character>). If this is the case
- we paste the text in the default paste buffer. Using <C-P> the
- text can be replaced with the current entry from the yankring.
- Since there are many ways to do things in Vim, this provides
- the best integration. >
- yankring_paste_v_key
-< n - normal mode
- Default: p
- This will replace the visually select text with the contents
- from the yankring. See yankring_paste_n_akey for additional
- details. >
- yankring_replace_n_pkey
-< n - normal mode
- Default: <C-P>
- If you do not want to open the YankRing window to choose your
- selection, then you can paste (as usual) then use a YankRing
- mapping to cycle through items in the YankRing. This is especially
- useful if you know you recently used the text you are looking for.
- If you wish to cycle through the yankring, replacing the previously
- pasted text with the previous yanked text you can repeatedly press
- <C-P> (or whatever keystroke you choose to map it to). This map
- moves backwards through the yankring, so you will retrieve your
- most recent yank.
-
- I prefer not to use <C-P> since I like using that key to cycle
- through all the matches in the QuickFix window. You can add
- something similar to this in your |.vimrc| to get similar
- functionality.
-
- On Windows use the ALT-< character to move through the YankRing.
- To determine what character # these are go into insert mode
- in a new buffer. Press CTRL-V then ALT and the < key.
- Leave insert mode, move the cursor onto the character
- and press ga. This will display the decimal, hex and octal
- representation of the character. In this case it is 172. >
- if has('win32')
- let g:yankring_replace_n_pkey = '<Char-172>'
- let g:yankring_replace_n_nkey = '<Char-174>'
- " Instead map these keys to moving through items in the quickfix window.
- nnoremap <C-P> :cp<cr>
- nnoremap <C-N> :cn<cr>
- endif
-< Other users have also stated that this will work: >
- let g:yankring_replace_n_pkey = '<m-p>'
- let g:yankring_replace_n_nkey = '<m-n>'
- yankring_replace_n_nkey
-< n - normal mode
- Default: <C-N>
- If you do not want to open the YankRing window to choose your
- selection, then you can paste (as usual) then use a YankRing
- mapping to cycle through items in the YankRing. This is especially
- useful if you know you recently used the text you are looking for.
- If you wish to cycle through the yankring, replacing the previously
- pasted text with the next yanked text you can repeatedly press
- <C-N> (or whatever keystroke you choose to map it to). This map
- moves forwards through the YankRing, so you will retrieve your
- most recent yank.
-
- I prefer not to use <C-N> since I like using that key to cycle
- through all the matches in the QuickFix window. You can add
- something similar to this in your |.vimrc| to get similar
- functionality.
-
- On Windows use the ALT-> character to move through the YankRing.
- To determine what character # these are go into insert mode
- in a new buffer. Press CTRL-V then ALT and the > key.
- Leave insert mode, move the cursor onto the character
- and press ga. This will display the decimal, hex and octal
- representation of the character. In this case it is 174. >
- if has('win32')
- let g:yankring_replace_n_pkey = '<Char-172>'
- let g:yankring_replace_n_nkey = '<Char-174>'
- " Instead map these keys to moving through items in the quickfix window.
- nnoremap <C-P> :cp<cr>
- nnoremap <C-N> :cn<cr>
- endif
-< Other users have also stated that this will work: >
- let g:yankring_replace_n_pkey = '<m-p>'
- let g:yankring_replace_n_nkey = '<m-n>'
-
-3.3 Customizing Maps *yankring-custom-maps*
-
-The YankRing plugin uses the yankring_n_keys global variable to create
-a number of defaults maps. The maps are of the form: >
- nnoremap Y :<C-U>YRYankCount 'Y'<CR>
-<
-When capital Y is pressed, the YankRing will execute 'Y' and capture the
-output from Vim. But there are cases where you do not want the default
-behaviour of Vim, since you have customized some of these maps.
-
-In this case, I usually map Y to be |y$|, which makes it consistent with
-the |D| and |C| operators. The way yankring_n_keys works does not allow
-me to customize this behaviour. Since many people may like to customize
-the behaviour of these maps the YankRing will check to see if a
-function called YRRunAfterMaps() exists. If it does, it will call
-this function after it has created the maps. So in my case, I created
-the following function in my |vimrc|: >
- function! YRRunAfterMaps()
- nnoremap Y :<C-U>YRYankCount 'y$'<CR>
- endfunction
-<
-You can do anything you need in this function. >
- nnoremap Y :<C-U>YRYankCount 'y$'<CR>
-<
-This line remaps Y (which the user presses) to the YRYankCount command. The
-YRYankCount tells Vim to execute y$ instead.
-
-3.4 Customizing Menus *yankring-custom-menus*
-
-There are several global variables which can be created in your vimrc to
-allow you to customize where and what is displayed for the YankRing menu.
-Simply look up the following global variables: >
- yankring_default_menu_mode
- yankring_menu_root
- yankring_menu_priority
-
-
-==============================================================================
-4. Using the YankRing Window: *yankring-window*
-
-This is a new feature as of the 2.0 release. The YankRing uses a
-separate split buffer to display the yankring. There are many buffer
-specific maps that allow you to operate over the various elements from
-within the yankring.
-
-To display the YankRing buffer you can issue the :YRShow command. For
-convience you can map a key, <F11>, to this command: >
- :nnoremap <silent> <F11> :YRShow<CR>
-
-Status line~
-The first line in the YankRing window is the status line. >
- AutoClose=1;ClipboardMonitor=1;Cmds:p,P,d,r,s,a,c,u,q,<enter>,<space>;Help=?
-<
-Help=?, pressing [?] will toggle the display of available commands the
-yankring window supports. Pressing [?] again will remove the additional
-items.
-
-AutoClose=1 indicates the window will close when an action is performed
-against elements within the yankring. If you wish to perform multiple
-yankring operations press [a] to toggle the auto close feature off. Use the
-commands below and when finished you can press [a] to toggle auto close on and
-press [q] to close the window. The Cmds displayed are simply reminders of
-the available keys.
-
-ClipboardMonitor=1 indicates the YankRing will monitor the clipboard (+)
-during Focus change events. If the clipboard has changed since the YankRing
-last checked, the contents are added to the YankRing. Pressing [c] allows
-you to quickly toggle this setting since it may not be useful at times.
-
-YankRing window key list~
-The following table lists the description of the keys that can be used
-in the YankRing window.
-
- Key Description~
- p Puts text after the cursor. In visual mode, all elements
- selected will be pasted.
- P Puts text before the cursor. In visual mode, all elements
- selected will be pasted.
- gp Just like "p", but leave the cursor just after the new text.
- gP Just like "P", but leave the cursor just after the new text.
- <CR> Just like "p".
- <Enter> Just like "p".
- <2-LeftMouse> Just like "p". Normal mode only.
- d Removes the element from the yankring. In visual mode all
- elements selected will be removed.
- r Just like "p", but in visual mode if many lines are selected
- it will paste these in reverse order.
- s Prompts you for a regex to search the YankRing and display
- only matching items.
- a Toggles the g:yankring_window_auto_close setting.
- u Updates the YankRing window.
- q Closes the YankRing window.
- <Space> Toggles the width of the vertical window by the
- g:yankring_window_increment setting.
- ? Toggles the display of the help.
-
-
-==============================================================================
-5. Commands: *yankring-commands*
-
-The predefined mappings call some specific commands with special parameters.
-If you are going to create additional maps, it is important you mirror
-the same parameters. Most of these commands have been made obsolete by
-the YankRing window, since it incorporates the functionality below, but
-through maps against a buffer, instead of commands. This makes it much easier
-to use.
-
-
-5.1 YRToggle *YRToggle*
- Allows you to enable and disable the YankRing quickly. This
- command will remove the default maps and recreate them.
-
- Examples: >
- :YRToggle " Toggles it
- :YRToggle 1 " Enables it
- :YRToggle 0 " Disables it
-<
-
-5.2 YRClear *YRClear*
- Clears all elements from the yankring.
- See also |YRClear-example|.
-
-
-5.3 YRShow *YRShow*
- Similar to |:register|, will display all the entries in the yankring.
- The element at the top will be the next element pasted from the
- yankring.
-
- Examples: >
- :YRShow " Shows all entries in the yankring
-
- --- YankRing ---
- Elem Content
- 1 five^@
- 2 four^@
- 3 three^@
- 4 two^@
- 5 one^@
-<
-
-5.5 YRGetElem *YRGetElem*
- This command has two modes. If no parameters are provided, it
- becomes interactive. It uses YRShow to display the list and
- allows you to choose which element to paste. If a parameter
- is supplied it will paste that element from the yankring. If the
- number specified is outside of the YankRing an error is returned.
- You may want to create a separate mapping for this call. >
- nnoremap <silent> <Leader>yr :YRGetElem<CR>
-< See also |YRSearch|.
-
- Examples:
- Assume there are 10 elements in the YankRing and element 6 is
- at the top of the ring. >
- :YRGetElem " Interactive mode, you choose from a list
- :YRGetElem 4 " Will paste element 5.
- :YRGetElem 12 " Will paste element 6.
- :YRGetElem 99 " Error, invalid choice is reported
- :YRGetElem 0 " Error, invalid choice is reported
-
-
-5.6 YRGetMultiple *YRGetMultiple*
- Will paste many elements from the YankRing in one command.
- If the number specified is 1 or less, it is assumed you want
- just the current element pasted. If the number specified is
- greater than or equal to the number of elements in the yankring,
- it is assumed you want all elements pasted. If a ! is included
- as part of the command, paste the items in reverse order.
- See the |yankring-tutorial| for more examples.
-
- Examples:
- Assume there are 10 elements in the YankRing. >
- :YRGetMultiple 4 " Will paste elements 1,2,3,4
- :YRGetMultiple! 4 " Will paste elements 4,3,2,1
- :YRGetMultiple " Will paste element 1
- :YRGetMultiple 12 " Will paste elements 1,2,...,10
- :YRGetMultiple 99 " Will paste elements 1,2,...,10
- :YRGetMultiple 0 " Will paste element 1
-
-
-5.7 YRPush *YRPush*
- Allows the user to "push" additional entries into the yankring.
- If you yanked text via a key mapping which does not use the
- YankRing (or there is text on the clipboard) you can use this
- command to add the text to the yankring.
-
- Examples: >
- :YRPush " Push the " register's contents
- :YRPush '*' " Push the "* register's contents (clipboard)
- :YRPush '+' " Push the "+ register's contents (clipboard)
- :YRPush 'a' " Push the "a register's contents
-< See also |YRPush-example|.
-
-
-5.8 YRPop *YRPop*
- Allows you to pop any elements from the yankring. If no parameters
- are provided, the 1st element is removed from the yankring. The
- command optionally takes a second parameter to specify how many
- elements to pop. The default value is 1.
-
- Examples: >
- :YRPop " Removes the highest numbered element from the
- yankring
- :YRPop 3 " Removes the 3rd element from the yankring
- :YRPop 3,5 " Removes 5 elements from the YankRing beginning
- at element 3
-< See also |YRPop-example|.
-
-
-5.9 YRYankCount *YRYankCount*
- This command has the most mappings created for it. If you are
- in normal mode and you are not specifying a range, this command
- will add the text to the yankring.
-
- The goal of this command is to allow the YankRing to be integrated
- as seamlessly as possible with Vim. So it supports counts and
- registers. If you create a mapping to it, you must pass as a
- parameter the action you want Vim to perform. You could do the
- following: >
- nnoremap \test :<C-U>YRYankCount 'dd'<CR>
-< This map is executed when you hit the '\test' keystrokes, but
- it will actually delete the current line and add it to the
- yankring.
-
- The following are the default mappings: >
- nnoremap yy :<C-U>YRYankCount 'yy'<CR>
- nnoremap dd :<C-U>YRYankCount 'dd'<CR>
- nnoremap yw :<C-U>YRYankCount 'yw'<CR>
- nnoremap dw :<C-U>YRYankCount 'dw'<CR>
- nnoremap ye :<C-U>YRYankCount 'ye'<CR>
- nnoremap de :<C-U>YRYankCount 'de'<CR>
- nnoremap yiw :<C-U>YRYankCount 'yiw'<CR>
- nnoremap diw :<C-U>YRYankCount 'diw'<CR>
- nnoremap Y :<C-U>YRYankCount 'Y'<CR>
- nnoremap D :<C-U>YRYankCount 'D'<CR>
- nnoremap y$ :<C-U>YRYankCount 'y$'<CR>
- nnoremap d$ :<C-U>YRYankCount 'd$'<CR>
- nnoremap yG :<C-U>YRYankCount 'yG'<CR>
- nnoremap dG :<C-U>YRYankCount 'dG'<CR>
-<
- Examples:
- yy - Adds the current line to the yankring.
- dd - Adds the current line to the YankRing and deletes it.
- 5yw - Adds 5 words to the yankring.
- "ade - Deletes the word, and puts it into both the yankring
- and the "a register.
- 10"zyy - Places 10 lines into both the YankRing and the "z
- register.
- See also |yankring-tutorial|.
-
-
-5.10 YRYankRange *YRYankRange*
- This command by default is only called in visual mode. All
- visual modes (|characterwise-visual|, |linewise-visual|,
- |blockwise-visual|) are supported. Any visually selected text
- is added to the yankring. You can also call this command
- directly using a range.
-
- Examples:
- Visual mode
- -----------
- Press v (to enter visual mode), highlight want you want,
- press y (to yank the selected area).
- Repeat using V and Control-V.
-
- Normal mode
- ----------- >
- :5,20YRYankRange " Will yank lines 5-20 into the yankring
- :5,20YRDeleteRange " Will delete lines 5-20 and add them to
- the yankring
-< See also |YRYankRange-example|.
-
-
-5.11 YRDeleteRange *YRDeleteRange*
- This command is identical to YRYankRange, except the range is
- also deleted.
-
-
-5.12 YRPaste *YRPaste*
- This command will paste elements from the yankring. By default it has
- been mapped to p and P to match Vim's native key strokes. The text
- pasted is exactly what was yanked, including newline characters and
- blockwise-visual mode behaviours. It supports counts and registers.
-
- Examples:
- p " Paste the current element from the YankRing after the cursor
- P " Paste the current element from the YankRing before the cursor
- 5p " Paste the current element from the YankRing after the cursor
- 5 times
- "ap " Ignore the YankRing and paste the contents of register "a
- 5"ap " Ignore the YankRing and paste the contents of register "a
- 5 times
- See also |yankring-tutorial|.
-
-
-5.13 YRReplace *YRReplace*
- The purpose of the YankRing is to gain access to previously yanked
- (or deleted) elements. This command will replace the previously
- paste with a different entry from the yankring.
- By default, I choose <C-P> (P for previous) to replace the last paste
- while moving backwards through the yankring. <C-N> (N for next)
- replaces the last paste while moving forward through the yankring.
-
- Examples:
- See the |yankring-tutorial| for examples.
-
-
-5.14 YRMapsCreate *YRMapsCreate*
- This public function is responsible for creating the maps which
- enable the yankring. This function is called by the YRToggle
- command.
-
-
-5.15 YRMapsDelete *YRMapsDelete*
- This public function removes the YankRing maps and disables
- the yankring. This function is called by the YRToggle command.
-
-
-5.16 YRSearch *YRSearch*
- This command is similar to |YRGetElem|. The command takes
- one parameter which is a regular expression. Similar to
- YRGetElem, it will display all items in the YankRing that match
- the regular expression. It is also interactive, and will
- prompt you to enter which match you wish pasted.
- See also |YRSearch-example|.
-
-
-==============================================================================
-6. Tutorial *yankring-tutorial*
-
-To understand how to use the yankring, the following example will
-demonstrate the various features. Assume you have created the following
-mapping: >
- nnoremap <silent> <F11> :YRShow<CR>
-<
- Assume we have this buffer: >
- one
- two
- three
- four
- five
-< *YRShow-example*
- Now yank (yy) each line separately starting at line 1.
- Display the contents of the YankRing by executing the command
- YRShow, or pressing <F11>. The contents of the YankRing is
- displayed in a new buffer. The size, location and type of buffer
- is configurable via various options. See section 3 for more details. >
- :YRShow or F11
- --- YankRing ---
- Elem Content
- 1 five^@
- 2 four^@
- 3 three^@
- 4 two^@
- 5 one^@
-< Since we yanked the text starting at line 1 and finishing at
- line 5, the most current YankRing element is the last one, the
- contents of line 5. "five^@" is displayed, the "^@" is a
- newline character (since we issued a "yy").
-
- *yankring-window-example*
- At this point, you have two options. You can choose which element
- from the YankRing you wish to paste and press <CR> or 'p' or 'P'
- and a variety of other options, see |yankring-window|. After pressing
- the key, the YankRing window will close (default behaviour). Pressing
- '?' will display additional help for the commands that are active within
- the YankRing window. Pressing '?' will toggle the help.
-
- You do not need to interact with the YankRing using the YankRing window.
- Using the window makes many tasks must easier, but for speed using some
- of the other maps can be preferrable if you know what you have yanked /
- deleted recently. It was designed to work with Vim in the usual manner.
- You can press, 'p', to paste the last item in yanked or deleted.
-
- Close the YankRing window by pressing 'q' or F11 (which toggles it).
-
- *YRReplace-example*
- Now, go to the end of the file and press 'p'. The resulting
- buffer appears as: >
- one
- two
- three
- four
- five
- five
-<
- Assume you did not want 'five", but a different entry from within the
- yankring. <C-P> moves backwards through the yankring, it will replace
- the previous pasted text with a different item from the yankring. This
- allows you to quickly iterate through different elements. <C-P> is the
- default mapping, this can be user defined. See the following options for
- more details: >
- yankring_replace_n_nkey, yankring_replace_n_pkey
-<
- After pressing <C-P> the buffer results in: >
- one
- two
- three
- four
- five
- four
-< Now press 2<C-P>. This would be the same as pressing
- <C-P> two times in a row. This results in: >
- one
- two
- three
- four
- five
- two
-< Now press <C-N> to move forwards through the yankring,
- this results in: >
- one
- two
- three
- four
- five
- three
-< Display the contents of the yankring. >
- :YRShow
- --- YankRing ---
- Elem Content
- 1 five^@
- 2 four^@
- 3 three^@
- 4 two^@
- 5 one^@
-<
- Now lets yank some text with a key stroke that has not been
- mapped to the yankring. Place your cursor at the start of
- line 4. Press 'ytr', yank-to-(to the character r), which yanks
- the 'fou' letters (no newline character). Now press p. Here is
- the result: >
- one
- two
- three
- ffouour
- five
- three
-< This is good, even though the keys 'ytr' has not been mapped
- to YRYankCount, the YankRing still pasted the most recently
- yanked text. Since the text did not have a newline character
- the 'fou' was inserted after the 'f'.
-
- Now replace that previous paste with the current element from
- the YankRing by pressing <C-N>. This is the result: >
- one
- two
- three
- four
- one
- five
- three
-< The #1 entry in the YankRing is still the line "five@". When
- choosing the next entry, it wraps around to the last entry in
- the yankring, element #5. The 'fou' was replaced with 'one^@'.
- Since it had a newline character in it (when it was yanked) the
- newline is included when it is pasted.
-
- *YRPush-example*
- Assume you need to paste text from the system clipboard, and this
- is text you will need routinely. We can simulate this by running
- this command (see |quote+|): >
- :let @+ = "From the clipboard\n"
- :echo @+
-
-< With the cursor at the start of the line with the word 'five', press 'p'.
- We still have pasted the 'fou' which is in the default paste buffer. >
- one
- two
- three
- four
- two
- ffouive
- three
-< We have the option of getting the text from the clipboard directly
- with the following. >
- First undo the previous change - u
- Next - "+p
-< The line changes since we bypassed the yankring, and specified
- which register to get the text from: >
- four
- five
- From the clipboard
- three
-< <C-P> replaces this with the #1 entry in the yankring: >
- four
- five
- five
- three
-< Now add the contents of the clipboard to the yankring: >
- :YRPush '+'
-< Move the cursor to the last row 'three' and press 'p'. The result is: >
- four
- five
- one
- three
- From the clipboard
-< YRPush '+' adds the value of the register '+' to the yankring, but it
- also adds its contents to the default Vim paste buffer. So pressing
- 'p' pasted this text. Adding a new value to the YankRing we have
- repositioned it which you can see with: >
- :YRShow or F11
- --- YankRing ---
- Elem Content
- 1 From the clipboard^@
- 2 five^@
- 3 four^@
- 4 three^@
- 5 two^@
- 6 one^@
-< *YRClear-example*
- Now we will clear the yankring, and begin over again. Delete all lines
- from the buffer and replace them with the original rows: >
- one
- two
- three
- four
- five
-< Now run this command to clear the YankRing to start over: >
- :YRClear
-<
- Issue a 'yy' on each of the 5 lines. If you run the YRShow command you
- should see the following: >
- :YRShow or F11
- --- YankRing ---
- Elem Content
- 1 five^@
- 2 four^@
- 3 three^@
- 4 two^@
- 5 one^@
-< *any-item-example*
- If you need to quickly browse the YankRing to determine which element you
- wish to paste you can simply press 'p' or <CR> or <Enter> on any element
- displayed in the YankRing window. Press '?' for more detailed description
- of the commands available.
-
- Using the YankRing window can be much faster if you do not want to cycle
- through the YankRing using <C-P> and <C-N> to find the element.
-
- *multiple-items-example*
- There are times when you need to move through a buffer capturing many
- different lines (or snippets of code) and eventually want to switch
- buffers and paste these elements. With some advance planning you can do
- this without the YankRing by issuing commands of the form: >
- "ayy
- "Ayy
-< When specifying the register using UPPERCASE, Vim appends the yanked text
- to register "a, instead of replacing it. Many times you forget the
- advance planning (or didn't even know about this great feature) you can
- use the YankRing window to do this easily. If this is the current
- yankring: >
- :YRShow or F11
- --- YankRing ---
- Elem Content
- 1 five^@
- 2 four^@
- 3 three^@
- 4 two^@
- 5 one^@
-< The YankRing works in |visual-mode|. To demonstrate move the cursor in
- the buffer to the line with 'two'. Press 'F11' to display the yankring
- window. Move the cursor to element 2, press 'V' to enable
- |linewise-visual| mode and then press 'j' twice. This should have
- visually highlighted elements 2,3,4. Press 'p' to paste all the
- highlighted elements: >
- one
- two
- four
- three
- two
- three
- four
- five
-< You can see here it has pasted four, three, two after the second line of
- the buffer. Now press 'u' to undo our last change. Leave the cursor
- on the second line 'two'. Press 'F11' to show the YankRing again.
- Visually select the same lines, but this time press 'r' instead of 'p'.
- 'r' is for reverse, so it will paste the following: >
- one
- two
- two
- three
- four
- three
- four
- five
-<
- *YRGetMultiple-example*
- The same behaviour listed above (by visually selecting items in the
- YankRing window) can be achieved using the YRGetMultiple command.
- Assume there are 10 elements in the YankRing. >
- :YRGetMultiple 4 " Will paste elements 1,2,3,4
- :YRGetMultiple! 4 " Will paste elements 4,3,2,1
- :YRGetMultiple " Will paste element 1
- :YRGetMultiple 12 " Will paste elements 1,2,...,10
- :YRGetMultiple 99 " Will paste elements 1,2,...,10
- :YRGetMultiple 0 " Will paste element 1
-<
- *YRSearch-example*
- The default size of the YankRing is 100 elements. It can be
- tedious searching through the YankRing to find the element you
- need. YRSearch is similar to YRShow except it will limit the
- items displayed to only those items matching the regex provided. >
- :YRShow
- --- YankRing ---
- Elem Content
- 1 Three Mississippi
- 2 Two Mississippi
- 3 One Mississippi
- 4 @", '\\/.*$^~[]' )
- :YRSearch Mississippi
- --- YankRing ---
- Elem Content
- 1 Three Mississippi
- 2 Two Mississippi
- 3 One Mississippi
-< Consider some items which require escaping the search string: >
- :YRSearch @", '\\
- --- YankRing ---
- Elem Content
- 1 @", '\\/.*$^~[]' )
-< Forward slashes and various other symbols require escapes, in this
- case the slash was not escaped enough: >
- :YRSearch @", '\\/
- --- YankRing ---
- Elem Content
-< There are enough escapes this time: >
- :YRSearch @", '\\\\/
- --- YankRing ---
- Elem Content
- 1 @", '\\/.*$^~[]' )
-< Period, star, dollar and so on require one slash: >
- :YRSearch @", '\\\\/\.\*\$\^\~\[\]
- --- YankRing ---
- Elem Content
- 1 @", '\\/.*$^~[]' )
-
-< *YRPop-example*
- You can remove any element from the YankRing by pressing pressing 'd' from
- within the YankRing window. Visual mode is also supported to remove more
- than one element at a time. >
- :YRShow
- --- YankRing ---
- Elem Content
- 1 four^@
- 2 three^@
- 3 two^@
- 4 one^@
-< Visually select elements 2,3. Press 'd', the result is: >
- :YRShow
- --- YankRing ---
- Elem Content
- 1 four^@
- 2 one^@
-
-< *yankring-visual-example*
- There are 3 visual modes and all are supported. Any visually selected
- text is added to the yankring. You can try the various modes. Move
- the cursor to inside the buffer (not the YankRing window).
-
- |characterwise-visual|
- Go to line 1, press 'v' and move using the cursor keys until you have
- highlighted some text. Then press y to yank the visually selected
- area. Pressing p with paste the yanked region.
-
- |linewise-visual|
- Go to line 2, press 'V' and move using the cursor keys until you have
- highlighted some text. Notice the entire line is selected (including
- the carriage returns). Then press y to yank the visually selected
- area. Pressing p with paste the yanked region.
-
- |blockwise-visual|
- Go to line 3 column 4, press CTRL-V and move to the right using the
- cursor keys until you have highlighted some text. Then press y to
- yank the visually selected area. Pressing p with paste the yanked
- region. Notice the pasted text retained its blockwise visual
- characteristics.
-
- *YRYankRange-example*
- YRYankRange is called during visual modes, but it is also possible to
- use this via the command line. >
- :1,4YRYankRange
- :3,$YRDeleteRange
- :YRShow
-<
- *global-example*
- Using Vim's |:global| command can be very useful at times. The example
- adds all rows (in a buffer) to the YankRing if they have a certain
- phrase: >
- :g/addme/YRYankCount 'yy'
-< This is the breakdown for the above command: >
- :g - for each line in the buffer
- /addme - check if the string "addme" is in the line
- /YRYankCount 'yy' - Ask the YankRing to execute the 'yy' command
-
-
-==============================================================================
-7. History *yankring-history*
-
- 11.0: August 09, 2010
- NF: Documented the global variables to customize the location
- of the YankRing menu.
- NF: The YankRing menu now shows the maps used for the default
- actions to help learn them more easily.
- NF: Added g:yankring_menu_root and g:yankring_menu_priority
- (David Barsam).
- NF: Added a warning indicating a stored value has been truncated
- based on g:yankring_max_element_length and a new option to
- suppress this warning, g:yankring_warn_on_truncate (Hans-Günter).
- BF: The YRAfterMaps() function (if it exists) was not re-run if
- YRToggle was used to disable and enable the YankRing.
- BF: Multibyte strings may not have been pasted correctly (Dr. Chip).
- BF: When pasting a string of 1111's, and additional -1 could also
- be included in the output.
-
- 10.0: January 31, 2010
- NF: Change the buffer name to [YankRing] to resemble other
- non-user buffers.
- NF: Added g:yankring_min_element_length which can prevent
- items from being added to the YankRing if they are too small.
- For example, single character deletes (Vedran M).
- BF: When shifting focus back to Vim, the YankRing may incorrectly
- report: "YR:Failed to change to the yankring buffer,
- please contact author".
- BF: When entering Vim for the first time and hitting "p"
- nothing was pasted (Mark Huiskes).
- BF: When entering Vim for the first time and the
- yankring_clipboard_monitor = 1, the clipboard entry
- was not automatically added to the yankring.
- BF: When overriding the default and setting
- g:yankring_window_use_bottom = 0, the YankRing would
- report the error (Sergey Khorev):
- E21: Cannot make changes, 'modifiable' is off
-
- 9.0: August 29, 2009:
- BF: You cannot execute a macro with ":normal @a". It is still
- not possible, but you can execute it with ":normal! @a"
- (A S Budden).
- BF: When g:yankring_persist = 0 the YankRing could go into
- an infinite loop (A S Budden).
- BF: When replaying a macro which used any of the zap
- keys (f,F,t,T,/,?) you were prompted again for the
- string to match on (Ovidiu C).
- BF: When checking the clipboard for changes
- (g:yankring_clipboard_monitor == 1) only add the item
- if it is not already in the ring. Previously, the item
- was moved to the top of the YankRing each time you flipped
- focus.
-
- 8.0: December 21, 2008:
- NF: Changed the implementation of YRGetSearch() (David Liang).
- BF: Under some unknown circumstances, the yankring can fail
- to change to the correct buffer. Put in code to double
- check and abort.
- BF: Yanking and pasting a line which ends in a backslash
- resulted in the backslash being replaced by "@@@".
- BF: When repeating a command (".") which used any of the zap
- keys (f,F,t,T,/,?) you were prompted again for the
- string to match on (Vasilii Pascal).
-
- 7.0: November 14, 2008:
- NF: Added support for the / and ? motions so that y/search is
- supported (Vasilii Pascal).
- NF: When the YankRing window is displayed (or updated) an additional
- check is made against the default register. If it has changed
- since the YankRing recorded it, the value will be added to the
- history.
- NF: Added support for more motions h, j, k, l, H, M, L, ^, 0, -, +, _.
- And a pile of g motions g_, g^, gm, g$, gk, gj, gg, ge, gE.
- NF: The YankRing window will display a message it is operating
- in a limited mode if not using Vim 7.2 or the correct patch
- level.
- BF: Correction to some internal code which could lead to an
- endless loop (John Beckett).
- BF: Opening and closing the YankRing window with "set report=0"
- reported "1 line less" messages (Bill McCarthy).
- BF: Changed the default value of g:yankring_paste_check_default_buffer
- to check if the default paste buffer has changed when pressing
- 'p'. For example, if a plugin has changed the default registers
- it will be pasted rather than the top item from the YankRing.
- BF: YRMapsDelete did not remove all the maps created by the YankRing.
- BF: Under particular circumstances, yanking text with embedded @
- characters were not properly stored and retrieved from the
- YankRing (Andrew Long).
- BF: Changed to use xmaps instead of vmaps so that the maps only work
- in visual mode and not select mode (David Liang).
-
- 6.1: October 31, 2008:
- BF: If the g:yankring_history_dir contains spaces (default on
- Windows) an error was reported. A simple work around was to
- let g:yankring_history_dir = 'c:\Vim' or no spaces (Matt).
-
- 6.0: October 25, 2008:
- NF: The YankRing now maintains the history in a file. This means
- if you are running multiple instances of Vim, they all see
- the same yankring.
- NF: The location and name of the file is configurable by the user.
- NF: The g:yankring_separator is no longer used and has been removed.
- NF: The g:yankring_max_element_length can be used to limit the size
- of an element in the yankring.
- NF: The g:yankring_share_between_instances can be used to indicate
- whether each instance of Vim running on a machine should share
- the history file or whether each should have their own
- individual history file.
- NF: The g:yankring_clipboard_monitor can be used to indicate
- whether changes to the system clipboard should be added to the
- YankRing (default is on).
- NF: The YankRing window can toggle the clipboard monitor by pressing
- 'c'. See the help in the window by pressing ?.
- NF: Added some highlighting to the YankRing window (Marty Grenfell).
-
- 5.0: September 21, 2008:
- NF: The YankRing can recognize certain Vim commands which do not
- change the contents of a buffer and not attempt to capture it.
- NF: The global variables which allow you to customize the behaviour
- are now space separated instead of comma separated. This
- provides greater flexibility but will require you to modify
- your vimrc (if you have customized it). (Andy Wokula)
- BF: If using <C-O> from within insert mode, the YankRing inserted
- characters into the buffer instead of capturing the changes,
- this was fixed by Andy Wokula (Agathoklis Hatzimanikas).
- BF: The YankRing did not properly account for all the different
- forms of counts "5yy" worked but "y5y" did not (Edwin Shao).
-
- 4.1: August 9, 2008:
- NF: The YankRing now allows you to override which operators should
- be ignored (yankring_ignore_operator). By default this is
- set for the standard Vim operators which do not modify any
- registers (Examples: = and gu) (Andy Wokula).
- NF: The YankRing did not map v_x (Matt Tolton).
- BF: The expression register (quote=) was not accounted for correctly
- (Agathoklis Hatzimanikas).
- BF: Using the v:operator variable must be escaped when used in
- a regular expression.
-
- 4.0: June 24, 2008:
- NF: The YankRing by default now captures all |text-objects| and
- all motions (|motion.txt|) which Vim supports. Version 3.0 only
- supported a subset of the basic motion commands.
- NF: Prior to this version only predefined maps triggered the
- capture of data into the yankring. These maps only supported
- yanks and deletes. The YankRing now also supports
- operator-pending mode, which allows a greater range of operations
- to be automatically captured and added to the yankring.
- Operating pending mode functionality requires Vim 7.2 or Vim 7.1
- with patch #205. If using Vim 7.1 you can determine this with:
- echo has("patch205")
- NF: Prior to this version only yanks and deletes were registered
- in the yankring. Changes are now also captured into the
- yankring.
- NF: The YankRing will also capture the system cliboard when focus is
- returned to the vim window. This is useful if you copy text
- between applications.
- NF: The YankRing window always opened bottom horizontal. Now it
- can be opened top or bottom and horizontal or vertically.
- This can be controlled via variables in your .vimrc.
- BF: The YankRing has an option to persist between instances
- of Vim by storing the values in global variables within
- the viminfo. This has led to some unusual ordering of
- items in the ring from conflicts between instances.
- This option has been turn off by default.
- BF: Their was an issue with yanking using y$.
-
- 3.1: September 10, 2007:
- NF: YRClear will now unlet all global variables it uses to store
- the data if the persist storage is specified (the default).
- Large values in the viminfo file could possibly affect other
- applications.
-
- 3.0: September 7, 2007:
- NF: Converted the YankRing to use the new Vim7's List object which
- means it is no longer compatible with Vim6.
- NF: By default the YankRing will now maintain the yankring's items
- persistently by default. It does this via the |viminfo| file.
- This means the contents of the YankRing rely on the internal
- variables of only 1 Vim instance.
- BF: YRToggle was not unmapping 'gp' and 'gP'.
- BF: YRSearch prompted the user for a regex even if one was provided
- on the command line.
- BF: If g:yankring_manage_numbered_reg is enabled, the "." operator
- did not correctly repeat the previous action (Pedro DeRose).
-
- 2.2: November 1, 2005:
- NF: Added 'x' to the list of yankring_n_keys. This is very useful
- in visual mode since it can delete a lot of characters.
-
- 2.2: October 19, 2005:
- BF: If you pressed '?' to toggle the display of the help in the
- YankRing window, the window would close. This also applied to
- 'a', which allowed you to toggle the autoclose feature.
-
- 2.1: October 11, 2005:
- NF: Added the ability for the YankRing to override Vim's numbered
- registers. Instead of the numbered registers holding the last
- yanked value, and the 9 previous deletes, they will now reflect
- the top 10 items in the yankring. This allows you to reference
- them directly with "5p.
-
- 2.0: August 20, 2005:
- NF: Much improved usability, the YankRing now has a "GUI" to service
- the yankring. If YRShow or YRSearch is used, a split buffer is
- opened which displays all the elements in the yankring. There
- are a number of maps that allow you to interact with the
- contents. The window can be positioned vertically or
- horizontally as well as being sized all through options
- specified in your vimrc.
- NF: YRPop can now delete any items from the yankring, rather
- that just from the top.
- NF: YRSetTop has been removed, it is no longer required as the
- internal representation of the YankRing has changed.
- BF: If g:yankring_ignore_duplicate is set (which is the default)
- you could get some unpredicable results when moving
- backwards and forwards (<C-P> and <C-N>) through the
- previous values.
-
- 1.7: June 10, 2005:
- BF: The expression register support added in version 1.6 used
- getreg('='), which has the side effect of executing the
- expression register. Depending on what was in the register
- this could have unusual results. Changed to use histget().
-
- 1.6: April 20, 2005:
- NF: YRSearch is similar to YRGetElem. Given a regular expression
- it will interactively display all the elements in the yankring
- that match the regular expression. You can enter the number
- of the element to paste it. If you have many elements within
- the yankring, this can help you identify them more easily.
- NF: Updated the default history size from 30 to 100, which is
- partially the reason for the YRSearch command.
- NF: By default it supports "gp" and "gP", in addition to "p" and "P".
- NF: Added support for the expression register (:h quote=). Here
- is an example of how it is used:
- "="X"<CR>P
-
- 1.5: March 30, 2005:
- NF: The YankRing now respects the cpoptions setting, if 'y' is
- included and you press '.', the previous yank command is executed
- and added to the yankring. You can also add this behaviour by
- setting this in your |vimrc|: >
- let g:yankring_dot_repeat_yank = 1
-< NF: Duplicates will not be added to the YankRing by default. If
- a duplicate is found, the element will be moved to the top
- of the yankring. This can be controlled by setting this in
- your |vimrc|: >
- let g:yankring_ignore_duplicate = 0 (1 is default)
-< BF: Regression from version 1.4, the '.' operator may incorrectly
- insert garbage.
-
- 1.4: March 28, 2005:
- NF: YRToggle has been updated. If you toggle the YankRing off
- (disable) the maps it creates are removed. Calling YRToggle
- again will recreate the maps. This truly disables the yankring,
- where the previous version attempted to do this via code.
- BF: Using the '.' operator was not correctly replaying operations
- that did not move text in some way (g~t_) changed the case
- of the text but a '.' did not replay it.
- BF: When replacing previously pasted text the YankRing did not
- respect what key was used to paste the text originally.
- All replaced items were pasted using 'p', even if you had
- originally pasted the text with 'P'.
-
- 1.3: March 16, 2005:
- BF: The '.' operator did not handle the <<, >> shift operator.
- Pressing '.' would result in the previous YankRing operation
- instead of repeating the shift.
-
- 1.2: March 14, 2005:
- NF: Added support for '.' operator to repeat the last change.
- NF: Changed YRGetElem to show the contents of the yankring
- and allow you to choose which element you want pasted.
- It is only interactive if you do not provide a parameter.
- NF: Added 'ygg,dgg' default maps by extending the yankring_n_keys
- variable.
-
- 1.1: March 09, 2005:
- NF: Added support for the black hole register |quote_|.
- NF: Custom Maps allows the user to more finely tune the yankring
- maps to perform whatever action they require. This function,
- YRRunAfterMaps(), is run automatically after the YankRing
- creates it's default mappings. See |yankring-custom-maps|.
- NF: Added some more default maps by extending the yankring_n_keys
- variable. It now contains:
- yy,dd,yw,dw,ye,de,yE,dE,yiw,diw,yaw,daw,y$,d$,Y,D,yG,dG
- NOTE: You can easily extend these default mappings by
- creating this global variable in your |vimrc|, you do not
- have to wait for the plugin to be updated.
- NF: Added support for Dr. Chips GetLatestVimScripts plugin.
- BF: The check for g:yankring_n_keys was incorrect, so it was not
- possible to override the default maps.
-
- 1.0: March 08, 2005:
- NF: Initial release.
-
-vim: ts=4 ft=help tw=78
diff --git a/vim/doc/zencoding.txt b/vim/doc/zencoding.txt
deleted file mode 100644
index e3f767a..0000000
--- a/vim/doc/zencoding.txt
+++ /dev/null
@@ -1,383 +0,0 @@
-*zencoding.txt* ZenCoding for Vim
-
- -------------------------------------------------------
- ZenCoding: vim plugins for HTML and CSS hi-speed coding
- -------------------------------------------------------
-
-Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
-WebSite: http://mattn.kaoriya.net/
-Repository: http://github.com/mattn/zencoding-vim
-Site: http://mattn.github.com/zencoding-vim
-License: BSD style license
-
-==============================================================================
-CONTENTS *zencoding-contents*
-
-Introduction |zencoding-introduction|
-Install |zencoding-install|
-Tutorial |zencoding-tutorial|
- 1. Expand Abbreviation |zencoding-expandabbr|
- 2. Wrap with Abbreviation |zencoding-wrap-wtih-abbreviation|
- 3. Balance Tag Inward |zencoding-balance-tag-inward|
- 4. Balance Tag Outward |zencoding-balance-tag-outward|
- 5. Go to Next Edit Point |zencoding-goto-next-point| |<C-Y>n|
- 6. Go to Previous Edit Point |zencoding-goto-previous-point|
- 7. Update <img> Size |zencoding-update-image-size|
- 8. Merge Lines |zencoding-merge-lines|
- 9. Remove Tag |zencoding-remove-tag|
- 10. Split/Join Tag |zencoding-split-join-tag|
- 11. Toggle Comment |zencoding-toggle-comment|
- 12. Make anchor from URL |zencoding-make-anchor-url|
- 13. Make quoted text from URL |zencoding-quoted-text-url|
-Customize |zencoding-customize|
- 1. Key Mappings |zencoding-customize-keymappings|
- 2. Indent Size |zencoding-indent-size|
- 3. Define Tag's Behavior |zencoding-define-tags-behavior|
- 4. Complete Tag |zencoding-complete-tag|
-ToDo |zencoding-todo|
-
-==============================================================================
-INTRODUCTION *zencoding-introduction* *zencoding*
-
-|ZenCoding| is an editor plugin for high-speed HTML, XML, XSL (or any other
-structured code format) coding and editing. The core of this plugin is a
-powerful abbreviation engine which allows you to expand expressions?similar to
-CSS selectors?into HTML code:
->
- div#page>div.logo+ul#navigation>li*5>a
-<
-...can be expanded into:
->
- <div id="page">
- <div class="logo"></div>
- <ul id="navigation">
- <li><a href=""></a></li>
- <li><a href=""></a></li>
- <li><a href=""></a></li>
- <li><a href=""></a></li>
- <li><a href=""></a></li>
- </ul>
- </div>
-<
-Read more about current Zen Coding syntax
- http://code.google.com/p/zen-coding/wiki/ZenHTMLSelectorsEn
-
-Abbreviation engine has a modular structure which allows you to expand
-abbreviations into different languages. Zen Coding currently supports CSS,
-HTML, XML/XSL and HAML languages via filters.
-
-==============================================================================
-INSTALL *zencoding-install*
-
-Install the distributed files into Vim runtime directory which is usually
-~/.vim/, or $HOME/vimfiles on Windows.
-
-If you install pathogen that provided from Tim Pope, you should extract the
-file into 'bundle' directory.
-
-==============================================================================
-TUTORIAL *zencoding-tutorial*
-
-If you are seeing this file as :help, then you can't edit this file.
-You should copy this section and create new buffer, paste and write as
-'zencoding-tutor.txt'. Formally, open the file to start tutorial.
-
-1. Expand Abbreviation *zencoding-expandabbr* *<C-Y>,*
-
- Type abbreviation as 'div>p#foo$*3>a' and type |<C-Y>,|.
->
- <div>
- <p id="foo1">
- <a href=""></a>
- </p>
- <p id="foo2">
- <a href=""></a>
- </p>
- <p id="foo3">
- <a href=""></a>
- </p>
- </div>
-<
-2. Wrap with Abbreviation *zencoding-wrap-wtih-abbreviation* *v_<C-Y>,*
-
- Write as below.
->
- test1
- test2
- test3
-<
- Then do visual select(line wize) and type |<C-Y>,|.
- If you request 'Tag:', then type 'ul>li*'.
->
- <ul>
- <li>test1</li>
- <li>test2</li>
- <li>test3</li>
- </ul>
-<
- If you type tag as 'blockquote', then you'll see as following.
->
- <blockquote>
- test1
- test2
- test3
- </blockquote>
-<
-3. Balance Tag Inward *zencoding-balance-tag-inward* *<C-Y>d*
-
- To select inward of ul tag, type |<C-Y>d| in insert mode.
->
- <ul>
- * <li class="list1"></li>
- <li class="list2"></li>
- <li class="list3"></li>
- </ul>
-<
- If cursor is at '*', |<C-Y>d| select from begin of <ul> to end of </ul>.
- If cursor is at first of <li>, it select <li class="list1"></li>.
-
-4. Balance Tag Outward *zencoding-balance-tag-outward* *<C-Y>D*
-
- To select outward of ul tag, insert mode, type <C-Y>D in insert mode.
->
- <ul>
- * <li class="list1"></li>
- <li class="list2"></li>
- <li class="list3"></li>
- </ul>
-<
- If cursor is at '*', |<C-Y>d| select from next letter of <ul> to previous
- letter of </ul>.
- If cursor is at first of <li>, it select <li class="list1"></li>.
-
-5. Go to Next Edit Point *zencoding-goto-next-point* *<C-Y>n*
-
- To jump next point that need to edit, type |<C-Y>n| in insert mode.
->
- * <div id="foo" class="">foo</div>
- <div id="bar" class="bar"></li>
-<
- If cursor is at '*', |<C-Y>n| move a cursor into attribute value of div
- specified id as 'foo'. And type again |<C-Y>n| move a cursor into inner of
- div specified id as 'bar'.
-
-6. Go to Previous Edit Point *zencoding-goto-previous-point* *<C-Y>N*
-
- To jump previous point that need to edit, type |<C-Y>N| in insert mode.
->
- <div id="foo" class="">foo</div>
- <div id="bar" class="bar"></li> *
-<
- If cursor is at '*', |<C-Y>N| move a cursor into div specified id as 'bar'.
- And type again |<C-Y>N| move a cursor into attribute value of 'foo'.
-
-7. Update <img> Size *zencoding-update-image-size* *<C-Y>i*
-
- To expand or update size of image, type |<C-Y>i| on img tag
->
- <img src="foo.png" />
-<
- Type '<c-y>i' on img tag
->
- <img src="foo.png" width="32" height="32" />
-<
- If you change image, then type it again. it will be following.
->
- <img src="foo-48.png" width="32" height="48" />
-<
-8. Merge Lines *zencoding-merge-lines*
-
- To join multi line text like following, type |J|.
->
- <ul>
- <li class="list1"></li>
- <li class="list2"></li>
- <li class="list3"></li>
- </ul>
-<
- If you select part of line include <li> and type |J|, it will be following.
->
- <ul>
- <li class="list1"></li><li class="list2"></li><li class="list3"></li>
- </ul>
-<
-9. Remove Tag *zencoding-remove-tag* *<C-Y>k*
-
- To remove tag in the block, type |<C-Y>k|.
->
- <div class="foo">
- <a>cursor is here</a>
- </div>
-<
- Type |<C-Y>k| in insert mode, then
->
- <div class="foo">
-
- </div>
-<
- And type |<C-Y>k| in there again, then div will be removed.
-
-10. Split/Join Tag *zencoding-split-join-tag* *<C-Y>j*
-
- To join block, type |<C-Y>j|.
->
- <div class="foo">
- cursor is here
- </div>
-<
- Type |<C-Y>j| in insert mode. then,
->
- <div class="foo"/>
-<
- And type |<C-Y>j| in there again.
->
- <div class="foo">
- </div>
-<
-11. Toggle Comment *zencoding-toggle-comment* *<C-Y>/*
-
- Move cursor to block
->
- <div>
- hello world
- </div>
-<
- Type '<c-y>/' in insert mode.
->
- <!-- <div>
- hello world
- </div> -->
-<
- Type '<c-y>/' in there again.
->
- <div>
- hello world
- </div>
-<
-12. Make anchor from URL *zencoding-make-anchor-url* *<C-Y>a*
-
- Move cursor to URL
->
- http://www.google.com/
-<
- Type |<C-Y>a|
->
- <a href="http://www.google.com/">Google</a>
-<
-13. Make quoted text from URL *zencoding-quoted-text-url* *<C-Y>A*
-
- Move cursor to URL
->
- http://github.com/
-<
- Type |<C-Y>A|
->
- <blockquote class="quote">
- <a href="http://github.com/">Secure source code hosting and collaborative development - GitHub</a><br />
- <p>How does it work? Get up and running in seconds by forking a project, pushing an existing repository...</p>
- <cite>http://github.com/</cite>
- </blockquote>
-<
-==============================================================================
-CUSTOMIZE *zencoding-customize*
-
-1. Key Mapping *zencoding-customize-keymappings*
-
- To specify leading key for expanding or balance tag, or for all,
- Add this line in your vimrc: >
->
- let g:user_zen_leader_key = '<c-y>'
-<
- Or if you prefer to map for each actions, then you set each variables.
-
- 'user_zen_expandabbr_key'
- 'user_zen_expandword_key'
- 'user_zen_balancetaginward_key'
- 'user_zen_balancetagoutward_key'
- 'user_zen_next_key'
- 'user_zen_prev_key'
- 'user_zen_imagesize_key'
- 'user_zen_togglecomment_key'
- 'user_zen_splitjointag_key'
- 'user_zen_removetag_key'
- 'user_zen_anchorizeurl_key'
- 'user_zen_anchorizesummary_key'
-
-2. Indent Size *zencoding-indent-size*
-
- To change indent size of html, add this code in your vimrc.
->
- let g:user_zen_settings = {
- \ 'html' : {
- \ 'indentation' : ' '
- \ },
- \}
-<
- If you prefer to change global indent size then add this.
->
- let g:user_zen_settings = {
- \ 'indentation' : ' '
- \}
-<
-3. Define Tag's Behavior *zencoding-define-tags-behavior*
-
- zencoding.vim can change behavior of expanding abbreviation for each
- filetypes as |Dictionary|. for details, see official site of zencoding.
- for example, vimmer can add following.
->
- let g:user_zen_settings = {
- \ 'lang' : 'ja',
- \ 'html' : {
- \ 'filters' : 'html',
- \ 'indentation' : ' '
- \ },
- \ 'perl' : {
- \ 'indentation' : ' ',
- \ 'aliases' : {
- \ 'req' : "require '|'"
- \ },
- \ 'snippets' : {
- \ 'use' : "use strict\nuse warnings\n\n",
- \ 'w' : "warn \"${cursor}\";",
- \ },
- \ },
- \ 'php' : {
- \ 'extends' : 'html',
- \ 'filters' : 'html,c',
- \ },
- \ 'css' : {
- \ 'filters' : 'fc',
- \ },
- \ 'javascript' : {
- \ 'snippets' : {
- \ 'jq' : "$(function() {\n\t${cursor}${child}\n});",
- \ 'jq:each' : "$.each(arr, function(index, item)\n\t${child}\n});",
- \ 'fn' : "(function() {\n\t${cursor}\n})();",
- \ 'tm' : "setTimeout(function() {\n\t${cursor}\n}, 100);",
- \ },
- \ },
- \ 'java' : {
- \ 'indentation' : ' ',
- \ 'snippets' : {
- \ 'main': "public static void main(String[] args) {\n\t|\n}",
- \ 'println': "System.out.println(\"|\");",
- \ 'class': "public class | {\n}\n",
- \ },
- \ },
- \}
-<
-4. Complete Tag *zencoding-complete-tag*
-
- If you want to complete tags using |omnifunc| then add this.
->
- let g:use_zen_complete_tag = 1
-<
-==============================================================================
-TODO *zencoding-todo*
- * wrapping inline selected.
- * more documents.
- * more contributor.
- * more time to improve zencodig.vim.
-
-==============================================================================
-vim:tw=78:ts=8:ft=help:norl:noet:fen:fdl=0:
diff --git a/vim/ftdetect/git.vim b/vim/ftdetect/git.vim
deleted file mode 100644
index 727bf0c..0000000
--- a/vim/ftdetect/git.vim
+++ /dev/null
@@ -1,18 +0,0 @@
-" Git
-autocmd BufNewFile,BufRead *.git/COMMIT_EDITMSG set ft=gitcommit
-autocmd BufNewFile,BufRead *.git/config,.gitconfig,.gitmodules set ft=gitconfig
-autocmd BufNewFile,BufRead git-rebase-todo set ft=gitrebase
-autocmd BufNewFile,BufRead .msg.[0-9]*
- \ if getline(1) =~ '^From.*# This line is ignored.$' |
- \ set ft=gitsendemail |
- \ endif
-autocmd BufNewFile,BufRead *.git/**
- \ if getline(1) =~ '^\x\{40\}\>\|^ref: ' |
- \ set ft=git |
- \ endif
-
-" This logic really belongs in scripts.vim
-autocmd BufNewFile,BufRead,StdinReadPost *
- \ if getline(1) =~ '^\(commit\|tree\|object\) \x\{40\}\>\|^tag \S\+$' |
- \ set ft=git |
- \ endif
diff --git a/vim/ftdetect/tt2.vim b/vim/ftdetect/tt2.vim
deleted file mode 100644
index 699fa58..0000000
--- a/vim/ftdetect/tt2.vim
+++ /dev/null
@@ -1,9 +0,0 @@
-au BufNewFile,BufRead *.tt
- \ if ( join(getline(1, 10)) =~ '<\chtml'
- \ && join(getline(1, 10)) !~ '<[%?]' )
- \ || getline(1) =~ '<!DOCTYPE HTML'
- \ || ( join(getline(1, 10)) =~ '<.*>' ) |
- \ setf tt2html |
- \ else |
- \ setf tt2 |
- \ endif
diff --git a/vim/ftplugin/git.vim b/vim/ftplugin/git.vim
deleted file mode 100644
index 6b12ace..0000000
--- a/vim/ftplugin/git.vim
+++ /dev/null
@@ -1,37 +0,0 @@
-" Vim filetype plugin
-" Language: generic git output
-" Maintainer: Tim Pope <vimNOSPAM@tpope.info>
-" Last Change: 2008 Jul 30
-
-" Only do this when not done yet for this buffer
-if (exists("b:did_ftplugin"))
- finish
-endif
-let b:did_ftplugin = 1
-
-if !exists('b:git_dir')
- if expand('%:p') =~# '\.git\>'
- let b:git_dir = matchstr(expand('%:p'),'.*\.git\>')
- elseif $GIT_DIR != ''
- let b:git_dir = $GIT_DIR
- endif
- if (has('win32') || has('win64')) && exists('b:git_dir')
- let b:git_dir = substitute(b:git_dir,'\\','/','g')
- endif
-endif
-
-if exists('*shellescape') && exists('b:git_dir') && b:git_dir != ''
- if b:git_dir =~# '/\.git$' " Not a bare repository
- let &l:path = escape(fnamemodify(b:git_dir,':h'),'\, ').','.&l:path
- endif
- let &l:path = escape(b:git_dir,'\, ').','.&l:path
- let &l:keywordprg = 'git --git-dir='.shellescape(b:git_dir).' show'
-else
- setlocal keywordprg=git\ show
-endif
-if has('gui_running')
- let &l:keywordprg = substitute(&l:keywordprg,'^git\>','git --no-pager','')
-endif
-
-setlocal includeexpr=substitute(v:fname,'^[^/]\\+/','','')
-let b:undo_ftplugin = "setl keywordprg< path< includeexpr<"
diff --git a/vim/ftplugin/html_snip_helper.vim b/vim/ftplugin/html_snip_helper.vim
deleted file mode 100644
index 2e54570..0000000
--- a/vim/ftplugin/html_snip_helper.vim
+++ /dev/null
@@ -1,10 +0,0 @@
-" Helper function for (x)html snippets
-if exists('s:did_snip_helper') || &cp || !exists('loaded_snips')
- finish
-endif
-let s:did_snip_helper = 1
-
-" Automatically closes tag if in xhtml
-fun! Close()
- return stridx(&ft, 'xhtml') == -1 ? '' : ' /'
-endf
diff --git a/vim/ftplugin/ocaml_enhcomm.vim b/vim/ftplugin/ocaml_enhcomm.vim
deleted file mode 100644
index 7609054..0000000
--- a/vim/ftplugin/ocaml_enhcomm.vim
+++ /dev/null
@@ -1 +0,0 @@
-set commentstring=(*%s*)
diff --git a/vim/ftplugin/php_enhcomm.vim b/vim/ftplugin/php_enhcomm.vim
deleted file mode 100644
index b6a9c04..0000000
--- a/vim/ftplugin/php_enhcomm.vim
+++ /dev/null
@@ -1,6 +0,0 @@
-"
-" Normal HTML text has no synID-name. So we have to specify this problem
-" case here. Note that you should not try to comment lines starting
-" with '<?'.
-"
-call EnhCommentifyFallback4Embedded('&ft == "php" && synFiletype == ""', "html")
diff --git a/vim/plugin/foldtext.vim b/vim/plugin/foldtext.vim
deleted file mode 100644
index a8f31b7..0000000
--- a/vim/plugin/foldtext.vim
+++ /dev/null
@@ -1,308 +0,0 @@
-" Base {{{
-function Foldtext_base(...)
- " use the argument for display if possible, otherwise the current line {{{
- if a:0 > 0
- let line = a:1
- else
- let line = getline(v:foldstart)
- endif
- " }}}
- " remove the marker that caused this fold from the display {{{
- let foldmarkers = split(&foldmarker, ',')
- let line = substitute(line, '\V' . foldmarkers[0] . '\%(\d\+\)\?', ' ', '')
- " }}}
- " remove comments that vim knows about {{{
- let comment = split(&commentstring, '%s')
- if comment[0] != ''
- let comment_begin = comment[0]
- let comment_end = ''
- if len(comment) > 1
- let comment_end = comment[1]
- end
- let pattern = '\V' . comment_begin . '\s\*' . comment_end . '\s\*\$'
- if line =~ pattern
- let line = substitute(line, pattern, ' ', '')
- else
- let line = substitute(line, '.*\V' . comment_begin, ' ', '')
- if comment_end != ''
- let line = substitute(line, '\V' . comment_end, ' ', '')
- endif
- endif
- endif
- " }}}
- " remove any remaining leading or trailing whitespace {{{
- let line = substitute(line, '^\s*\(.\{-}\)\s*$', '\1', '')
- " }}}
- " align everything, and pad the end of the display with - {{{
- let alignment = &columns - 18 - v:foldlevel
- let line = strpart(printf('%-' . alignment . 's', line), 0, alignment)
- let line = substitute(line, '\%( \)\@<= \%( *$\)\@=', '-', 'g')
- " }}}
- " format the line count {{{
- let cnt = printf('%13s', '(' . (v:foldend - v:foldstart + 1) . ' lines) ')
- " }}}
- return '+-' . v:folddashes . ' ' . line . cnt
-endfunction
-" }}}
-" Latex {{{
-let s:latex_types = {'thm': 'Theorem', 'cor': 'Corollary',
- \ 'lem': 'Lemma', 'defn': 'Definition'}
-function s:lower_letter(i) " {{{
- return tolower(s:upper_letter(a:i))
-endfunction " }}}
-function s:roman_numeral(i) " {{{
- let numeral = ''
- let chars = 'ivxlcdm'
- let i = a:i
- for base in [0, 2, 4]
- let c1 = strpart(chars, base, 1)
- let c5 = strpart(chars, base + 1, 1)
- let c10 = strpart(chars, base + 2, 1)
- let digit = i % 10
- if digit == 1
- let numeral = c1 . numeral
- elseif digit == 2
- let numeral = c1 . c1 . numeral
- elseif digit == 3
- let numeral = c1 . c1 . c1 . numeral
- elseif digit == 4
- let numeral = c1 . c5 . numeral
- elseif digit == 5
- let numeral = c5 . numeral
- elseif digit == 6
- let numeral = c5 . c1 . numeral
- elseif digit == 7
- let numeral = c5 . c1 . c1 . numeral
- elseif digit == 8
- let numeral = c5 . c1 . c1 . c1 . numeral
- elseif digit == 9
- let numeral = c1 . c10 . numeral
- endif
- let i = i / 10
- if i == 0
- break
- end
- endfor
-
- return repeat('m', i) . numeral
-endfunction " }}}
-function s:upper_letter(i) " {{{
- if a:i <= 26
- return nr2char(char2nr('A') + a:i - 1)
- else
- return 'ERROR'
- endif
-endfunction " }}}
-function s:enumeration(depth, index) " {{{
- if a:depth == 0
- return a:index + 1
- elseif a:depth == 1
- return '(' . s:lower_letter(a:index + 1) . ')'
- elseif a:depth == 2
- return s:roman_numeral(a:index + 1)
- elseif a:depth == 3
- return s:upper_letter(a:index + 1)
- else
- return 'Error: invalid depth'
- endif
-endfunction " }}}
-function Foldtext_latex() " {{{
- let line = getline(v:foldstart)
- " format theorems/etc nicely {{{
- let matches = matchlist(line, '\\begin{\([^}]*\)}')
- if !empty(matches) && has_key(s:latex_types, matches[1])
- let type = s:latex_types[matches[1]]
- let label = ''
- let linenum = v:foldstart - 1
- while linenum <= v:foldend
- let linenum += 1
- let line = getline(linenum)
- let matches = matchlist(line, '\\label{\([^}]*\)}')
- if !empty(matches)
- let label = matches[1]
- break
- endif
- endwhile
- if label != ''
- let label = ": " . label
- endif
- return Foldtext_base(type . label)
- endif
- " }}}
- " format list items nicely {{{
- " XXX: nesting different types of lists doesn't give quite the correct
- " result - an enumerate inside an itemize inside an enumerate should use
- " (a), but here it will go back to using 1.
- if line =~ '\\item'
- let item_name = []
- let item_depth = 0
- let nesting = 0
- let type = ''
- for linenum in range(v:foldstart, 0, -1)
- let line = getline(linenum)
- if line =~ '\\item'
- if nesting == 0
- let label = matchstr(line, '\\item\[\zs[^]]*\ze\]')
- if len(item_name) == item_depth
- if label != ''
- let item_name += [label]
- else
- let item_name += [0]
- endif
- else
- if type(item_name[item_depth]) == type(0) && label == ''
- let item_name[item_depth] += 1
- endif
- endif
- endif
- elseif line =~ '\\begin{document}'
- break
- elseif line =~ '\\begin'
- if nesting > 0
- let nesting -= 1
- else
- let new_type = matchstr(line, '\\begin{\zs[^}]*\ze}')
- if type == ''
- let type = new_type
- elseif type != new_type
- let item_name = item_name[0:-2]
- break
- endif
- let item_depth += 1
- endif
- elseif line =~ '\\end'
- let nesting += 1
- endif
- endfor
- " XXX: vim crashes if i just reverse the actual list
- " should be fixed in patch 7.1.287
- "let item_name = reverse(item_name)
- let item_name = reverse(deepcopy(item_name))
- for i in range(len(item_name))
- if type(item_name[i]) != type('')
- let item_name[i] = s:enumeration(i, item_name[i])
- endif
- endfor
- let type = toupper(strpart(type, 0, 1)) . strpart(type, 1)
- let line = type . ': ' . join(item_name, '.')
- return Foldtext_base(line)
- endif
- " }}}
- return Foldtext_base(line)
-endfunction " }}}
-" }}}
-" C++ {{{
-function Foldtext_cpp()
- let line = getline(v:foldstart)
- " strip out // comments {{{
- let block_open = stridx(line, '/*')
- let line_open = stridx(line, '//')
- if block_open == -1 || line_open < block_open
- return Foldtext_base(substitute(line, '//', ' ', ''))
- endif
- " }}}
- return Foldtext_base(line)
-endfunction
-" }}}
-" Perl {{{
-function Foldtext_perl()
- let line = getline(v:foldstart)
- " format sub names with their arguments {{{
- let matches = matchlist(line,
- \ '^\s*\(sub\|around\|before\|after\|guard\)\s*\(\w\+\)')
- if !empty(matches)
- let linenum = v:foldstart - 1
- let sub_type = matches[1]
- let params = []
- while linenum <= v:foldend
- let linenum += 1
- let next_line = getline(linenum)
- " skip the opening brace and comment lines and blank lines
- if next_line =~ '\s*{\s*' || next_line =~ '^\s*#' || next_line == ''
- continue
- endif
-
- " handle 'my $var = shift;' type lines
- let var = '\%(\$\|@\|%\|\*\)\w\+'
- let shift_line = matchlist(next_line,
- \ 'my\s*\(' . var . '\)\s*=\s*shift\%(\s*||\s*\(.\{-}\)\)\?;')
- if !empty(shift_line)
- if shift_line[1] == '$self' && empty(params)
- if sub_type == 'sub'
- let sub_type = ''
- endif
- let sub_type .= ' method'
- elseif shift_line[1] == '$class' && empty(params)
- if sub_type == 'sub'
- let sub_type = ''
- endif
- let sub_type .= ' static method'
- elseif shift_line[1] != '$orig'
- let arg = shift_line[1]
- " also catch default arguments
- if shift_line[2] != ''
- let arg .= ' = ' . shift_line[2]
- endif
- let params += [l:arg]
- endif
- continue
- endif
-
- " handle 'my ($a, $b) = @_;' type lines
- let rest_line = matchlist(next_line, 'my\s*(\(.*\))\s*=\s*@_;')
- if !empty(rest_line)
- let rest_params = split(rest_line[1], ',\s*')
- let params += rest_params
- continue
- endif
-
- " handle 'my @args = @_;' type lines
- let array_line = matchlist(next_line, 'my\s*\(@\w\+\)\s*=\s*@_;')
- if !empty(array_line)
- let params += [array_line[1]]
- continue
- endif
-
- " handle 'my %args = @_;' type lines
- let hash_line = matchlist(next_line, 'my\s*%\w\+\s*=\s*@_;')
- if !empty(hash_line)
- let params += ['paramhash']
- continue
- endif
-
- " handle unknown uses of shift
- if next_line =~ '\%(\<shift\>\%(\s*@\)\@!\)'
- let params += ['$unknown']
- continue
- endif
-
- " handle unknown uses of @_
- if next_line =~ '@_\>'
- let params += ['@unknown']
- continue
- endif
- endwhile
-
- let params = filter(params[0:-2], 'strpart(v:val, 0, 1) != "@"') +
- \ [params[-1]]
-
- return Foldtext_base(sub_type . ' ' . matches[2] .
- \ '(' . join(params, ', ') . ')')
- endif
- " }}}
- return Foldtext_base(line)
-endfunction
-" }}}
-
-if exists("g:Foldtext_enable") && g:Foldtext_enable
- set foldtext=Foldtext_base()
-endif
-if exists("g:Foldtext_tex_enable") && g:Foldtext_tex_enable
- autocmd FileType tex setlocal foldtext=Foldtext_latex()
-endif
-if exists("g:Foldtext_cpp_enable") && g:Foldtext_cpp_enable
- autocmd FileType cpp setlocal foldtext=Foldtext_cpp()
-endif
-if exists("g:Foldtext_perl_enable") && g:Foldtext_perl_enable
- autocmd FileType perl setlocal foldtext=Foldtext_perl()
-endif
diff --git a/vim/plugin/fuf.vim b/vim/plugin/fuf.vim
deleted file mode 100644
index 9826dab..0000000
--- a/vim/plugin/fuf.vim
+++ /dev/null
@@ -1,158 +0,0 @@
-"=============================================================================
-" 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:
diff --git a/vim/plugin/l9.vim b/vim/plugin/l9.vim
deleted file mode 100644
index 03613e4..0000000
--- a/vim/plugin/l9.vim
+++ /dev/null
@@ -1,108 +0,0 @@
-"=============================================================================
-" Copyright (C) 2009-2010 Takeshi NISHIDA
-"
-" GetLatestVimScripts: 3252 1 :AutoInstall: L9
-"=============================================================================
-" LOAD GUARD {{{1
-
-if !l9#guardScriptLoading(expand('<sfile>:p'), 702, 0, [])
- finish
-endif
-
-" }}}1
-"=============================================================================
-" OPTIONS: {{{1
-
-call l9#defineVariableDefault('g:l9_balloonly', 'balloonly.exe')
-
-" }}}1
-"=============================================================================
-" ASSERTION: {{{1
-
-" This command has effect only if $L9_DEBUG is non-zero.
-" Used as follows:
-" L9Assert a:i > 0
-" This command can't interpret script-local variables directly.
-" NG: L9Assert s:a == 1
-" OK: execute 'L9Assert ' . s:a . ' == 1'
-"
-if $L9_DEBUG
- command -nargs=* L9Assert call eval((<args>) ? 0 : s:handleFailedAssersion(<q-args>))
-
- function s:handleFailedAssersion(expr)
- echoerr '[L9Assert] Assersion failure: ' . a:expr
- if input('[L9Assert] Continue? (Y/N) ', 'Y') !=? 'Y'
- throw 'L9Assert ' . a:expr
- endif
- endfunction
-
-else
- command -nargs=* L9Assert :
-endif
-
-" }}}1
-"=============================================================================
-" TIMER: {{{1
-
-" These commands have effect only if $L9_TIMER is non-zero.
-" Used as follows:
-" L9Timer foo
-" ... (1)
-" L9Timer bar
-" ... (2)
-" L9TimerStop
-" ...
-" L9TimerDump <- shows each elapsed time of (1) and (2)
-"
-if $L9_TIMER
- command -nargs=1 L9Timer call s:timerBegin(<q-args>)
- command -nargs=0 L9TimerStop call s:timerStop()
- command -nargs=0 L9TimerDump call s:timerDump()
-
- let s:timerData = []
- let s:timerTagMaxLen = 0
-
- function s:timerBegin(tag)
- L9TimerStop
- let s:timerCurrent = {'tag': strftime('%c ') . a:tag . ' ', 'time': reltime()}
- let s:timerTagMaxLen = max([len(s:timerCurrent.tag), s:timerTagMaxLen])
- endfunction
-
- function s:timerStop()
- if !exists('s:timerCurrent')
- return
- endif
- let s:timerCurrent.time = reltimestr(reltime(s:timerCurrent.time))
- call add(s:timerData, s:timerCurrent)
- unlet s:timerCurrent
- endfunction
-
- function s:timerDump()
- L9TimerStop
- let lines = map(s:timerData, 'v:val.tag . repeat(" ", s:timerTagMaxLen - len(v:val.tag)) . v:val.time')
- call l9#tempbuffer#openReadOnly('[l9-timer]', '', lines, 0, 0, 0, {})
- let s:timerData = []
- let s:timerTagMaxLen = 0
- endfunction
-
-else
- command -nargs=1 L9Timer :
- command -nargs=0 L9TimerStop :
- command -nargs=0 L9TimerDump :
-endif
-
-" }}}1
-"=============================================================================
-" GREP BUFFER: {{{1
-
-" Grep for current buffer by l9#grepBuffers()
-" Used as :L9GrepBuffer/pattern
-command -nargs=? L9GrepBuffer call l9#grepBuffers(<q-args>, [bufnr('%')])
-
-" Grep for all buffers by l9#grepBuffers()
-" Used as :L9GrepBufferAll/pattern
-command -nargs=? L9GrepBufferAll call l9#grepBuffers(<q-args>, range(1, bufnr('$')))
-
-" }}}1
-"=============================================================================
-" vim: set fdm=marker:
diff --git a/vim/plugin/matchit.vim b/vim/plugin/matchit.vim
deleted file mode 100644
index f1945ab..0000000
--- a/vim/plugin/matchit.vim
+++ /dev/null
@@ -1,812 +0,0 @@
-" matchit.vim: (global plugin) Extended "%" matching
-" Last Change: Fri Jan 25 10:00 AM 2008 EST
-" Maintainer: Benji Fisher PhD <benji@member.AMS.org>
-" Version: 1.13.2, for Vim 6.3+
-" URL: http://www.vim.org/script.php?script_id=39
-
-" Documentation:
-" The documentation is in a separate file, matchit.txt .
-
-" Credits:
-" Vim editor by Bram Moolenaar (Thanks, Bram!)
-" Original script and design by Raul Segura Acevedo
-" Support for comments by Douglas Potts
-" Support for back references and other improvements by Benji Fisher
-" Support for many languages by Johannes Zellner
-" Suggestions for improvement, bug reports, and support for additional
-" languages by Jordi-Albert Batalla, Neil Bird, Servatius Brandt, Mark
-" Collett, Stephen Wall, Dany St-Amant, Yuheng Xie, and Johannes Zellner.
-
-" Debugging:
-" If you'd like to try the built-in debugging commands...
-" :MatchDebug to activate debugging for the current buffer
-" This saves the values of several key script variables as buffer-local
-" variables. See the MatchDebug() function, below, for details.
-
-" TODO: I should think about multi-line patterns for b:match_words.
-" This would require an option: how many lines to scan (default 1).
-" This would be useful for Python, maybe also for *ML.
-" TODO: Maybe I should add a menu so that people will actually use some of
-" the features that I have implemented.
-" TODO: Eliminate the MultiMatch function. Add yet another argument to
-" Match_wrapper() instead.
-" TODO: Allow :let b:match_words = '\(\(foo\)\(bar\)\):\3\2:end\1'
-" TODO: Make backrefs safer by using '\V' (very no-magic).
-" TODO: Add a level of indirection, so that custom % scripts can use my
-" work but extend it.
-
-" allow user to prevent loading
-" and prevent duplicate loading
-if exists("loaded_matchit") || &cp
- finish
-endif
-let loaded_matchit = 1
-let s:last_mps = ""
-let s:last_words = ":"
-
-let s:save_cpo = &cpo
-set cpo&vim
-
-nnoremap <silent> % :<C-U>call <SID>Match_wrapper('',1,'n') <CR>
-nnoremap <silent> g% :<C-U>call <SID>Match_wrapper('',0,'n') <CR>
-xnoremap <silent> % :<C-U>call <SID>Match_wrapper('',1,'v') <CR>m'gv``
-xnoremap <silent> g% :<C-U>call <SID>Match_wrapper('',0,'v') <CR>m'gv``
-onoremap <silent> % v:<C-U>call <SID>Match_wrapper('',1,'o') <CR>
-onoremap <silent> g% v:<C-U>call <SID>Match_wrapper('',0,'o') <CR>
-
-" Analogues of [{ and ]} using matching patterns:
-nnoremap <silent> [% :<C-U>call <SID>MultiMatch("bW", "n") <CR>
-nnoremap <silent> ]% :<C-U>call <SID>MultiMatch("W", "n") <CR>
-xmap [% <Esc>[%m'gv``
-xmap ]% <Esc>]%m'gv``
-" xnoremap <silent> [% :<C-U>call <SID>MultiMatch("bW", "v") <CR>m'gv``
-" xnoremap <silent> ]% :<C-U>call <SID>MultiMatch("W", "v") <CR>m'gv``
-onoremap <silent> [% v:<C-U>call <SID>MultiMatch("bW", "o") <CR>
-onoremap <silent> ]% v:<C-U>call <SID>MultiMatch("W", "o") <CR>
-
-" text object:
-xmap a% <Esc>[%v]%
-
-" Auto-complete mappings: (not yet "ready for prime time")
-" TODO Read :help write-plugin for the "right" way to let the user
-" specify a key binding.
-" let g:match_auto = '<C-]>'
-" let g:match_autoCR = '<C-CR>'
-" if exists("g:match_auto")
-" execute "inoremap " . g:match_auto . ' x<Esc>"=<SID>Autocomplete()<CR>Pls'
-" endif
-" if exists("g:match_autoCR")
-" execute "inoremap " . g:match_autoCR . ' <CR><C-R>=<SID>Autocomplete()<CR>'
-" endif
-" if exists("g:match_gthhoh")
-" execute "inoremap " . g:match_gthhoh . ' <C-O>:call <SID>Gthhoh()<CR>'
-" endif " gthhoh = "Get the heck out of here!"
-
-let s:notslash = '\\\@<!\%(\\\\\)*'
-
-function! s:Match_wrapper(word, forward, mode) range
- " In s:CleanUp(), :execute "set" restore_options .
- let restore_options = (&ic ? " " : " no") . "ignorecase"
- if exists("b:match_ignorecase")
- let &ignorecase = b:match_ignorecase
- endif
- let restore_options = " ve=" . &ve . restore_options
- set ve=
- " If this function was called from Visual mode, make sure that the cursor
- " is at the correct end of the Visual range:
- if a:mode == "v"
- execute "normal! gv\<Esc>"
- endif
- " In s:CleanUp(), we may need to check whether the cursor moved forward.
- let startline = line(".")
- let startcol = col(".")
- " Use default behavior if called with a count.
- if v:count
- exe "normal! " . v:count . "%"
- return s:CleanUp(restore_options, a:mode, startline, startcol)
- end
-
- " First step: if not already done, set the script variables
- " s:do_BR flag for whether there are backrefs
- " s:pat parsed version of b:match_words
- " s:all regexp based on s:pat and the default groups
- "
- if !exists("b:match_words") || b:match_words == ""
- let match_words = ""
- " Allow b:match_words = "GetVimMatchWords()" .
- elseif b:match_words =~ ":"
- let match_words = b:match_words
- else
- execute "let match_words =" b:match_words
- endif
-" Thanks to Preben "Peppe" Guldberg and Bram Moolenaar for this suggestion!
- if (match_words != s:last_words) || (&mps != s:last_mps) ||
- \ exists("b:match_debug")
- let s:last_words = match_words
- let s:last_mps = &mps
- " The next several lines were here before
- " BF started messing with this script.
- " quote the special chars in 'matchpairs', replace [,:] with \| and then
- " append the builtin pairs (/*, */, #if, #ifdef, #else, #elif, #endif)
- " let default = substitute(escape(&mps, '[$^.*~\\/?]'), '[,:]\+',
- " \ '\\|', 'g').'\|\/\*\|\*\/\|#if\>\|#ifdef\>\|#else\>\|#elif\>\|#endif\>'
- let default = escape(&mps, '[$^.*~\\/?]') . (strlen(&mps) ? "," : "") .
- \ '\/\*:\*\/,#if\%(def\)\=:#else\>:#elif\>:#endif\>'
- " s:all = pattern with all the keywords
- let match_words = match_words . (strlen(match_words) ? "," : "") . default
- if match_words !~ s:notslash . '\\\d'
- let s:do_BR = 0
- let s:pat = match_words
- else
- let s:do_BR = 1
- let s:pat = s:ParseWords(match_words)
- endif
- let s:all = substitute(s:pat, s:notslash . '\zs[,:]\+', '\\|', 'g')
- let s:all = '\%(' . s:all . '\)'
- " let s:all = '\%(' . substitute(s:all, '\\\ze[,:]', '', 'g') . '\)'
- if exists("b:match_debug")
- let b:match_pat = s:pat
- endif
- endif
-
- " Second step: set the following local variables:
- " matchline = line on which the cursor started
- " curcol = number of characters before match
- " prefix = regexp for start of line to start of match
- " suffix = regexp for end of match to end of line
- " Require match to end on or after the cursor and prefer it to
- " start on or before the cursor.
- let matchline = getline(startline)
- if a:word != ''
- " word given
- if a:word !~ s:all
- echohl WarningMsg|echo 'Missing rule for word:"'.a:word.'"'|echohl NONE
- return s:CleanUp(restore_options, a:mode, startline, startcol)
- endif
- let matchline = a:word
- let curcol = 0
- let prefix = '^\%('
- let suffix = '\)$'
- " Now the case when "word" is not given
- else " Find the match that ends on or after the cursor and set curcol.
- let regexp = s:Wholematch(matchline, s:all, startcol-1)
- let curcol = match(matchline, regexp)
- " If there is no match, give up.
- if curcol == -1
- return s:CleanUp(restore_options, a:mode, startline, startcol)
- endif
- let endcol = matchend(matchline, regexp)
- let suf = strlen(matchline) - endcol
- let prefix = (curcol ? '^.*\%' . (curcol + 1) . 'c\%(' : '^\%(')
- let suffix = (suf ? '\)\%' . (endcol + 1) . 'c.*$' : '\)$')
- endif
- if exists("b:match_debug")
- let b:match_match = matchstr(matchline, regexp)
- let b:match_col = curcol+1
- endif
-
- " Third step: Find the group and single word that match, and the original
- " (backref) versions of these. Then, resolve the backrefs.
- " Set the following local variable:
- " group = colon-separated list of patterns, one of which matches
- " = ini:mid:fin or ini:fin
- "
- " Reconstruct the version with unresolved backrefs.
- let patBR = substitute(match_words.',',
- \ s:notslash.'\zs[,:]*,[,:]*', ',', 'g')
- let patBR = substitute(patBR, s:notslash.'\zs:\{2,}', ':', 'g')
- " Now, set group and groupBR to the matching group: 'if:endif' or
- " 'while:endwhile' or whatever. A bit of a kluge: s:Choose() returns
- " group . "," . groupBR, and we pick it apart.
- let group = s:Choose(s:pat, matchline, ",", ":", prefix, suffix, patBR)
- let i = matchend(group, s:notslash . ",")
- let groupBR = strpart(group, i)
- let group = strpart(group, 0, i-1)
- " Now, matchline =~ prefix . substitute(group,':','\|','g') . suffix
- if s:do_BR " Do the hard part: resolve those backrefs!
- let group = s:InsertRefs(groupBR, prefix, group, suffix, matchline)
- endif
- if exists("b:match_debug")
- let b:match_wholeBR = groupBR
- let i = matchend(groupBR, s:notslash . ":")
- let b:match_iniBR = strpart(groupBR, 0, i-1)
- endif
-
- " Fourth step: Set the arguments for searchpair().
- let i = matchend(group, s:notslash . ":")
- let j = matchend(group, '.*' . s:notslash . ":")
- let ini = strpart(group, 0, i-1)
- let mid = substitute(strpart(group, i,j-i-1), s:notslash.'\zs:', '\\|', 'g')
- let fin = strpart(group, j)
- "Un-escape the remaining , and : characters.
- let ini = substitute(ini, s:notslash . '\zs\\\(:\|,\)', '\1', 'g')
- let mid = substitute(mid, s:notslash . '\zs\\\(:\|,\)', '\1', 'g')
- let fin = substitute(fin, s:notslash . '\zs\\\(:\|,\)', '\1', 'g')
- " searchpair() requires that these patterns avoid \(\) groups.
- let ini = substitute(ini, s:notslash . '\zs\\(', '\\%(', 'g')
- let mid = substitute(mid, s:notslash . '\zs\\(', '\\%(', 'g')
- let fin = substitute(fin, s:notslash . '\zs\\(', '\\%(', 'g')
- " Set mid. This is optimized for readability, not micro-efficiency!
- if a:forward && matchline =~ prefix . fin . suffix
- \ || !a:forward && matchline =~ prefix . ini . suffix
- let mid = ""
- endif
- " Set flag. This is optimized for readability, not micro-efficiency!
- if a:forward && matchline =~ prefix . fin . suffix
- \ || !a:forward && matchline !~ prefix . ini . suffix
- let flag = "bW"
- else
- let flag = "W"
- endif
- " Set skip.
- if exists("b:match_skip")
- let skip = b:match_skip
- elseif exists("b:match_comment") " backwards compatibility and testing!
- let skip = "r:" . b:match_comment
- else
- let skip = 's:comment\|string'
- endif
- let skip = s:ParseSkip(skip)
- if exists("b:match_debug")
- let b:match_ini = ini
- let b:match_tail = (strlen(mid) ? mid.'\|' : '') . fin
- endif
-
- " Fifth step: actually start moving the cursor and call searchpair().
- " Later, :execute restore_cursor to get to the original screen.
- let restore_cursor = virtcol(".") . "|"
- normal! g0
- let restore_cursor = line(".") . "G" . virtcol(".") . "|zs" . restore_cursor
- normal! H
- let restore_cursor = "normal!" . line(".") . "Gzt" . restore_cursor
- execute restore_cursor
- call cursor(0, curcol + 1)
- " normal! 0
- " if curcol
- " execute "normal!" . curcol . "l"
- " endif
- if skip =~ 'synID' && !(has("syntax") && exists("g:syntax_on"))
- let skip = "0"
- else
- execute "if " . skip . "| let skip = '0' | endif"
- endif
- let sp_return = searchpair(ini, mid, fin, flag, skip)
- let final_position = "call cursor(" . line(".") . "," . col(".") . ")"
- " Restore cursor position and original screen.
- execute restore_cursor
- normal! m'
- if sp_return > 0
- execute final_position
- endif
- return s:CleanUp(restore_options, a:mode, startline, startcol, mid.'\|'.fin)
-endfun
-
-" Restore options and do some special handling for Operator-pending mode.
-" The optional argument is the tail of the matching group.
-fun! s:CleanUp(options, mode, startline, startcol, ...)
- execute "set" a:options
- " Open folds, if appropriate.
- if a:mode != "o"
- if &foldopen =~ "percent"
- normal! zv
- endif
- " In Operator-pending mode, we want to include the whole match
- " (for example, d%).
- " This is only a problem if we end up moving in the forward direction.
- elseif (a:startline < line(".")) ||
- \ (a:startline == line(".") && a:startcol < col("."))
- if a:0
- " Check whether the match is a single character. If not, move to the
- " end of the match.
- let matchline = getline(".")
- let currcol = col(".")
- let regexp = s:Wholematch(matchline, a:1, currcol-1)
- let endcol = matchend(matchline, regexp)
- if endcol > currcol " This is NOT off by one!
- execute "normal!" . (endcol - currcol) . "l"
- endif
- endif " a:0
- endif " a:mode != "o" && etc.
- return 0
-endfun
-
-" Example (simplified HTML patterns): if
-" a:groupBR = '<\(\k\+\)>:</\1>'
-" a:prefix = '^.\{3}\('
-" a:group = '<\(\k\+\)>:</\(\k\+\)>'
-" a:suffix = '\).\{2}$'
-" a:matchline = "123<tag>12" or "123</tag>12"
-" then extract "tag" from a:matchline and return "<tag>:</tag>" .
-fun! s:InsertRefs(groupBR, prefix, group, suffix, matchline)
- if a:matchline !~ a:prefix .
- \ substitute(a:group, s:notslash . '\zs:', '\\|', 'g') . a:suffix
- return a:group
- endif
- let i = matchend(a:groupBR, s:notslash . ':')
- let ini = strpart(a:groupBR, 0, i-1)
- let tailBR = strpart(a:groupBR, i)
- let word = s:Choose(a:group, a:matchline, ":", "", a:prefix, a:suffix,
- \ a:groupBR)
- let i = matchend(word, s:notslash . ":")
- let wordBR = strpart(word, i)
- let word = strpart(word, 0, i-1)
- " Now, a:matchline =~ a:prefix . word . a:suffix
- if wordBR != ini
- let table = s:Resolve(ini, wordBR, "table")
- else
- " let table = "----------"
- let table = ""
- let d = 0
- while d < 10
- if tailBR =~ s:notslash . '\\' . d
- " let table[d] = d
- let table = table . d
- else
- let table = table . "-"
- endif
- let d = d + 1
- endwhile
- endif
- let d = 9
- while d
- if table[d] != "-"
- let backref = substitute(a:matchline, a:prefix.word.a:suffix,
- \ '\'.table[d], "")
- " Are there any other characters that should be escaped?
- let backref = escape(backref, '*,:')
- execute s:Ref(ini, d, "start", "len")
- let ini = strpart(ini, 0, start) . backref . strpart(ini, start+len)
- let tailBR = substitute(tailBR, s:notslash . '\zs\\' . d,
- \ escape(backref, '\\'), 'g')
- endif
- let d = d-1
- endwhile
- if exists("b:match_debug")
- if s:do_BR
- let b:match_table = table
- let b:match_word = word
- else
- let b:match_table = ""
- let b:match_word = ""
- endif
- endif
- return ini . ":" . tailBR
-endfun
-
-" Input a comma-separated list of groups with backrefs, such as
-" a:groups = '\(foo\):end\1,\(bar\):end\1'
-" and return a comma-separated list of groups with backrefs replaced:
-" return '\(foo\):end\(foo\),\(bar\):end\(bar\)'
-fun! s:ParseWords(groups)
- let groups = substitute(a:groups.",", s:notslash.'\zs[,:]*,[,:]*', ',', 'g')
- let groups = substitute(groups, s:notslash . '\zs:\{2,}', ':', 'g')
- let parsed = ""
- while groups =~ '[^,:]'
- let i = matchend(groups, s:notslash . ':')
- let j = matchend(groups, s:notslash . ',')
- let ini = strpart(groups, 0, i-1)
- let tail = strpart(groups, i, j-i-1) . ":"
- let groups = strpart(groups, j)
- let parsed = parsed . ini
- let i = matchend(tail, s:notslash . ':')
- while i != -1
- " In 'if:else:endif', ini='if' and word='else' and then word='endif'.
- let word = strpart(tail, 0, i-1)
- let tail = strpart(tail, i)
- let i = matchend(tail, s:notslash . ':')
- let parsed = parsed . ":" . s:Resolve(ini, word, "word")
- endwhile " Now, tail has been used up.
- let parsed = parsed . ","
- endwhile " groups =~ '[^,:]'
- let parsed = substitute(parsed, ',$', '', '')
- return parsed
-endfun
-
-" TODO I think this can be simplified and/or made more efficient.
-" TODO What should I do if a:start is out of range?
-" Return a regexp that matches all of a:string, such that
-" matchstr(a:string, regexp) represents the match for a:pat that starts
-" as close to a:start as possible, before being preferred to after, and
-" ends after a:start .
-" Usage:
-" let regexp = s:Wholematch(getline("."), 'foo\|bar', col(".")-1)
-" let i = match(getline("."), regexp)
-" let j = matchend(getline("."), regexp)
-" let match = matchstr(getline("."), regexp)
-fun! s:Wholematch(string, pat, start)
- let group = '\%(' . a:pat . '\)'
- let prefix = (a:start ? '\(^.*\%<' . (a:start + 2) . 'c\)\zs' : '^')
- let len = strlen(a:string)
- let suffix = (a:start+1 < len ? '\(\%>'.(a:start+1).'c.*$\)\@=' : '$')
- if a:string !~ prefix . group . suffix
- let prefix = ''
- endif
- return prefix . group . suffix
-endfun
-
-" No extra arguments: s:Ref(string, d) will
-" find the d'th occurrence of '\(' and return it, along with everything up
-" to and including the matching '\)'.
-" One argument: s:Ref(string, d, "start") returns the index of the start
-" of the d'th '\(' and any other argument returns the length of the group.
-" Two arguments: s:Ref(string, d, "foo", "bar") returns a string to be
-" executed, having the effect of
-" :let foo = s:Ref(string, d, "start")
-" :let bar = s:Ref(string, d, "len")
-fun! s:Ref(string, d, ...)
- let len = strlen(a:string)
- if a:d == 0
- let start = 0
- else
- let cnt = a:d
- let match = a:string
- while cnt
- let cnt = cnt - 1
- let index = matchend(match, s:notslash . '\\(')
- if index == -1
- return ""
- endif
- let match = strpart(match, index)
- endwhile
- let start = len - strlen(match)
- if a:0 == 1 && a:1 == "start"
- return start - 2
- endif
- let cnt = 1
- while cnt
- let index = matchend(match, s:notslash . '\\(\|\\)') - 1
- if index == -2
- return ""
- endif
- " Increment if an open, decrement if a ')':
- let cnt = cnt + (match[index]=="(" ? 1 : -1) " ')'
- " let cnt = stridx('0(', match[index]) + cnt
- let match = strpart(match, index+1)
- endwhile
- let start = start - 2
- let len = len - start - strlen(match)
- endif
- if a:0 == 1
- return len
- elseif a:0 == 2
- return "let " . a:1 . "=" . start . "| let " . a:2 . "=" . len
- else
- return strpart(a:string, start, len)
- endif
-endfun
-
-" Count the number of disjoint copies of pattern in string.
-" If the pattern is a literal string and contains no '0' or '1' characters
-" then s:Count(string, pattern, '0', '1') should be faster than
-" s:Count(string, pattern).
-fun! s:Count(string, pattern, ...)
- let pat = escape(a:pattern, '\\')
- if a:0 > 1
- let foo = substitute(a:string, '[^'.a:pattern.']', "a:1", "g")
- let foo = substitute(a:string, pat, a:2, "g")
- let foo = substitute(foo, '[^' . a:2 . ']', "", "g")
- return strlen(foo)
- endif
- let result = 0
- let foo = a:string
- let index = matchend(foo, pat)
- while index != -1
- let result = result + 1
- let foo = strpart(foo, index)
- let index = matchend(foo, pat)
- endwhile
- return result
-endfun
-
-" s:Resolve('\(a\)\(b\)', '\(c\)\2\1\1\2') should return table.word, where
-" word = '\(c\)\(b\)\(a\)\3\2' and table = '-32-------'. That is, the first
-" '\1' in target is replaced by '\(a\)' in word, table[1] = 3, and this
-" indicates that all other instances of '\1' in target are to be replaced
-" by '\3'. The hard part is dealing with nesting...
-" Note that ":" is an illegal character for source and target,
-" unless it is preceded by "\".
-fun! s:Resolve(source, target, output)
- let word = a:target
- let i = matchend(word, s:notslash . '\\\d') - 1
- let table = "----------"
- while i != -2 " There are back references to be replaced.
- let d = word[i]
- let backref = s:Ref(a:source, d)
- " The idea is to replace '\d' with backref. Before we do this,
- " replace any \(\) groups in backref with :1, :2, ... if they
- " correspond to the first, second, ... group already inserted
- " into backref. Later, replace :1 with \1 and so on. The group
- " number w+b within backref corresponds to the group number
- " s within a:source.
- " w = number of '\(' in word before the current one
- let w = s:Count(
- \ substitute(strpart(word, 0, i-1), '\\\\', '', 'g'), '\(', '1')
- let b = 1 " number of the current '\(' in backref
- let s = d " number of the current '\(' in a:source
- while b <= s:Count(substitute(backref, '\\\\', '', 'g'), '\(', '1')
- \ && s < 10
- if table[s] == "-"
- if w + b < 10
- " let table[s] = w + b
- let table = strpart(table, 0, s) . (w+b) . strpart(table, s+1)
- endif
- let b = b + 1
- let s = s + 1
- else
- execute s:Ref(backref, b, "start", "len")
- let ref = strpart(backref, start, len)
- let backref = strpart(backref, 0, start) . ":". table[s]
- \ . strpart(backref, start+len)
- let s = s + s:Count(substitute(ref, '\\\\', '', 'g'), '\(', '1')
- endif
- endwhile
- let word = strpart(word, 0, i-1) . backref . strpart(word, i+1)
- let i = matchend(word, s:notslash . '\\\d') - 1
- endwhile
- let word = substitute(word, s:notslash . '\zs:', '\\', 'g')
- if a:output == "table"
- return table
- elseif a:output == "word"
- return word
- else
- return table . word
- endif
-endfun
-
-" Assume a:comma = ",". Then the format for a:patterns and a:1 is
-" a:patterns = "<pat1>,<pat2>,..."
-" a:1 = "<alt1>,<alt2>,..."
-" If <patn> is the first pattern that matches a:string then return <patn>
-" if no optional arguments are given; return <patn>,<altn> if a:1 is given.
-fun! s:Choose(patterns, string, comma, branch, prefix, suffix, ...)
- let tail = (a:patterns =~ a:comma."$" ? a:patterns : a:patterns . a:comma)
- let i = matchend(tail, s:notslash . a:comma)
- if a:0
- let alttail = (a:1 =~ a:comma."$" ? a:1 : a:1 . a:comma)
- let j = matchend(alttail, s:notslash . a:comma)
- endif
- let current = strpart(tail, 0, i-1)
- if a:branch == ""
- let currpat = current
- else
- let currpat = substitute(current, s:notslash . a:branch, '\\|', 'g')
- endif
- while a:string !~ a:prefix . currpat . a:suffix
- let tail = strpart(tail, i)
- let i = matchend(tail, s:notslash . a:comma)
- if i == -1
- return -1
- endif
- let current = strpart(tail, 0, i-1)
- if a:branch == ""
- let currpat = current
- else
- let currpat = substitute(current, s:notslash . a:branch, '\\|', 'g')
- endif
- if a:0
- let alttail = strpart(alttail, j)
- let j = matchend(alttail, s:notslash . a:comma)
- endif
- endwhile
- if a:0
- let current = current . a:comma . strpart(alttail, 0, j-1)
- endif
- return current
-endfun
-
-" Call this function to turn on debugging information. Every time the main
-" script is run, buffer variables will be saved. These can be used directly
-" or viewed using the menu items below.
-if !exists(":MatchDebug")
- command! -nargs=0 MatchDebug call s:Match_debug()
-endif
-
-fun! s:Match_debug()
- let b:match_debug = 1 " Save debugging information.
- " pat = all of b:match_words with backrefs parsed
- amenu &Matchit.&pat :echo b:match_pat<CR>
- " match = bit of text that is recognized as a match
- amenu &Matchit.&match :echo b:match_match<CR>
- " curcol = cursor column of the start of the matching text
- amenu &Matchit.&curcol :echo b:match_col<CR>
- " wholeBR = matching group, original version
- amenu &Matchit.wh&oleBR :echo b:match_wholeBR<CR>
- " iniBR = 'if' piece, original version
- amenu &Matchit.ini&BR :echo b:match_iniBR<CR>
- " ini = 'if' piece, with all backrefs resolved from match
- amenu &Matchit.&ini :echo b:match_ini<CR>
- " tail = 'else\|endif' piece, with all backrefs resolved from match
- amenu &Matchit.&tail :echo b:match_tail<CR>
- " fin = 'endif' piece, with all backrefs resolved from match
- amenu &Matchit.&word :echo b:match_word<CR>
- " '\'.d in ini refers to the same thing as '\'.table[d] in word.
- amenu &Matchit.t&able :echo '0:' . b:match_table . ':9'<CR>
-endfun
-
-" Jump to the nearest unmatched "(" or "if" or "<tag>" if a:spflag == "bW"
-" or the nearest unmatched "</tag>" or "endif" or ")" if a:spflag == "W".
-" Return a "mark" for the original position, so that
-" let m = MultiMatch("bW", "n") ... execute m
-" will return to the original position. If there is a problem, do not
-" move the cursor and return "", unless a count is given, in which case
-" go up or down as many levels as possible and again return "".
-" TODO This relies on the same patterns as % matching. It might be a good
-" idea to give it its own matching patterns.
-fun! s:MultiMatch(spflag, mode)
- if !exists("b:match_words") || b:match_words == ""
- return ""
- end
- let restore_options = (&ic ? "" : "no") . "ignorecase"
- if exists("b:match_ignorecase")
- let &ignorecase = b:match_ignorecase
- endif
- let startline = line(".")
- let startcol = col(".")
-
- " First step: if not already done, set the script variables
- " s:do_BR flag for whether there are backrefs
- " s:pat parsed version of b:match_words
- " s:all regexp based on s:pat and the default groups
- " This part is copied and slightly modified from s:Match_wrapper().
- let default = escape(&mps, '[$^.*~\\/?]') . (strlen(&mps) ? "," : "") .
- \ '\/\*:\*\/,#if\%(def\)\=:#else\>:#elif\>:#endif\>'
- " Allow b:match_words = "GetVimMatchWords()" .
- if b:match_words =~ ":"
- let match_words = b:match_words
- else
- execute "let match_words =" b:match_words
- endif
- if (match_words != s:last_words) || (&mps != s:last_mps) ||
- \ exists("b:match_debug")
- let s:last_words = match_words
- let s:last_mps = &mps
- if match_words !~ s:notslash . '\\\d'
- let s:do_BR = 0
- let s:pat = match_words
- else
- let s:do_BR = 1
- let s:pat = s:ParseWords(match_words)
- endif
- let s:all = '\%(' . substitute(s:pat . (strlen(s:pat)?",":"") . default,
- \ '[,:]\+','\\|','g') . '\)'
- if exists("b:match_debug")
- let b:match_pat = s:pat
- endif
- endif
-
- " Second step: figure out the patterns for searchpair()
- " and save the screen, cursor position, and 'ignorecase'.
- " - TODO: A lot of this is copied from s:Match_wrapper().
- " - maybe even more functionality should be split off
- " - into separate functions!
- let cdefault = (s:pat =~ '[^,]$' ? "," : "") . default
- let open = substitute(s:pat . cdefault,
- \ s:notslash . '\zs:.\{-}' . s:notslash . ',', '\\),\\(', 'g')
- let open = '\(' . substitute(open, s:notslash . '\zs:.*$', '\\)', '')
- let close = substitute(s:pat . cdefault,
- \ s:notslash . '\zs,.\{-}' . s:notslash . ':', '\\),\\(', 'g')
- let close = substitute(close, '^.\{-}' . s:notslash . ':', '\\(', '') . '\)'
- if exists("b:match_skip")
- let skip = b:match_skip
- elseif exists("b:match_comment") " backwards compatibility and testing!
- let skip = "r:" . b:match_comment
- else
- let skip = 's:comment\|string'
- endif
- let skip = s:ParseSkip(skip)
- " let restore_cursor = line(".") . "G" . virtcol(".") . "|"
- " normal! H
- " let restore_cursor = "normal!" . line(".") . "Gzt" . restore_cursor
- let restore_cursor = virtcol(".") . "|"
- normal! g0
- let restore_cursor = line(".") . "G" . virtcol(".") . "|zs" . restore_cursor
- normal! H
- let restore_cursor = "normal!" . line(".") . "Gzt" . restore_cursor
- execute restore_cursor
-
- " Third step: call searchpair().
- " Replace '\('--but not '\\('--with '\%(' and ',' with '\|'.
- let openpat = substitute(open, '\(\\\@<!\(\\\\\)*\)\@<=\\(', '\\%(', 'g')
- let openpat = substitute(openpat, ',', '\\|', 'g')
- let closepat = substitute(close, '\(\\\@<!\(\\\\\)*\)\@<=\\(', '\\%(', 'g')
- let closepat = substitute(closepat, ',', '\\|', 'g')
- if skip =~ 'synID' && !(has("syntax") && exists("g:syntax_on"))
- let skip = '0'
- else
- execute "if " . skip . "| let skip = '0' | endif"
- endif
- mark '
- let level = v:count1
- while level
- if searchpair(openpat, '', closepat, a:spflag, skip) < 1
- call s:CleanUp(restore_options, a:mode, startline, startcol)
- return ""
- endif
- let level = level - 1
- endwhile
-
- " Restore options and return a string to restore the original position.
- call s:CleanUp(restore_options, a:mode, startline, startcol)
- return restore_cursor
-endfun
-
-" Search backwards for "if" or "while" or "<tag>" or ...
-" and return "endif" or "endwhile" or "</tag>" or ... .
-" For now, this uses b:match_words and the same script variables
-" as s:Match_wrapper() . Later, it may get its own patterns,
-" either from a buffer variable or passed as arguments.
-" fun! s:Autocomplete()
-" echo "autocomplete not yet implemented :-("
-" if !exists("b:match_words") || b:match_words == ""
-" return ""
-" end
-" let startpos = s:MultiMatch("bW")
-"
-" if startpos == ""
-" return ""
-" endif
-" " - TODO: figure out whether 'if' or '<tag>' matched, and construct
-" " - the appropriate closing.
-" let matchline = getline(".")
-" let curcol = col(".") - 1
-" " - TODO: Change the s:all argument if there is a new set of match pats.
-" let regexp = s:Wholematch(matchline, s:all, curcol)
-" let suf = strlen(matchline) - matchend(matchline, regexp)
-" let prefix = (curcol ? '^.\{' . curcol . '}\%(' : '^\%(')
-" let suffix = (suf ? '\).\{' . suf . '}$' : '\)$')
-" " Reconstruct the version with unresolved backrefs.
-" let patBR = substitute(b:match_words.',', '[,:]*,[,:]*', ',', 'g')
-" let patBR = substitute(patBR, ':\{2,}', ':', "g")
-" " Now, set group and groupBR to the matching group: 'if:endif' or
-" " 'while:endwhile' or whatever.
-" let group = s:Choose(s:pat, matchline, ",", ":", prefix, suffix, patBR)
-" let i = matchend(group, s:notslash . ",")
-" let groupBR = strpart(group, i)
-" let group = strpart(group, 0, i-1)
-" " Now, matchline =~ prefix . substitute(group,':','\|','g') . suffix
-" if s:do_BR
-" let group = s:InsertRefs(groupBR, prefix, group, suffix, matchline)
-" endif
-" " let g:group = group
-"
-" " - TODO: Construct the closing from group.
-" let fake = "end" . expand("<cword>")
-" execute startpos
-" return fake
-" endfun
-
-" Close all open structures. "Get the heck out of here!"
-" fun! s:Gthhoh()
-" let close = s:Autocomplete()
-" while strlen(close)
-" put=close
-" let close = s:Autocomplete()
-" endwhile
-" endfun
-
-" Parse special strings as typical skip arguments for searchpair():
-" s:foo becomes (current syntax item) =~ foo
-" S:foo becomes (current syntax item) !~ foo
-" r:foo becomes (line before cursor) =~ foo
-" R:foo becomes (line before cursor) !~ foo
-fun! s:ParseSkip(str)
- let skip = a:str
- if skip[1] == ":"
- if skip[0] == "s"
- let skip = "synIDattr(synID(line('.'),col('.'),1),'name') =~? '" .
- \ strpart(skip,2) . "'"
- elseif skip[0] == "S"
- let skip = "synIDattr(synID(line('.'),col('.'),1),'name') !~? '" .
- \ strpart(skip,2) . "'"
- elseif skip[0] == "r"
- let skip = "strpart(getline('.'),0,col('.'))=~'" . strpart(skip,2). "'"
- elseif skip[0] == "R"
- let skip = "strpart(getline('.'),0,col('.'))!~'" . strpart(skip,2). "'"
- endif
- endif
- return skip
-endfun
-
-let &cpo = s:save_cpo
-
-" vim:sts=2:sw=2:
diff --git a/vim/plugin/snipMate.vim b/vim/plugin/snipMate.vim
deleted file mode 100644
index 16b4dab..0000000
--- a/vim/plugin/snipMate.vim
+++ /dev/null
@@ -1,247 +0,0 @@
-" File: snipMate.vim
-" Author: Michael Sanders
-" Last Updated: July 13, 2009
-" Version: 0.83
-" Description: snipMate.vim implements some of TextMate's snippets features in
-" Vim. A snippet is a piece of often-typed text that you can
-" insert into your document using a trigger word followed by a "<tab>".
-"
-" For more help see snipMate.txt; you can do this by using:
-" :helptags ~/.vim/doc
-" :h snipMate.txt
-
-if exists('loaded_snips') || &cp || version < 700
- finish
-endif
-let loaded_snips = 1
-if !exists('snips_author') | let snips_author = 'Me' | endif
-
-au BufRead,BufNewFile *.snippets\= set ft=snippet
-au FileType snippet setl noet fdm=indent
-
-let s:snippets = {} | let s:multi_snips = {}
-
-if !exists('snippets_dir')
- let snippets_dir = substitute(globpath(&rtp, 'snippets/'), "\n", ',', 'g')
-endif
-
-fun! MakeSnip(scope, trigger, content, ...)
- let multisnip = a:0 && a:1 != ''
- let var = multisnip ? 's:multi_snips' : 's:snippets'
- if !has_key({var}, a:scope) | let {var}[a:scope] = {} | endif
- if !has_key({var}[a:scope], a:trigger)
- let {var}[a:scope][a:trigger] = multisnip ? [[a:1, a:content]] : a:content
- elseif multisnip | let {var}[a:scope][a:trigger] += [[a:1, a:content]]
- else
- echom 'Warning in snipMate.vim: Snippet '.a:trigger.' is already defined.'
- \ .' See :h multi_snip for help on snippets with multiple matches.'
- endif
-endf
-
-fun! ExtractSnips(dir, ft)
- for path in split(globpath(a:dir, '*'), "\n")
- if isdirectory(path)
- let pathname = fnamemodify(path, ':t')
- for snipFile in split(globpath(path, '*.snippet'), "\n")
- call s:ProcessFile(snipFile, a:ft, pathname)
- endfor
- elseif fnamemodify(path, ':e') == 'snippet'
- call s:ProcessFile(path, a:ft)
- endif
- endfor
-endf
-
-" Processes a single-snippet file; optionally add the name of the parent
-" directory for a snippet with multiple matches.
-fun s:ProcessFile(file, ft, ...)
- let keyword = fnamemodify(a:file, ':t:r')
- if keyword == '' | return | endif
- try
- let text = join(readfile(a:file), "\n")
- catch /E484/
- echom "Error in snipMate.vim: couldn't read file: ".a:file
- endtry
- return a:0 ? MakeSnip(a:ft, a:1, text, keyword)
- \ : MakeSnip(a:ft, keyword, text)
-endf
-
-fun! ExtractSnipsFile(file, ft)
- if !filereadable(a:file) | return | endif
- let text = readfile(a:file)
- let inSnip = 0
- for line in text + ["\n"]
- if inSnip && (line[0] == "\t" || line == '')
- let content .= strpart(line, 1)."\n"
- continue
- elseif inSnip
- call MakeSnip(a:ft, trigger, content[:-2], name)
- let inSnip = 0
- endif
-
- if line[:6] == 'snippet'
- let inSnip = 1
- let trigger = strpart(line, 8)
- let name = ''
- let space = stridx(trigger, ' ') + 1
- if space " Process multi snip
- let name = strpart(trigger, space)
- let trigger = strpart(trigger, 0, space - 1)
- endif
- let content = ''
- endif
- endfor
-endf
-
-fun! ResetSnippets()
- let s:snippets = {} | let s:multi_snips = {} | let g:did_ft = {}
-endf
-
-let g:did_ft = {}
-fun! GetSnippets(dir, filetypes)
- for ft in split(a:filetypes, '\.')
- if has_key(g:did_ft, ft) | continue | endif
- call s:DefineSnips(a:dir, ft, ft)
- if ft == 'objc' || ft == 'cpp' || ft == 'cs' || ft == 'xs'
- call s:DefineSnips(a:dir, 'c', ft)
- elseif ft == 'xhtml'
- call s:DefineSnips(a:dir, 'html', 'xhtml')
- endif
- let g:did_ft[ft] = 1
- endfor
-endf
-
-" Define "aliasft" snippets for the filetype "realft".
-fun s:DefineSnips(dir, aliasft, realft)
- for path in split(globpath(a:dir, a:aliasft.'/')."\n".
- \ globpath(a:dir, a:aliasft.'-*/'), "\n")
- call ExtractSnips(path, a:realft)
- endfor
- for path in split(globpath(a:dir, a:aliasft.'.snippets')."\n".
- \ globpath(a:dir, a:aliasft.'-*.snippets'), "\n")
- call ExtractSnipsFile(path, a:realft)
- endfor
-endf
-
-fun! TriggerSnippet()
- if exists('g:SuperTabMappingForward')
- if g:SuperTabMappingForward == "<tab>"
- let SuperTabKey = "\<c-n>"
- elseif g:SuperTabMappingBackward == "<tab>"
- let SuperTabKey = "\<c-p>"
- endif
- endif
-
- if pumvisible() " Update snippet if completion is used, or deal with supertab
- if exists('SuperTabKey')
- call feedkeys(SuperTabKey) | return ''
- endif
- call feedkeys("\<esc>a", 'n') " Close completion menu
- call feedkeys("\<tab>") | return ''
- endif
-
- if exists('g:snipPos') | return snipMate#jumpTabStop(0) | endif
-
- let word = matchstr(getline('.'), '\S\+\%'.col('.').'c')
- for scope in [bufnr('%')] + split(&ft, '\.') + ['_']
- let [trigger, snippet] = s:GetSnippet(word, scope)
- " If word is a trigger for a snippet, delete the trigger & expand
- " the snippet.
- if snippet != ''
- let col = col('.') - len(trigger)
- sil exe 's/\V'.escape(trigger, '/.').'\%#//'
- return snipMate#expandSnip(snippet, col)
- endif
- endfor
-
- if exists('SuperTabKey')
- call feedkeys(SuperTabKey)
- return ''
- endif
- return "\<tab>"
-endf
-
-fun! BackwardsSnippet()
- if exists('g:snipPos') | return snipMate#jumpTabStop(1) | endif
-
- if exists('g:SuperTabMappingForward')
- if g:SuperTabMappingBackward == "<s-tab>"
- let SuperTabKey = "\<c-p>"
- elseif g:SuperTabMappingForward == "<s-tab>"
- let SuperTabKey = "\<c-n>"
- endif
- endif
- if exists('SuperTabKey')
- call feedkeys(SuperTabKey)
- return ''
- endif
- return "\<s-tab>"
-endf
-
-" Check if word under cursor is snippet trigger; if it isn't, try checking if
-" the text after non-word characters is (e.g. check for "foo" in "bar.foo")
-fun s:GetSnippet(word, scope)
- let word = a:word | let snippet = ''
- while snippet == ''
- if exists('s:snippets["'.a:scope.'"]["'.escape(word, '\"').'"]')
- let snippet = s:snippets[a:scope][word]
- elseif exists('s:multi_snips["'.a:scope.'"]["'.escape(word, '\"').'"]')
- let snippet = s:ChooseSnippet(a:scope, word)
- if snippet == '' | break | endif
- else
- if match(word, '\W') == -1 | break | endif
- let word = substitute(word, '.\{-}\W', '', '')
- endif
- endw
- if word == '' && a:word != '.' && stridx(a:word, '.') != -1
- let [word, snippet] = s:GetSnippet('.', a:scope)
- endif
- return [word, snippet]
-endf
-
-fun s:ChooseSnippet(scope, trigger)
- let snippet = []
- let i = 1
- for snip in s:multi_snips[a:scope][a:trigger]
- let snippet += [i.'. '.snip[0]]
- let i += 1
- endfor
- if i == 2 | return s:multi_snips[a:scope][a:trigger][0][1] | endif
- let num = inputlist(snippet) - 1
- return num == -1 ? '' : s:multi_snips[a:scope][a:trigger][num][1]
-endf
-
-fun! ShowAvailableSnips()
- let line = getline('.')
- let col = col('.')
- let word = matchstr(getline('.'), '\S\+\%'.col.'c')
- let words = [word]
- if stridx(word, '.')
- let words += split(word, '\.', 1)
- endif
- let matchlen = 0
- let matches = []
- for scope in [bufnr('%')] + split(&ft, '\.') + ['_']
- let triggers = has_key(s:snippets, scope) ? keys(s:snippets[scope]) : []
- if has_key(s:multi_snips, scope)
- let triggers += keys(s:multi_snips[scope])
- endif
- for trigger in triggers
- for word in words
- if word == ''
- let matches += [trigger] " Show all matches if word is empty
- elseif trigger =~ '^'.word
- let matches += [trigger]
- let len = len(word)
- if len > matchlen | let matchlen = len | endif
- endif
- endfor
- endfor
- endfor
-
- " This is to avoid a bug with Vim when using complete(col - matchlen, matches)
- " (Issue#46 on the Google Code snipMate issue tracker).
- call setline(line('.'), substitute(line, repeat('.', matchlen).'\%'.col.'c', '', ''))
- call complete(col, matches)
- return ''
-endf
-" vim:noet:sw=4:ts=4:ft=vim
diff --git a/vim/plugin/supertab.vim b/vim/plugin/supertab.vim
deleted file mode 100644
index d6ce993..0000000
--- a/vim/plugin/supertab.vim
+++ /dev/null
@@ -1,572 +0,0 @@
-" Author:
-" Original: Gergely Kontra <kgergely@mcl.hu>
-" Current: Eric Van Dewoestine <ervandew@gmail.com> (as of version 0.4)
-" Please direct all correspondence to Eric.
-" Version: 0.49
-"
-" Description: {{{
-" Use your tab key to do all your completion in insert mode!
-" You can cycle forward and backward with the <Tab> and <S-Tab> keys
-" Note: you must press <Tab> once to be able to cycle back
-"
-" http://www.vim.org/scripts/script.php?script_id=1643
-" }}}
-"
-" License: {{{
-" Software License Agreement (BSD License)
-"
-" Copyright (c) 2002 - 2009
-" All rights reserved.
-"
-" Redistribution and use of this software in source and binary forms, with
-" or without modification, are permitted provided that the following
-" conditions are met:
-"
-" * Redistributions of source code must retain the above
-" copyright notice, this list of conditions and the
-" following disclaimer.
-"
-" * Redistributions in binary form must reproduce the above
-" copyright notice, this list of conditions and the
-" following disclaimer in the documentation and/or other
-" materials provided with the distribution.
-"
-" * Neither the name of Gergely Kontra or Eric Van Dewoestine nor the names
-" of its contributors may be used to endorse or promote products derived
-" from this software without specific prior written permission of Gergely
-" Kontra or Eric Van Dewoestine.
-"
-" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
-" IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-" THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
-" CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-" EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-" PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-" }}}
-"
-" Testing Info: {{{
-" Running vim + supertab with the absolute bar minimum settings:
-" $ vim -u NONE -U NONE -c "set nocp | runtime plugin/supertab.vim"
-" }}}
-
-if exists('complType') " Integration with other completion functions.
- finish
-endif
-
-" Global Variables {{{
-
- " Used to set the default completion type.
- " There is no need to escape this value as that will be done for you when
- " the type is set.
- " Ex. let g:SuperTabDefaultCompletionType = "<c-x><c-u>"
- "
- " Note that a special value of 'context' is supported which will result in
- " super tab attempting to use the text preceding the cursor to decide which
- " type of completion to attempt. Currently super tab can recognize method
- " calls or attribute references via '.', '::' or '->', and file path
- " references containing '/'.
- " Ex. let g:SuperTabDefaultCompletionType = 'context'
- " /usr/l<tab> # will use filename completion
- " myvar.t # will use user completion if completefunc set, or omni
- " # completion if omnifunc set.
- " myvar-> # same as above
- "
- " When using context completion, super tab will fall back to a secondary
- " default completion type set by g:SuperTabContextDefaultCompletionType.
- if !exists("g:SuperTabDefaultCompletionType")
- let g:SuperTabDefaultCompletionType = "<c-p>"
- endif
-
- " Sets the default completion type used when g:SuperTabDefaultCompletionType
- " is set to 'context' and the text preceding the cursor does not match any
- " patterns mapped to other specific completion types.
- if !exists("g:SuperTabContextDefaultCompletionType")
- let g:SuperTabContextDefaultCompletionType = "<c-p>"
- endif
-
- " When 'context' completion is enabled, this setting can be used to fallback
- " to g:SuperTabContextDefaultCompletionType as the default for files whose
- " file type occurs in this configured list. This allows you to provide an
- " exclusion for which 'context' completion is not activated.
- if !exists("g:SuperTabContextFileTypeExclusions")
- let g:SuperTabContextFileTypeExclusions = []
- endif
-
- " Used to set a list of variable, completion type pairs used to determine
- " the default completion type to use for the current buffer. If the
- " variable is non-zero and non-empty then the associated completion type
- " will be used.
- " Ex. To use omni or user completion when available, but fall back to the
- " global default otherwise:
- " let g:SuperTabDefaultCompletionTypeDiscovery = [
- " \ "&completefunc:<c-x><c-u>",
- " \ "&omnifunc:<c-x><c-o>",
- " \ ]
- if !exists("g:SuperTabDefaultCompletionTypeDiscovery")
- let g:SuperTabDefaultCompletionTypeDiscovery = []
- endif
-
- " Determines if, and for how long, the current completion type is retained.
- " The possible values include:
- " 0 - The current completion type is only retained for the current completion.
- " Once you have chosen a completion result or exited the completion
- " mode, the default completion type is restored.
- " 1 - The current completion type is saved for the duration of your vim
- " session or until you enter a different completion mode.
- " (SuperTab default).
- " 2 - The current completion type is saved until you exit insert mode (via
- " ESC). Once you exit insert mode the default completion type is
- " restored.
- if !exists("g:SuperTabRetainCompletionType")
- let g:SuperTabRetainCompletionType = 1
- endif
-
- " Sets whether or not mid word completion is enabled.
- " When enabled, <tab> will kick off completion when ever a word character is
- " to the left of the cursor. When disabled, completion will only occur if
- " the char to the left is a word char and the char to the right is not (you
- " are at the end of the word).
- if !exists("g:SuperTabMidWordCompletion")
- let g:SuperTabMidWordCompletion = 1
- endif
-
- " The following two variables allow you to set the key mapping used to kick
- " off the current completion. By default this is <tab> and <s-tab>. To
- " change to something like <c-space> and <s-c-space>, you can add the
- " following to your vimrc.
- "
- " let g:SuperTabMappingForward = '<c-space>'
- " let g:SuperTabMappingBackward = '<s-c-space>'
- "
- " Note: if the above does not have the desired effect (which may happen in
- " console version of vim), you can try the following mappings. Although the
- " backwards mapping still doesn't seem to work in the console for me, your
- " milage may vary.
- "
- " let g:SuperTabMappingForward = '<nul>'
- " let g:SuperTabMappingBackward = '<s-nul>'
- "
- if !exists("g:SuperTabMappingForward")
- let g:SuperTabMappingForward = '<tab>'
- endif
- if !exists("g:SuperTabMappingBackward")
- let g:SuperTabMappingBackward = '<s-tab>'
- endif
-
- " Sets the key mapping used to insert a literal tab where supertab would
- " otherwise attempt to kick off insert completion.
- " The default is '<c-tab>' (ctrl-tab) which unfortunately might not work at
- " the console. So if you are using a console vim and want this
- " functionality, you'll have to change it to something that is supported.
- if !exists("g:SuperTabMappingTabLiteral")
- let g:SuperTabMappingTabLiteral = '<c-tab>'
- endif
-
- " Sets whether or not to pre-highlight first match when completeopt has
- " the popup menu enabled and the 'longest' option as well.
- " When enabled, <tab> will kick off completion and pre-select the first
- " entry in the popup menu, allowing you to simply hit <enter> to use it.
- if !exists("g:SuperTabLongestHighlight")
- let g:SuperTabLongestHighlight = 0
- endif
-
-" }}}
-
-" Script Variables {{{
-
- " construct the help text.
- let s:tabHelp =
- \ "Hit <CR> or CTRL-] on the completion type you wish to switch to.\n" .
- \ "Use :help ins-completion for more information.\n" .
- \ "\n" .
- \ "|<c-n>| - Keywords in 'complete' searching down.\n" .
- \ "|<c-p>| - Keywords in 'complete' searching up (SuperTab default).\n" .
- \ "|<c-x><c-l>| - Whole lines.\n" .
- \ "|<c-x><c-n>| - Keywords in current file.\n" .
- \ "|<c-x><c-k>| - Keywords in 'dictionary'.\n" .
- \ "|<c-x><c-t>| - Keywords in 'thesaurus', thesaurus-style.\n" .
- \ "|<c-x><c-i>| - Keywords in the current and included files.\n" .
- \ "|<c-x><c-]>| - Tags.\n" .
- \ "|<c-x><c-f>| - File names.\n" .
- \ "|<c-x><c-d>| - Definitions or macros.\n" .
- \ "|<c-x><c-v>| - Vim command-line."
- if v:version >= 700
- let s:tabHelp = s:tabHelp . "\n" .
- \ "|<c-x><c-u>| - User defined completion.\n" .
- \ "|<c-x><c-o>| - Omni completion.\n" .
- \ "|<c-x>s| - Spelling suggestions."
- endif
-
- " set the available completion types and modes.
- let s:types =
- \ "\<c-e>\<c-y>\<c-l>\<c-n>\<c-k>\<c-t>\<c-i>\<c-]>\<c-f>\<c-d>\<c-v>\<c-n>\<c-p>"
- let s:modes = '/^E/^Y/^L/^N/^K/^T/^I/^]/^F/^D/^V/^P'
- if v:version >= 700
- let s:types = s:types . "\<c-u>\<c-o>\<c-n>\<c-p>s"
- let s:modes = s:modes . '/^U/^O/s'
- endif
- let s:types = s:types . "np"
- let s:modes = s:modes . '/n/p'
-
-" }}}
-
-" CtrlXPP() {{{
-" Handles entrance into completion mode.
-function! CtrlXPP ()
- if &smd
- echo '' | echo '-- ^X++ mode (' . s:modes . ')'
- endif
- let complType = nr2char(getchar())
- if stridx(s:types, complType) != -1
- if stridx("\<c-e>\<c-y>", complType) != -1 " no memory, just scroll...
- return "\<c-x>" . complType
- elseif stridx('np', complType) != -1
- let complType = nr2char(char2nr(complType) - 96)
- else
- let complType = "\<c-x>" . complType
- endif
-
- if g:SuperTabRetainCompletionType
- let b:complType = complType
- endif
-
- " Hack to workaround appent bug when invoking command line completion via
- " <c-r>=
- if complType == "\<c-x>\<c-v>"
- return s:CommandLineCompletion()
- endif
-
- return complType
- endif
-
- echohl "Unknown mode"
- return complType
-endfunction " }}}
-
-" SuperTabSetCompletionType(type) {{{
-" Globally available function that user's can use to create mappings to
-" quickly switch completion modes. Useful when a user wants to restore the
-" default or switch to another mode without having to kick off a completion
-" of that type or use SuperTabHelp.
-" Example mapping to restore SuperTab default:
-" nmap <F6> :call SetSuperTabCompletionType("<c-p>")<cr>
-function! SuperTabSetCompletionType (type)
- exec "let b:complType = \"" . escape(a:type, '<') . "\""
-endfunction " }}}
-
-" s:Init {{{
-" Global initilization when supertab is loaded.
-function! s:Init ()
- augroup supertab_init
- autocmd!
- autocmd BufEnter * call <SID>InitBuffer()
- augroup END
-
- " ensure InitBuffer gets called for the first buffer, after the ftplugins
- " have been called.
- augroup supertab_init_first
- autocmd!
- autocmd FileType <buffer> call <SID>InitBuffer()
- augroup END
-
- " Setup mechanism to restore orignial completion type upon leaving insert
- " mode if g:SuperTabRetainCompletionType == 2
- if g:SuperTabRetainCompletionType == 2
- " pre vim 7, must map <esc>
- if v:version < 700
- imap <silent> <ESC> <ESC>:call s:SetDefaultCompletionType()<cr>
-
- " since vim 7, we can use InsertLeave autocmd.
- else
- augroup supertab_retain
- autocmd!
- autocmd InsertLeave * call s:SetDefaultCompletionType()
- augroup END
- endif
- endif
-endfunction " }}}
-
-" s:InitBuffer {{{
-" Per buffer initilization.
-function! s:InitBuffer ()
- if exists("b:complType")
- return
- endif
-
- " init hack for <c-x><c-v> workaround.
- let b:complCommandLine = 0
-
- if !exists("b:SuperTabDefaultCompletionType")
- " loop through discovery list to find the default
- if !empty(g:SuperTabDefaultCompletionTypeDiscovery)
- " backward compatiability with old string value.
- if type(g:SuperTabDefaultCompletionTypeDiscovery) == 1
- let dlist = split(g:SuperTabDefaultCompletionTypeDiscovery, ',')
- else
- let dlist = g:SuperTabDefaultCompletionTypeDiscovery
- endif
- for pair in dlist
- let var = substitute(pair, '\(.*\):.*', '\1', '')
- let type = substitute(pair, '.*:\(.*\)', '\1', '')
- exec 'let value = ' . var
- if value !~ '^\s*$' && value != '0'
- let b:SuperTabDefaultCompletionType = type
- break
- endif
- endfor
- endif
-
- " fallback to configured default.
- if !exists("b:SuperTabDefaultCompletionType")
- let b:SuperTabDefaultCompletionType = g:SuperTabDefaultCompletionType
- endif
- endif
-
- " set the default completion type.
- call SuperTabSetCompletionType(b:SuperTabDefaultCompletionType)
-endfunction " }}}
-
-" s:IsWordChar(char) {{{
-" Determines if the supplied character is a word character or matches value
-" defined by 'iskeyword'.
-function! s:IsWordChar (char)
- if a:char =~ '\w'
- return 1
- endif
-
- " check against 'iskeyword'
- let values = &iskeyword
- let index = stridx(values, ',')
- while index > 0 || values != ''
- if index > 0
- let value = strpart(values, 0, index)
- let values = strpart(values, index + 1)
- else
- let value = values
- let values = ''
- endif
-
- " exception case for '^,'
- if value == '^'
- let value = '^,'
-
- " execption case for ','
- elseif value =~ '^,,'
- let values .= strpart(value, 2)
- let value = ','
-
- " execption case after a ^,
- elseif value =~ '^,'
- let value = strpart(value, 1)
- endif
-
- " keyword values in an ascii number range
- if value =~ '[0-9]\+-[0-9]\+'
- let charnum = char2nr(a:char)
- exec 'let start = ' . substitute(value, '\([0-9]\+\)-.*', '\1', '')
- exec 'let end = ' . substitute(value, '.*-\([0-9]\+\)', '\1', '')
-
- if charnum >= start && charnum <= end
- return 1
- endif
-
- " keyword value is a set of include or exclude characters
- else
- let include = 1
- if value =~ '^\^'
- let value = strpart(value, 1)
- let include = 0
- endif
-
- if a:char =~ '[' . escape(value, '[]') . ']'
- return include
- endif
- endif
- let index = stridx(values, ',')
- endwhile
-
- return 0
-endfunction " }}}
-
-" s:SetCompletionType() {{{
-" Sets the completion type based on what the user has chosen from the help
-" buffer.
-function! s:SetCompletionType ()
- let chosen = substitute(getline('.'), '.*|\(.*\)|.*', '\1', '')
- if chosen != getline('.')
- let winnr = b:winnr
- close
- exec winnr . 'winc w'
- call SuperTabSetCompletionType(chosen)
- endif
-endfunction " }}}
-
-" s:SetDefaultCompletionType() {{{
-function! s:SetDefaultCompletionType ()
- if exists('b:SuperTabDefaultCompletionType') && !b:complCommandLine
- call SuperTabSetCompletionType(b:SuperTabDefaultCompletionType)
- endif
-endfunction " }}}
-
-" s:SuperTab(command) {{{
-" Used to perform proper cycle navigation as the user requests the next or
-" previous entry in a completion list, and determines whether or not to simply
-" retain the normal usage of <tab> based on the cursor position.
-function! s:SuperTab (command)
- if s:WillComplete()
- " rare case where no autocmds have fired for this buffer to initialize the
- " supertab vars.
- call s:InitBuffer()
-
- let key = ''
- " highlight first result if longest enabled
- if g:SuperTabLongestHighlight && !pumvisible() && &completeopt =~ 'longest'
- let key = (b:complType == "\<c-p>") ? "\<c-p>" : "\<c-n>"
- endif
-
- " exception: if in <c-p> mode, then <c-n> should move up the list, and
- " <c-p> down the list.
- if a:command == 'p' &&
- \ (b:complType == "\<c-p>" ||
- \ (b:complType == 'context' &&
- \ tolower(g:SuperTabContextDefaultCompletionType) == '<c-p>'))
- return "\<c-n>"
- endif
-
- if b:complType == 'context'
- if index(g:SuperTabContextFileTypeExclusions, &ft) == -1
- let curline = getline('.')
- let cnum = col('.')
- let synname = synIDattr(synID(line('.'), cnum - 1, 1), 'name')
- if curline =~ '.*/\w*\%' . cnum . 'c' ||
- \ ((has('win32') || has('win64')) && curline =~ '.*\\\w*\%' . cnum . 'c')
- return "\<c-x>\<c-f>" . key
- elseif curline =~ '.*\(\w\|[\])]\)\(\.\|::\|->\)\w*\%' . cnum . 'c' &&
- \ synname !~ '\(String\|Comment\)'
- if &completefunc != ''
- return "\<c-x>\<c-u>" . key
- elseif &omnifunc != ''
- return "\<c-x>\<c-o>" . key
- endif
- endif
- endif
- exec "let complType = \"" . escape(g:SuperTabContextDefaultCompletionType, '<') . "\""
- return complType . key
- endif
-
- " Hack to workaround appent bug when invoking command line completion via
- " <c-r>=
- if b:complType == "\<c-x>\<c-v>"
- return s:CommandLineCompletion()
- endif
- return b:complType . key
- endif
-
- return "\<tab>"
-endfunction " }}}
-
-" s:SuperTabHelp() {{{
-" Opens a help window where the user can choose a completion type to enter.
-function! s:SuperTabHelp ()
- let winnr = winnr()
- if bufwinnr("SuperTabHelp") == -1
- botright split SuperTabHelp
-
- setlocal noswapfile
- setlocal buftype=nowrite
- setlocal bufhidden=delete
-
- let saved = @"
- let @" = s:tabHelp
- silent put
- call cursor(1, 1)
- silent 1,delete
- call cursor(4, 1)
- let @" = saved
- exec "resize " . line('$')
-
- syntax match Special "|.\{-}|"
-
- setlocal readonly
- setlocal nomodifiable
-
- nmap <silent> <buffer> <cr> :call <SID>SetCompletionType()<cr>
- nmap <silent> <buffer> <c-]> :call <SID>SetCompletionType()<cr>
- else
- exec bufwinnr("SuperTabHelp") . "winc w"
- endif
- let b:winnr = winnr
-endfunction " }}}
-
-" s:WillComplete() {{{
-" Determines if completion should be kicked off at the current location.
-function! s:WillComplete ()
- let line = getline('.')
- let cnum = col('.')
-
- " Start of line.
- let prev_char = strpart(line, cnum - 2, 1)
- if prev_char =~ '^\s*$'
- return 0
- endif
-
- " Within a word, but user does not have mid word completion enabled.
- let next_char = strpart(line, cnum - 1, 1)
- if !g:SuperTabMidWordCompletion && s:IsWordChar(next_char)
- return 0
- endif
-
- " In keyword completion mode and no preceding word characters.
- "if (b:complType == "\<c-n>" || b:complType == "\<c-p>") && !s:IsWordChar(prev_char)
- " return 0
- "endif
-
- return 1
-endfunction " }}}
-
-" s:CommandLineCompletion() {{{
-" Hack needed to account for apparent bug in vim command line mode completion
-" when invoked via <c-r>=
-function! s:CommandLineCompletion()
- " This hack will trigger InsertLeave which will then invoke
- " s:SetDefaultCompletionType. To prevent default completion from being
- " restored prematurely, set an internal flag for s:SetDefaultCompletionType
- " to check for.
- let b:complCommandLine = 1
- return "\<c-\>\<c-o>:call feedkeys('\<c-x>\<c-v>\<c-v>', 'n') | " .
- \ "let b:complCommandLine = 0\<cr>"
-endfunction " }}}
-
-" Key Mappings {{{
- " map a regular tab to ctrl-tab (note: doesn't work in console vim)
- exec 'inoremap ' . g:SuperTabMappingTabLiteral . ' <tab>'
-
- imap <c-x> <c-r>=CtrlXPP()<cr>
-
- " From the doc |insert.txt| improved
- exec 'imap ' . g:SuperTabMappingForward . ' <c-n>'
- exec 'imap ' . g:SuperTabMappingBackward . ' <c-p>'
-
- " After hitting <Tab>, hitting it once more will go to next match
- " (because in XIM mode <c-n> and <c-p> mappings are ignored)
- " and wont start a brand new completion
- " The side effect, that in the beginning of line <c-n> and <c-p> inserts a
- " <Tab>, but I hope it may not be a problem...
- inoremap <c-n> <c-r>=<SID>SuperTab('n')<cr>
- inoremap <c-p> <c-r>=<SID>SuperTab('p')<cr>
-" }}}
-
-" Command Mappings {{{
- if !exists(":SuperTabHelp")
- command SuperTabHelp :call <SID>SuperTabHelp()
- endif
-" }}}
-
-call s:Init()
-
-" vim:ft=vim:fdm=marker
diff --git a/vim/plugin/tcomment.vim b/vim/plugin/tcomment.vim
deleted file mode 100644
index eac8270..0000000
--- a/vim/plugin/tcomment.vim
+++ /dev/null
@@ -1,143 +0,0 @@
-" tComment.vim -- An easily extensible & universal comment plugin
-" @Author: Tom Link (micathom AT gmail com)
-" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
-" @Created: 27-Dez-2004.
-" @Last Change: 2010-12-07.
-" @Revision: 716
-"
-" GetLatestVimScripts: 1173 1 tcomment.vim
-
-if &cp || exists('loaded_tcomment')
- finish
-endif
-let loaded_tcomment = 204
-
-if !exists("g:tcommentMapLeader1")
- " g:tcommentMapLeader1 should be a shortcut that can be used with
- " map, imap, vmap.
- let g:tcommentMapLeader1 = '<c-_>'
-endif
-if !exists("g:tcommentMapLeader2")
- " g:tcommentMapLeader2 should be a shortcut that can be used with
- " map, xmap.
- let g:tcommentMapLeader2 = '<Leader>_'
-endif
-if !exists("g:tcommentMapLeaderOp1")
- let g:tcommentMapLeaderOp1 = 'gc'
-endif
-if !exists("g:tcommentMapLeaderOp2")
- let g:tcommentMapLeaderOp2 = 'gC'
-endif
-
-
-" :display: :[range]TComment[!] ?ARGS...
-" If there is a visual selection that begins and ends in the same line,
-" then |:TCommentInline| is used instead.
-" The optional range defaults to the current line. With a bang '!',
-" always comment the line.
-"
-" ARGS... are either (see also |tcomment#Comment()|):
-" 1. a list of key=value pairs
-" 2. 1-2 values for: ?commentBegin, ?commentEnd
-command! -bang -range -nargs=* -complete=customlist,tcomment#CompleteArgs TComment
- \ keepjumps call tcomment#Comment(<line1>, <line2>, 'G', "<bang>", <f-args>)
-
-" :display: :[range]TCommentAs[!] commenttype ?ARGS...
-" TCommentAs requires g:tcomment_{filetype} to be defined.
-" With a bang '!', always comment the line.
-"
-" ARGS... are either (see also |tcomment#Comment()|):
-" 1. a list of key=value pairs
-" 2. 1-2 values for: ?commentBegin, ?commentEnd
-command! -bang -complete=customlist,tcomment#Complete -range -nargs=+ TCommentAs
- \ call tcomment#CommentAs(<line1>, <line2>, "<bang>", <f-args>)
-
-" :display: :[range]TCommentRight[!] ?ARGS...
-" Comment the text to the right of the cursor. If a visual selection was
-" made (be it block-wise or not), all lines are commented out at from
-" the current cursor position downwards.
-" With a bang '!', always comment the line.
-"
-" ARGS... are either (see also |tcomment#Comment()|):
-" 1. a list of key=value pairs
-" 2. 1-2 values for: ?commentBegin, ?commentEnd
-command! -bang -range -nargs=* -complete=customlist,tcomment#CompleteArgs TCommentRight
- \ keepjumps call tcomment#Comment(<line1>, <line2>, 'R', "<bang>", <f-args>)
-
-" :display: :[range]TCommentBlock[!] ?ARGS...
-" Comment as "block", e.g. use the {&ft}_block comment style. The
-" commented text isn't indented or reformated.
-" With a bang '!', always comment the line.
-"
-" ARGS... are either (see also |tcomment#Comment()|):
-" 1. a list of key=value pairs
-" 2. 1-2 values for: ?commentBegin, ?commentEnd
-command! -bang -range -nargs=* -complete=customlist,tcomment#CompleteArgs TCommentBlock
- \ keepjumps call tcomment#Comment(<line1>, <line2>, 'B', "<bang>", <f-args>)
-
-" :display: :[range]TCommentInline[!] ?ARGS...
-" Use the {&ft}_inline comment style.
-" With a bang '!', always comment the line.
-"
-" ARGS... are either (see also |tcomment#Comment()|):
-" 1. a list of key=value pairs
-" 2. 1-2 values for: ?commentBegin, ?commentEnd
-command! -bang -range -nargs=* -complete=customlist,tcomment#CompleteArgs TCommentInline
- \ keepjumps call tcomment#Comment(<line1>, <line2>, 'I', "<bang>", <f-args>)
-
-" :display: :[range]TCommentMaybeInline[!] ?ARGS...
-" With a bang '!', always comment the line.
-"
-" ARGS... are either (see also |tcomment#Comment()|):
-" 1. a list of key=value pairs
-" 2. 1-2 values for: ?commentBegin, ?commentEnd
-command! -bang -range -nargs=* -complete=customlist,tcomment#CompleteArgs TCommentMaybeInline
- \ keepjumps call tcomment#Comment(<line1>, <line2>, 'i', "<bang>", <f-args>)
-
-
-
-if (g:tcommentMapLeader1 != '')
- exec 'noremap <silent> '. g:tcommentMapLeader1 . g:tcommentMapLeader1 .' :TComment<cr>'
- exec 'vnoremap <silent> '. g:tcommentMapLeader1 . g:tcommentMapLeader1 .' :TCommentMaybeInline<cr>'
- exec 'inoremap <silent> '. g:tcommentMapLeader1 . g:tcommentMapLeader1 .' <c-o>:TComment<cr>'
- exec 'noremap <silent> '. g:tcommentMapLeader1 .'p m`vip:TComment<cr>``'
- exec 'inoremap <silent> '. g:tcommentMapLeader1 .'p <c-o>:norm! m`vip<cr>:TComment<cr><c-o>``'
- exec 'noremap '. g:tcommentMapLeader1 .'<space> :TComment '
- exec 'inoremap '. g:tcommentMapLeader1 .'<space> <c-o>:TComment '
- exec 'inoremap <silent> '. g:tcommentMapLeader1 .'r <c-o>:TCommentRight<cr>'
- exec 'noremap <silent> '. g:tcommentMapLeader1 .'r :TCommentRight<cr>'
- exec 'vnoremap <silent> '. g:tcommentMapLeader1 .'i :TCommentInline<cr>'
- exec 'vnoremap <silent> '. g:tcommentMapLeader1 .'r :TCommentRight<cr>'
- exec 'noremap '. g:tcommentMapLeader1 .'b :TCommentBlock<cr>'
- exec 'inoremap '. g:tcommentMapLeader1 .'b <c-o>:TCommentBlock<cr>'
- exec 'noremap '. g:tcommentMapLeader1 .'a :TCommentAs '
- exec 'inoremap '. g:tcommentMapLeader1 .'a <c-o>:TCommentAs '
- exec 'noremap '. g:tcommentMapLeader1 .'n :TCommentAs <c-r>=&ft<cr> '
- exec 'inoremap '. g:tcommentMapLeader1 .'n <c-o>:TCommentAs <c-r>=&ft<cr> '
- exec 'noremap '. g:tcommentMapLeader1 .'s :TCommentAs <c-r>=&ft<cr>_'
- exec 'inoremap '. g:tcommentMapLeader1 .'s <c-o>:TCommentAs <c-r>=&ft<cr>_'
-endif
-if (g:tcommentMapLeader2 != '')
- exec 'noremap <silent> '. g:tcommentMapLeader2 .'_ :TComment<cr>'
- exec 'xnoremap <silent> '. g:tcommentMapLeader2 .'_ :TCommentMaybeInline<cr>'
- exec 'noremap <silent> '. g:tcommentMapLeader2 .'p vip:TComment<cr>'
- exec 'noremap '. g:tcommentMapLeader2 .'<space> :TComment '
- exec 'xnoremap <silent> '. g:tcommentMapLeader2 .'i :TCommentInline<cr>'
- exec 'noremap <silent> '. g:tcommentMapLeader2 .'r :TCommentRight<cr>'
- exec 'xnoremap <silent> '. g:tcommentMapLeader2 .'r :TCommentRight<cr>'
- exec 'noremap '. g:tcommentMapLeader2 .'b :TCommentBlock<cr>'
- exec 'noremap '. g:tcommentMapLeader2 .'a :TCommentAs '
- exec 'noremap '. g:tcommentMapLeader2 .'n :TCommentAs <c-r>=&ft<cr> '
- exec 'noremap '. g:tcommentMapLeader2 .'s :TCommentAs <c-r>=&ft<cr>_'
-endif
-if (g:tcommentMapLeaderOp1 != '')
- exec 'nnoremap <silent> '. g:tcommentMapLeaderOp1 .' :let w:tcommentPos = getpos(".") \| set opfunc=tcomment#Operator<cr>g@'
- exec 'nnoremap <silent> '. g:tcommentMapLeaderOp1 .'c :let w:tcommentPos = getpos(".") \| set opfunc=tcomment#OperatorLine<cr>g@$'
- exec 'xnoremap <silent> '. g:tcommentMapLeaderOp1 .' :TCommentMaybeInline<cr>'
-endif
-if (g:tcommentMapLeaderOp2 != '')
- exec 'nnoremap <silent> '. g:tcommentMapLeaderOp2 .' :let w:tcommentPos = getpos(".") \| set opfunc=tcomment#OperatorAnyway<cr>g@'
- exec 'nnoremap <silent> '. g:tcommentMapLeaderOp2 .'c :let w:tcommentPos = getpos(".") \| set opfunc=tcomment#OperatorLineAnyway<cr>g@$'
- exec 'xnoremap <silent> '. g:tcommentMapLeaderOp2 .' :TCommentMaybeInline<cr>'
-endif
-
diff --git a/vim/plugin/textobj.vim b/vim/plugin/textobj.vim
deleted file mode 100644
index 01345bc..0000000
--- a/vim/plugin/textobj.vim
+++ /dev/null
@@ -1,239 +0,0 @@
-" Text object creation {{{
-" XXX: use virtualedit here, it should greatly simplify things
-let s:text_object_number = 0
-function Textobj(char, callback, ...)
- let s:text_object_number += 1
- function s:textobj_{s:text_object_number}(inner, operator, count, callback, ...)
- try
- let pos = getpos('.')
- sandbox let [startline, startcol, endline, endcol] = call(a:callback, [a:inner, a:count] + a:000)
- catch /no-match/
- return
- finally
- call setpos('.', pos)
- endtry
- if startline == endline
- let objlength = endcol - startcol + 1
- else
- let objlength = 0
- if endline - startline > 1
- exe 'let objlength += '.join(map(getline(startline + 1, endline - 1), 'strlen(v:val) + 1'), '+')
- endif
- let objlength += endcol + strlen(getline(startline)) - startcol + 2
- endif
- let whichwrap = &whichwrap
- set whichwrap+=s
- let virtualedit = &virtualedit
- if startcol > strlen(getline(startline))
- let startcol = 1
- let startline += 1
- let objlength -= 1
- endif
- if endcol == 0
- set virtualedit=onemore
- endif
- if a:operator == 'v'
- let objlength -= 1
- endif
- call cursor(startline, startcol)
- if a:operator == 'c'
- let operator = 'd'
- else
- let operator = a:operator
- end
- exe 'normal! '.operator.objlength.' '
-
- if a:operator == 'c'
- startinsert
- endif
- let &whichwrap = whichwrap
- let &virtualedit = virtualedit
- endfunction
-
- exe 'onoremap <silent>a'.a:char.' <Esc>:call call("<SID>textobj_'.s:text_object_number.'", [0, v:operator, v:prevcount, "'.a:callback.'"] + '.string(a:000).')<CR>'
- exe 'onoremap <silent>i'.a:char.' <Esc>:call call("<SID>textobj_'.s:text_object_number.'", [1, v:operator, v:prevcount, "'.a:callback.'"] + '.string(a:000).')<CR>'
- exe 'xnoremap <silent>a'.a:char.' <Esc>:call call("<SID>textobj_'.s:text_object_number.'", [0, "v", v:prevcount, "'.a:callback.'"] + '.string(a:000).')<CR>'
- exe 'xnoremap <silent>i'.a:char.' <Esc>:call call("<SID>textobj_'.s:text_object_number.'", [1, "v", v:prevcount, "'.a:callback.'"] + '.string(a:000).')<CR>'
-endfunction
-" }}}
-" Text object definitions {{{
-" arbitrary paired symbols (/ for regex, etc) {{{
-function Textobj_paired(inner, count, char)
- let pos = getpos('.')
-
- let line = strpart(getline(pos[1]), 0, pos[2])
- let lines = getline(1, pos[1] - 1) + [line]
- let linenum = pos[1]
- for line in reverse(lines)
- let objstart = match(line, '.*\zs\\\@<!'.a:char) + 1
- if objstart != 0
- break
- endif
- let linenum -= 1
- endfor
- if objstart == 0
- throw 'no-match'
- endif
- let objstart += a:inner
- let objstartline = linenum
-
- let line = strpart(getline(pos[1]), pos[2] - 1)
- let lines = [line] + getline(pos[1] + 1, line('$'))
- let linenum = pos[1]
- for line in lines
- let objend = match(line, '\\\@<!'.a:char) + 1
- if objend != 0
- if linenum == pos[1]
- " have to account for the possibility of a split escape
- " sequence
- if objend == 1
- if getline(pos[1])[pos[2] - 2] == '\'
- let objend = match(line, '\\\@<!'.a:char, 1) + 1
- if objend == 0
- let linenum += 1
- continue
- endif
- else
- " if we're sitting on a char, don't do anything, since
- " it's impossible to know which direction to look
- throw 'no-match'
- endif
- endif
- let objend += pos[2] - 1
- endif
- break
- endif
- let linenum += 1
- endfor
- if objend == 0
- throw 'no-match'
- endif
- let objend -= a:inner
- let objendline = linenum
-
- return [objstartline, objstart, objendline, objend]
-endfunction
-" }}}
-" f for folds {{{
-function Textobj_fold(inner, count)
- if foldlevel(line('.')) == 0
- throw 'no-match'
- endif
- exe 'normal! '.a:count.'[z'
- let startline = line('.') + a:inner
- normal! ]z
- let endline = line('.') - a:inner
-
- return [startline, 1, endline, strlen(getline(endline))]
-endfunction
-" }}}
-" , for function arguments {{{
-function Textobj_arg(inner, count)
- let pos = getpos('.')
- let curchar = getline(pos[1])[pos[2] - 1]
- if curchar == ','
- if getline(pos[1])[pos[2] - 2] =~ '\s'
- normal! gE
- else
- exe "normal! \<BS>"
- endif
- return s:textobj_arg(a:inner, a:count)
- elseif curchar =~ '\s'
- normal! W
- return s:textobj_arg(a:inner, a:count)
- endif
-
- let line = strpart(getline(pos[1]), 0, pos[2])
- let lines = getline(1, pos[1] - 1) + [line]
- let linenum = pos[1]
- for line in reverse(lines)
- let argbegin = matchend(line, '.*\%(,\s*\|(\)') + 1
- if argbegin != 0
- while argbegin > strlen(line)
- let linenum += 1
- let line = getline(linenum)
- let argbegin = matchend(line, '^\s*') + 1
- endwhile
- break
- endif
- let linenum -= 1
- endfor
- if argbegin == 0
- throw 'no-match'
- endif
- let argstartline = linenum
-
- let line = strpart(getline(pos[1]), pos[2] - 1)
- let lines = [line] + getline(pos[1] + 1, line('$'))
- let linenum = pos[1]
- for line in lines
- let argend = match(line, '\zs.\?\%(,\|)\)') + 1
- if argend != 0
- if linenum == pos[1]
- let argend += pos[2] - 1
- endif
- if argend == 1 && getline(linenum)[argend - 1] == ')'
- let linenum -= 1
- let argend = strlen(getline(linenum))
- endif
- break
- endif
- let linenum += 1
- endfor
- if argend == 0
- throw 'no-match'
- endif
- let argendline = linenum
-
- if a:inner == 0
- let endline = getline(argendline)
- let startline = getline(argstartline)
- if argend >= strlen(endline)
- let argend = 0
- let argendline += 1
- let endline = getline(argendline)
- endif
- if endline[argend] == ')' && startline[argbegin - 2] != '('
- let argbegin = match(strpart(startline, 0, argbegin - 1), '\s*$')
- while argbegin == 0
- let argstartline -= 1
- let startline = getline(argstartline)
- let argbegin = strlen(startline)
- endwhile
- elseif endline[argend] != ')'
- let argend += matchend(strpart(endline, argend + 1), '^\s*') + 1
- if startline[argbegin - 2] == '('
- for line in [strpart(endline, argend)] +
- \ getline(argendline + 1, line('$'))
- let argincr = matchend(line, '\s*\ze\S')
- if argincr != -1
- let argend += argincr
- break
- endif
- let argendline += 1
- let argend = 0
- endfor
- endif
- endif
- if argend >= strlen(endline)
- if argendline == argstartline
- let newbegin = matchend(strpart(endline, 0, argbegin), '.*,')
- if newbegin != -1
- let argbegin = newbegin + 1
- endif
- endif
- let argend = 0
- let argendline += 1
- endif
- endif
-
- return [argstartline, argbegin, argendline, argend]
-endfunction
-" }}}
-" }}}
-" Text object loading {{{
-for object in g:Textobj_defs
- call call('Textobj', object)
-endfor
-unlet object
-" }}}
diff --git a/vim/plugin/yankring.vim b/vim/plugin/yankring.vim
deleted file mode 100644
index 5b8d0af..0000000
--- a/vim/plugin/yankring.vim
+++ /dev/null
@@ -1,2499 +0,0 @@
-" yankring.vim - Yank / Delete Ring for Vim
-" ---------------------------------------------------------------
-" Version: 11.0
-" Authors: David Fishburn <dfishburn.vim@gmail.com>
-" Last Modified: 2010 Aug 09
-" Script: http://www.vim.org/scripts/script.php?script_id=1234
-" Based On: Mocked up version by Yegappan Lakshmanan
-" http://groups.yahoo.com/group/vim/post?act=reply&messageNum=34406
-" License: GPL (Gnu Public License)
-" GetLatestVimScripts: 1234 1 :AutoInstall: yankring.vim
-
-if exists('loaded_yankring') || &cp
- finish
-endif
-
-if v:version < 700
- echomsg 'yankring: You need at least Vim 7.0'
- finish
-endif
-
-let loaded_yankring = 110
-
-let s:yr_has_voperator = 0
-if v:version > 701 || ( v:version == 701 && has("patch205") )
- let s:yr_has_voperator = 1
-endif
-
-if !exists('g:yankring_history_dir')
- let g:yankring_history_dir = expand('$HOME')
-else
- let g:yankring_history_dir = expand(g:yankring_history_dir)
-endif
-
-if !exists('g:yankring_history_file')
- let g:yankring_history_file = 'yankring_history'
-endif
-
-" Allow the user to override the # of yanks/deletes recorded
-if !exists('g:yankring_max_history')
- let g:yankring_max_history = 100
-elseif g:yankring_max_history < 0
- let g:yankring_max_history = 100
-endif
-
-" Specify the minimum length of 1 entry
-if !exists('g:yankring_min_element_length')
- let g:yankring_min_element_length = 1
-endif
-
-" Specify the maximum length of 1 entry (1MB default)
-if !exists('g:yankring_max_element_length')
- let g:yankring_max_element_length = 1048576
-endif
-
-" Warn if truncation occurs
-if !exists('g:yankring_warn_on_truncate')
- let g:yankring_warn_on_truncate = 1
-endif
-
-" Allow the user to specify if the plugin is enabled or not
-if !exists('g:yankring_enabled')
- let g:yankring_enabled = 1
-endif
-
-" Specify max display length for each element for YRShow
-if !exists('g:yankring_max_display')
- let g:yankring_max_display = 0
-endif
-
-" Check if yankring should persist between Vim instances
-if !exists('g:yankring_persist')
- let g:yankring_persist = 1
-endif
-
-" Check if yankring share 1 file between all instances of Vim
-if !exists('g:yankring_share_between_instances')
- let g:yankring_share_between_instances = 1
-endif
-
-" Specify whether the results of the ring should be displayed
-" in a separate buffer window instead of the use of echo
-if !exists('g:yankring_window_use_separate')
- let g:yankring_window_use_separate = 1
-endif
-
-" Specifies whether the window is closed after an action
-" is performed
-if !exists('g:yankring_window_auto_close')
- let g:yankring_window_auto_close = 1
-endif
-
-" When displaying the buffer, how many lines should it be
-if !exists('g:yankring_window_height')
- let g:yankring_window_height = 8
-endif
-
-" When displaying the buffer, how many lines should it be
-if !exists('g:yankring_window_width')
- let g:yankring_window_width = 30
-endif
-
-" When displaying the buffer, where it should be placed
-if !exists('g:yankring_window_use_horiz')
- let g:yankring_window_use_horiz = 1
-endif
-
-" When displaying the buffer, where it should be placed
-if !exists('g:yankring_window_use_bottom')
- let g:yankring_window_use_bottom = 1
-endif
-
-" When displaying the buffer, where it should be placed
-if !exists('g:yankring_window_use_right')
- let g:yankring_window_use_right = 1
-endif
-
-" If the user presses <space>, toggle the width of the window
-if !exists('g:yankring_window_increment')
- let g:yankring_window_increment = 50
-endif
-
-" Controls whether the . operator will repeat yank operations
-" The default is based on cpoptions: |cpo-y|
-" y A yank command can be redone with ".".
-if !exists('g:yankring_dot_repeat_yank')
- let g:yankring_dot_repeat_yank = (&cpoptions=~'y'?1:0)
-endif
-
-" Only adds unique items to the yankring.
-" If the item already exists, that element is set as the
-" top of the yankring.
-if !exists('g:yankring_ignore_duplicate')
- let g:yankring_ignore_duplicate = 1
-endif
-
-" Vim automatically manages the numbered registers:
-" 0 - last yanked text
-" 1-9 - last deleted items
-" If this option is turned on, the yankring will manage the
-" values in them.
-if !exists('g:yankring_manage_numbered_reg')
- let g:yankring_manage_numbered_reg = 0
-endif
-
-" Allow the user to specify what characters to use for the mappings.
-if !exists('g:yankring_n_keys')
- " 7.1.patch205 introduces the v:operator function which was essential
- " to gain the omap support.
- if s:yr_has_voperator == 1
- " Use omaps for the rest of the functionality
- let g:yankring_n_keys = 'Y D x X'
- else
- let g:yankring_n_keys = 'x yy dd yw dw ye de yE dE yiw diw yaw daw y$ d$ Y D yG dG ygg dgg'
- endif
-endif
-
-" Allow the user to specify what operator pending motions to map
-if !exists('g:yankring_o_keys')
- " o-motions and text objects, without zap-to-char motions
- let g:yankring_o_keys = 'b B w W e E d h j k l H M L y G ^ 0 $ , ;'
- let g:yankring_o_keys .= ' g_ g^ gm g$ gk gj gg ge gE - + _ '
- let g:yankring_o_keys .= ' iw iW aw aW as is ap ip a] a[ i] i[ a) a( ab i) i( ib a> a< i> i< at it a} a{ aB i} i{ iB a" a'' a` i" i'' i`'
-endif
-
-if !exists('g:yankring_zap_keys')
- let g:yankring_zap_keys = 'f F t T / ? @'
-endif
-
-" Allow the user to specify what operator pending motions to map
-if !exists('g:yankring_ignore_operator')
- let g:yankring_ignore_operator = 'g~ gu gU ! = gq g? > < zf g@'
-endif
-let g:yankring_ignore_operator = ' '.g:yankring_ignore_operator.' '
-
-" Whether we should map the . operator
-if !exists('g:yankring_map_dot')
- let g:yankring_map_dot = 1
-endif
-
-" Whether we sould map the "g" paste operators
-if !exists('g:yankring_paste_using_g')
- let g:yankring_paste_using_g = 1
-endif
-
-if !exists('g:yankring_v_key')
- let g:yankring_v_key = 'y'
-endif
-
-if !exists('g:yankring_del_v_key')
- let g:yankring_del_v_key = 'd x'
-endif
-
-if !exists('g:yankring_paste_n_bkey')
- let g:yankring_paste_n_bkey = 'P'
-endif
-
-if !exists('g:yankring_paste_n_akey')
- let g:yankring_paste_n_akey = 'p'
-endif
-
-if !exists('g:yankring_paste_v_bkey')
- let g:yankring_paste_v_bkey = 'P'
-endif
-
-if !exists('g:yankring_paste_v_akey')
- let g:yankring_paste_v_akey = 'p'
-endif
-
-if !exists('g:yankring_paste_check_default_buffer')
- let g:yankring_paste_check_default_buffer = 1
-endif
-
-if !exists('g:yankring_replace_n_pkey')
- let g:yankring_replace_n_pkey = '<C-P>'
-endif
-
-if !exists('g:yankring_replace_n_nkey')
- let g:yankring_replace_n_nkey = '<C-N>'
-endif
-
-if !exists('g:yankring_clipboard_monitor')
- let g:yankring_clipboard_monitor = (has('clipboard')?1:0)
-endif
-
-if !exists('g:yankring_default_menu_mode')
- let g:yankring_default_menu_mode = 3
-endif
-
-" Script variables for the yankring buffer
-let s:yr_buffer_name = '[YankRing]'
-let s:yr_buffer_last_winnr = -1
-let s:yr_buffer_last = -1
-let s:yr_buffer_id = -1
-let s:yr_search = ''
-let s:yr_remove_omap_dot = 0
-let s:yr_history_version = 'v2'
-let s:yr_history_v1_nl = '@@@'
-let s:yr_history_v1_nl_pat = '\%(\\\)\@<!@@@'
-let s:yr_history_v2_nl = "\2" " Use double quotes for a special character
-let s:yr_history_v2_nl_pat = "\2"
-let s:yr_history_last_upd = 0
-let s:yr_history_file_v1 =
- \ g:yankring_history_dir.'/'.
- \ g:yankring_history_file.
- \ (g:yankring_share_between_instances==1?'':'_'.v:servername).
- \ '.txt'
-let s:yr_history_file_v2 =
- \ g:yankring_history_dir.'/'.
- \ g:yankring_history_file.
- \ (g:yankring_share_between_instances==1?'':'_'.v:servername).
- \ '_v2.txt'
-
-
-" Vim window size is changed by the yankring plugin or not
-let s:yr_winsize_chgd = 0
-let s:yr_maps_created = 0
-let s:yr_maps_created_zap = 0
-
-" Enables or disables the yankring
-function! s:YRToggle(...)
- " Default the current state to toggle
- let new_state = ((g:yankring_enabled == 1) ? 0 : 1)
-
- " Allow the user to specify if enabled
- if a:0 > 0
- let new_state = ((a:1 == 1) ? 1 : 0)
- endif
-
- " YRToggle accepts an integer value to specify the state
- if new_state == g:yankring_enabled
- return
- elseif new_state == 1
- call s:YRMapsCreate()
- else
- call s:YRMapsDelete()
- endif
-endfunction
-
-
-" Enables or disables the yankring
-function! s:YRDisplayElem(disp_nbr, script_var)
- if g:yankring_max_display == 0
- if g:yankring_window_use_separate == 1
- let max_display = 500
- else
- let max_display = g:yankring_window_width +
- \ g:yankring_window_increment -
- \ 12
- endif
- else
- let max_display = g:yankring_max_display
- endif
-
- let elem = matchstr(a:script_var, '^.*\ze,.*$')
- if s:yr_history_version == 'v1'
- " v1
- " let elem = substitute(elem, '\%(\\\)\@<!@@@', '\\n', 'g')
- " v2
- let elem = substitute(elem, s:yr_history_v1_nl_pat, '\\n', 'g')
- let elem = substitute(elem, '\\@', '@', 'g')
- else
- let elem = substitute(elem, s:yr_history_v2_nl_pat, '\\n', 'g')
- endif
- let length = strlen(elem)
- " Fancy trick to align them all regardless of how many
- " digits the element # is
- return a:disp_nbr.
- \ strtrans(
- \ strpart(" ",0,(6-strlen(a:disp_nbr+1))).
- \ (
- \ (length>max_display)?
- \ (strpart(elem,0,max_display).
- \ '...'):
- \ elem
- \ )
- \ )
-
- return ""
-endfunction
-
-
-" Enables or disables the yankring
-function! s:YRShow(...)
- " If no parameter was provided assume the user wants to
- " toggle the display.
- let toggle = 1
- if a:0 > 0
- let toggle = matchstr(a:1, '\d\+')
- endif
-
- if toggle == 1
- if bufwinnr(s:yr_buffer_id) > -1
- " If the YankRing window is already open close it
- exec bufwinnr(s:yr_buffer_id) . "wincmd w"
- hide
-
- " Switch back to the window which the YankRing
- " window was opened from
- if bufwinnr(s:yr_buffer_last) != -1
- " If the buffer is visible, switch to it
- exec s:yr_buffer_last_winnr . "wincmd w"
- endif
-
- return
- endif
- endif
-
- " Reset the search string, since this is automatically called
- " if the yankring window is open. A previous search must be
- " cleared since we do not want to show new items. The user can
- " always run the search again.
- let s:yr_search = ""
-
- " It is possible for registers to be changed outside of the
- " maps of the YankRing. Perform this quick check when we
- " show the contents (or when it is refreshed).
- if g:yankring_paste_check_default_buffer == 1
- let save_reg = 0
- let register = ((&clipboard=='unnamed')?'+':'"')
-
- if &clipboard == 'unnamed' && getreg('+') != s:yr_prev_clipboard
- let save_reg = 1
- endif
- if register == '"' && getreg('"') != s:yr_prev_reg_unnamed
- let save_reg = 1
- endif
-
- if save_reg == 1
- " The user has performed a yank / delete operation
- " outside of the yankring maps. Add this
- " value to the yankring.
- call YRRecord(register)
- endif
- endif
-
- " List is shown in order of replacement
- " assuming using previous yanks
- let output = "--- YankRing ---\n"
- let output = output . "Elem Content\n"
-
- call s:YRHistoryRead()
- let disp_item_nr = 1
- for elem in s:yr_history_list
- let output = output . s:YRDisplayElem(disp_item_nr, elem) . "\n"
- let disp_item_nr += 1
- endfor
-
- if g:yankring_window_use_separate == 1
- call s:YRWindowOpen(output)
- else
- echo output
- endif
-endfunction
-
-
-" Used in omaps if a following character is required
-" like with motions (f,t)
-function! s:YRGetChar()
- let msg = "YR:Enter character:"
- echomsg msg
- let c = getchar()
- if c =~ '^\d\+$'
- let c = nr2char(c)
- echomsg msg.c
- endif
- return c
-endfunction
-
-
-" Used in omaps if a following string is required
-" like with motions (/,?)
-" function! s:YRGetSearch()
-" " let msg = "YR:Enter string:"
-" " echomsg msg
-" let str = input("YR:Enter string:")
-" " let str = ''
-" " while 1==1
-" " let c = getchar()
-" " if c =~ '^\d\+$'
-" " let c = nr2char(c)
-" " if c == "\<C-C>"
-" " return c
-" " endif
-" " if c == "\<CR>"
-" " break
-" " endif
-" " let str = str.c
-" " echomsg msg.str
-" " else
-" " break
-" " endif
-" " endwhile
-" return str
-" endfunction
-
-
-" Paste a certain item from the yankring
-" If no parameter is provided, this function becomes interactive. It will
-" display the list (using YRShow) and allow the user to choose an element.
-function! s:YRGetElem(...)
- if s:yr_count == 0
- call s:YRWarningMsg('YR: yankring is empty')
- return -1
- endif
-
- let default_buffer = ((&clipboard=='unnamed')?'+':'"')
-
- let direction = 'p'
- if a:0 > 1
- " If the user indicated to paste above or below
- " let direction = ((a:2 ==# 'P') ? 'P' : 'p')
- if a:2 =~ '\(p\|gp\|P\|gP\)'
- let direction = a:2
- endif
- endif
-
- " Check to see if a specific value has been provided
- let elem = 0
- if a:0 > 0
- " Ensure we get only the numeric value (trim it)
- let elem = matchstr(a:1, '\d\+')
- let elem = elem - 1
- else
- " If no parameter was supplied display the yankring
- " and prompt the user to enter the value they want pasted.
- call s:YRShow(0)
-
- if g:yankring_window_use_separate == 1
- " The window buffer is used instead of command line
- return
- endif
-
- let elem = input("Enter # to paste:")
-
- " Ensure we get only the numeric value (trim it)
- let elem = matchstr(elem, '\d\+')
-
- if elem == ''
- " They most likely pressed enter without entering a value
- return
- endif
-
- let elem = elem - 1
- endif
-
- if elem < 0 || elem >= s:yr_count
- call s:YRWarningMsg("YR: Invalid choice:".elem)
- return -1
- endif
-
- let default_buffer = ((&clipboard=='unnamed')?'+':'"')
- call setreg(default_buffer
- \ , s:YRGetValElemNbr((elem), 'v')
- \ , s:YRGetValElemNbr((elem), 't')
- \ )
- exec "normal! ".direction
-
- " Set the previous action as a paste in case the user
- " press . to repeat
- call s:YRSetPrevOP('p', '', default_buffer, 'n')
-
-endfunction
-
-
-" Starting the top of the ring it will paste x items from it
-function! s:YRGetMultiple(reverse_order, ...)
- if s:yr_count == 0
- call s:YRWarningMsg('YR: yankring is empty')
- return
- endif
-
- " If the user provided a range, exit after that many
- " have been displayed
- let max = 1
- if a:0 == 1
- " If no yank command has been supplied, assume it is
- " a full line yank
- let max = matchstr(a:1, '\d\+')
- endif
- if max > s:yr_count
- " Default to all items if they specified a very high value
- let max = s:yr_count
- endif
-
- " Base the increment on the sort order of the results
- let increment = ((a:reverse_order==0)?(1):(-1))
- if a:reverse_order == 0
- let increment = 1
- let elem = 0
- else
- let increment = -1
- let elem = (max - 1)
- endif
-
- if a:0 > 1
- let iter = 1
- while iter <= a:0
- let elem = (a:{iter} - 1)
- call s:YRGetElem(elem)
- let iter = iter + 1
- endwhile
- else
- while max > 0
- " Paste the first item, and move on to the next.
- " digits the element # is
- call s:YRGetElem(elem)
- let elem = elem + increment
- let max = max - 1
- endwhile
- endif
-endfunction
-
-
-" Given a regular expression, check each element within
-" the yankring, display only the matching items and prompt
-" the user for which item to paste
-function! s:YRSearch(...)
- if s:yr_count == 0
- call s:YRWarningMsg('YR: yankring is empty')
- return
- endif
-
- let s:yr_search = ""
- " If the user provided a range, exit after that many
- " have been displayed
- if a:0 == 0 || (a:0 == 1 && a:1 == "")
- let s:yr_search = input('Enter [optional] regex:')
- else
- let s:yr_search = a:1
- endif
-
- if s:yr_search == ""
- " Show the entire yankring
- call s:YRShow(0)
- return
- endif
-
- " List is shown in order of replacement
- " assuming using previous yanks
- let output = "--- YankRing ---\n"
- let output = output . "Elem Content\n"
- let valid_choices = []
-
- let search_result = filter(copy(s:yr_history_list), "v:val =~ '".s:yr_search."'")
-
- let disp_item_nr = 1
-
- for elem in s:yr_history_list
- if elem =~ s:yr_search
- let output = output . s:YRDisplayElem(disp_item_nr, elem) . "\n"
- call add(valid_choices, disp_item_nr.'')
- endif
- let disp_item_nr += 1
- endfor
-
- if len(valid_choices) == 0
- let output = output . "Search for [".s:yr_search."] did not match any items "
- endif
-
- if g:yankring_window_use_separate == 1
- call s:YRWindowOpen(output)
- else
- if len(valid_choices) > 0
- echo output
- let elem = input("Enter # to paste:")
-
- " Ensure we get only the numeric value (trim it)
- let elem = matchstr(elem, '\d\+')
-
- if elem == ''
- " They most likely pressed enter without entering a value
- return
- endif
-
- if index(valid_choices, elem) != -1
- exec 'YRGetElem ' . elem
- else
- " User did not choose one of the elements that were found
- " Remove leading ,
- call s:YRWarningMsg( "YR: Item[" . elem . "] not found, only valid choices are[" .
- \ join(valid_choices, ',') .
- \ "]"
- \ )
- return -1
- endif
-
- else
- call s:YRWarningMsg( "YR: The pattern [" .
- \ s:yr_search .
- \ "] does not match any items in the yankring"
- \ )
- endif
- endif
-
-endfunction
-
-
-" Resets the common script variables for managing the ring.
-function! s:YRReset()
- call s:YRHistoryDelete()
- " Update the history file
- call s:YRHistorySave()
-endfunction
-
-
-" Clears the yankring by simply setting the # of items in it to 0.
-" There is no need physically unlet each variable.
-function! s:YRInit(...)
- let s:yr_next_idx = 0
- let s:yr_last_paste_idx = 0
- let s:yr_count = 0
- let s:yr_history_last_upd = 0
- let s:yr_history_list = []
- let s:yr_paste_dir = 'p'
-
- " For the . op support
- let s:yr_prev_op_code = ''
- let s:yr_prev_op_mode = 'n'
- let s:yr_prev_count = ''
- let s:yr_prev_reg = ''
- let s:yr_prev_reg_unnamed = ''
- let s:yr_prev_reg_small = ''
- let s:yr_prev_reg_insert = ''
- let s:yr_prev_reg_expres = ''
- let s:yr_prev_clipboard = ''
- let s:yr_prev_vis_lstart = 0
- let s:yr_prev_vis_lend = 0
- let s:yr_prev_vis_cstart = 0
- let s:yr_prev_vis_cend = 0
- let s:yr_prev_changenr = 0
- let s:yr_prev_repeating = 0
-
- " This is used to determine if the visual selection should be
- " reset prior to issuing the YRReplace
- let s:yr_prev_vis_mode = 0
-
- if a:0 == 0 && g:yankring_persist == 0
- " The user wants the yankring reset each time Vim is started
- call s:YRClear()
- endif
-
- call s:YRHistoryRead()
-endfunction
-
-
-" Clears the yankring by simply setting the # of items in it to 0.
-" There is no need physically unlet each variable.
-function! s:YRClear()
- call s:YRReset()
- call s:YRInit('DoNotClear')
-
- " If the yankring window is open, refresh it
- call s:YRWindowUpdate()
-endfunction
-
-
-" Determine which register the user wants to use
-" For example the 'a' register: "ayy
-function! s:YRRegister()
- " v:register can be blank in some (unknown) cases
- " so test for this condition and return the
- " default register
- let user_register = ((v:register=='')?('"'):(v:register))
- if &clipboard == 'unnamed' && user_register == '"'
- let user_register = '+'
- endif
- return user_register
-endfunction
-
-
-" Allows you to push a new item on the yankring. Useful if something
-" is in the clipboard and you want to add it to the yankring.
-" Or if you yank something that is not mapped.
-function! s:YRPush(...)
- let user_register = s:YRRegister()
-
- if a:0 > 0
- " If no yank command has been supplied, assume it is
- " a full line yank
- let user_register = ((a:1 == '') ? user_register : a:1)
- endif
-
- " If we are pushing something on to the yankring, add it to
- " the default buffer as well so the next item pasted will
- " be the item pushed
- let default_buffer = ((&clipboard=='unnamed')?'+':'"')
- call setreg(default_buffer, getreg(user_register),
- \ getregtype(user_register))
-
- call s:YRSetPrevOP('', '', '', 'n')
- call YRRecord(user_register)
-endfunction
-
-
-" Allows you to pop off any element from the yankring.
-" If no parameters are provided the first element is removed.
-" If a vcount is provided, that many elements are removed
-" from the top.
-function! s:YRPop(...)
- if s:yr_count == 0
- call s:YRWarningMsg('YR: yankring is empty')
- return
- endif
-
- let v_count = 1
- if a:0 > 1
- let v_count = a:2
- endif
-
- " If the user provided a parameter, remove that element
- " from the yankring.
- " If no parameter was provided assume the first element.
- let elem_index = 0
- if a:0 > 0
- " Get the element # from the parameter
- let elem_index = matchstr(a:1, '\d\+')
- let elem_index = elem_index - 1
- endif
-
- " If the user entered a count, then remove that many
- " elements from the ring.
- while v_count > 0
- call s:YRMRUDel('s:yr_history_list', elem_index)
- let v_count = v_count - 1
- endwhile
-
- " If the yankring window is open, refresh it
- call s:YRWindowUpdate()
-endfunction
-
-
-" Adds this value to the yankring.
-function! YRRecord(...)
-
- let register = '"'
- if a:0 > 0
- " If no yank command has been supplied, assume it is
- " a full line yank
- let register = ((a:1 == '') ? register : a:1)
- endif
-
- " v:register can be blank in some (unknown) cases
- " if v:register == '' || v:register == '_'
- if v:register == '_'
- " Black hole register, ignore recording the operation
- return ""
- endif
-
- let register = ((&clipboard=='unnamed')?'+':register)
-
- " let s:yr_prev_changenr = changenr()
- if register == '"'
- " If the change has occurred via an omap, we must delay
- " the capture of the default register until this event
- " since register updates are not reflected until the
- " omap function completes
- let s:yr_prev_reg_unnamed = getreg('"')
- let s:yr_prev_reg_small = getreg('-')
- endif
-
- " Add item to list
- " This will also account for duplicates.
- call s:YRMRUAdd( 's:yr_history_list'
- \ , getreg(register)
- \ , getregtype(register)
- \ )
-
- if register =~ '[+*]'
- let s:yr_prev_clipboard = @+
- endif
-
- " If the yankring window is open, refresh it
- call s:YRWindowUpdate()
-
- " Manage the numbered registers
- if g:yankring_manage_numbered_reg == 1
- call s:YRSetNumberedReg()
- endif
-
- return ""
-endfunction
-
-
-" Adds this value to the yankring.
-function! YRRecord3()
- let register = '"'
-
- " v:register can be blank in some (unknown) cases
- " if v:register == '' || v:register == '_'
- if v:register == '_'
- " Black hole register, ignore recording the operation
- return ""
- endif
-
- let register = ((&clipboard=='unnamed')?'+':register)
-
- if register == '"'
- " If the change has occurred via an omap, we must delay
- " the capture of the default register until this event
- " since register updates are not reflected until the
- " omap function completes
- let s:yr_prev_reg_unnamed = getreg('"')
- let s:yr_prev_reg_small = getreg('-')
- endif
-
- if s:yr_remove_omap_dot == 1
- call s:YRMapsCreate('add_only_zap_keys')
- endif
-
- " Add item to list
- " This will also account for duplicates.
- call s:YRMRUAdd( 's:yr_history_list'
- \ , getreg(register)
- \ , getregtype(register)
- \ )
-
- if register =~ '[+*]'
- let s:yr_prev_clipboard = @+
- endif
-
- " If the yankring window is open, refresh it
- call s:YRWindowUpdate()
-
- " Manage the numbered registers
- if g:yankring_manage_numbered_reg == 1
- call s:YRSetNumberedReg()
- endif
-
- return ""
-endfunction
-
-
-" Record the operation for the dot operator
-function! s:YRSetPrevOP(op_code, count, reg, mode)
- let s:yr_prev_op_code = a:op_code
- let s:yr_prev_op_mode = a:mode
- let s:yr_prev_count = a:count
- let s:yr_prev_changenr = changenr()
- let s:yr_prev_reg = a:reg
- let s:yr_prev_reg_unnamed = getreg('"')
- let s:yr_prev_reg_small = getreg('-')
- let s:yr_prev_reg_insert = getreg('.')
- let s:yr_prev_vis_lstart = line("'<")
- let s:yr_prev_vis_lend = line("'>")
- let s:yr_prev_vis_cstart = col("'<")
- let s:yr_prev_vis_cend = col("'>")
- let s:yr_prev_reg_expres = histget('=', -1)
-
- if a:mode == 'n'
- " In normal mode, the change has already
- " occurred, therefore we can mark the
- " actual position of the change.
- let s:yr_prev_chg_lstart = line("'[")
- let s:yr_prev_chg_lend = line("']")
- let s:yr_prev_chg_cstart = col("'[")
- let s:yr_prev_chg_cend = col("']")
- else
- " If in operator pending mode, the change
- " has not yet occurred. Therefore we cannot
- " use the '[ and ]' markers. But we can
- " store the current line position.
- let s:yr_prev_chg_lstart = line(".")
- let s:yr_prev_chg_lend = line(".")
- let s:yr_prev_chg_cstart = col(".")
- let s:yr_prev_chg_cend = col(".")
- endif
-
- " If storing the last change position (using '[, '])
- " is not good enough, then another option is to:
- " Use :redir on the :changes command
- " and grab the last item. Store this value
- " and compare it is YRDoRepeat.
-endfunction
-
-
-" Adds this value to the yankring.
-function! s:YRDoRepeat()
- let dorepeat = 0
-
- if s:yr_has_voperator == 1
- " Let Vim handle the repeat, just capture the updates
- " as usual.
- return 0
- endif
-
- if s:yr_prev_op_code =~ '^c'
- " You cannot repeat change operations, let Vim's
- " standard mechanism handle these, or the user will
- " be prompted again, instead of repeating the
- " previous change.
- return 0
- endif
-
- if g:yankring_manage_numbered_reg == 1
- " When resetting the numbered register we are
- " must ignore the comparision of the " register.
- if s:yr_prev_reg_small == getreg('-') &&
- \ s:yr_prev_reg_insert == getreg('.') &&
- \ s:yr_prev_reg_expres == histget('=', -1) &&
- \ s:yr_prev_vis_lstart == line("'<") &&
- \ s:yr_prev_vis_lend == line("'>") &&
- \ s:yr_prev_vis_cstart == col("'<") &&
- \ s:yr_prev_vis_cend == col("'>") &&
- \ s:yr_prev_chg_lstart == line("'[") &&
- \ s:yr_prev_chg_lend == line("']") &&
- \ s:yr_prev_chg_cstart == col("'[") &&
- \ s:yr_prev_chg_cend == col("']")
- let dorepeat = 1
- endif
- else
- " Check the previously recorded value of the registers
- " if they are the same, we need to reissue the previous
- " yankring command.
- " If any are different, the user performed a command
- " command that did not involve the yankring, therefore
- " we should just issue the standard "normal! ." to repeat it.
- if s:yr_prev_reg_unnamed == getreg('"') &&
- \ s:yr_prev_reg_small == getreg('-') &&
- \ s:yr_prev_reg_insert == getreg('.') &&
- \ s:yr_prev_reg_expres == histget('=', -1) &&
- \ s:yr_prev_vis_lstart == line("'<") &&
- \ s:yr_prev_vis_lend == line("'>") &&
- \ s:yr_prev_vis_cstart == col("'<") &&
- \ s:yr_prev_vis_cend == col("'>")
- let dorepeat = 1
- endif
- if dorepeat == 1 && s:yr_prev_op_mode == 'n'
- " Hmm, not sure why I was doing this now
- " so I will remove it
- " let dorepeat = 0
- " if s:yr_prev_chg_lstart == line("'[") &&
- " \ s:yr_prev_chg_lend == line("']") &&
- " \ s:yr_prev_chg_cstart == col("'[") &&
- " \ s:yr_prev_chg_cend == col("']")
- " let dorepeat = 1
- " endif
- elseif dorepeat == 1 && s:yr_prev_op_mode == 'o'
- " Hmm, not sure why I was doing this now
- " so I will remove it
- " let dorepeat = 0
- " if s:yr_prev_chg_lstart == line("'[") &&
- " \ s:yr_prev_chg_lend == line("']") &&
- " \ s:yr_prev_chg_cstart == col("'[") &&
- " \ s:yr_prev_chg_cend == col("']")
- " let dorepeat = 1
- " endif
- endif
- endif
-
- " " If another change has happened that was not part of the
- " " yankring we cannot replay it (from the yankring). Use
- " " the standard ".".
- " " If the previous op was a change, do not use the yankring
- " " to repeat it.
- " " changenr() is buffer specific, so anytime you move to
- " " a different buffer you will definitely perform a
- " " standard "."
- " " Any previous op that was a change, must be replaced using "."
- " " since we do not want the user prompted to enter text again.
- " if s:yr_prev_changenr == changenr() && s:yr_prev_op_code !~ '^c'
- " let dorepeat = 1
- " endif
-
- " If we are going to repeat check to see if the
- " previous command was a yank operation. If so determine
- " if yank operations are allowed to be repeated.
- if dorepeat == 1 && s:yr_prev_op_code =~ '^y'
- " This value be default is set based on cpoptions.
- if g:yankring_dot_repeat_yank == 0
- let dorepeat = 0
- endif
- endif
- return dorepeat
-endfunction
-
-
-" Manages the Vim's numbered registers
-function! s:YRSetNumberedReg()
-
- let i = 1
-
- while i <= 10
- if i > s:yr_count
- break
- endif
-
- call setreg( (i-1)
- \ , s:YRGetValElemNbr((i-1),'v')
- \ , s:YRGetValElemNbr((i-1),'t')
- \ )
- let i += 1
- endwhile
-endfunction
-
-
-" This internal function will add and subtract values from a starting
-" point and return the correct element number. It takes into account
-" the circular nature of the yankring.
-function! s:YRGetNextElem(start, iter)
-
- let needed_elem = a:start + a:iter
-
- " The yankring is a ring, so if an element is
- " requested beyond the number of elements, we
- " must wrap around the ring.
- if needed_elem > s:yr_count
- let needed_elem = needed_elem % s:yr_count
- endif
-
- if needed_elem == 0
- " Can happen at the end or beginning of the ring
- if a:iter == -1
- " Wrap to the bottom of the ring
- let needed_elem = s:yr_count
- else
- " Wrap to the top of the ring
- let needed_elem = 1
- endif
- elseif needed_elem < 1
- " As we step backwards through the ring we could ask for a negative
- " value, this will wrap it around to the end
- let needed_elem = s:yr_count
- endif
-
- return needed_elem
-
-endfunction
-
-
-" Lets Vim natively perform the operation and then stores what
-" was yanked (or deleted) into the yankring.
-" Supports this for example - 5"ayy
-"
-" This is a legacy function now since the release of Vim 7.2
-" and the use of omaps with YankRing 5.0 and above.
-" If Vim 7.1 has patch205, then the new omaps and the v:operator
-" variable is used instead.
-function! s:YRYankCount(...) range
-
- let user_register = s:YRRegister()
- let v_count = v:count
-
- " Default yank command to the entire line
- let op_code = 'yy'
- if a:0 > 0
- " If no yank command has been supplied, assume it is
- " a full line yank
- let op_code = ((a:1 == '') ? op_code : a:1)
- endif
-
- if op_code == '.'
- if s:YRDoRepeat() == 1
- if s:yr_prev_op_code != ''
- let op_code = s:yr_prev_op_code
- let v_count = s:yr_prev_count
- let user_register = s:yr_prev_reg
- endif
- else
- " Set this flag so that YRRecord will
- " ignore repeats
- let s:yr_prev_repeating = 1
- exec "normal! ."
- return
- endif
- else
- let s:yr_prev_repeating = 0
- endif
-
- " Supports this for example - 5"ayy
- " A delete operation will still place the items in the
- " default registers as well as the named register
- exec "normal! ".
- \ ((v_count > 0)?(v_count):'').
- \ (user_register=='"'?'':'"'.user_register).
- \ op_code
-
- if user_register == '_'
- " Black hole register, ignore recording the operation
- return
- endif
-
- call s:YRSetPrevOP(op_code, v_count, user_register, 'n')
-
- call YRRecord(user_register)
-endfunction
-
-
-" Handles ranges. There are visual ranges and command line ranges.
-" Visual ranges are easy, since we pass through and let Vim deal
-" with those directly.
-" Command line ranges means we must yank the entire line, and not
-" just a portion of it.
-function! s:YRYankRange(do_delete_selection, ...) range
-
- let user_register = s:YRRegister()
- let default_buffer = ((&clipboard=='unnamed')?'+':'"')
-
- " Default command mode to normal mode 'n'
- let cmd_mode = 'n'
- if a:0 > 0
- " Change to visual mode, if command executed via
- " a visual map
- let cmd_mode = ((a:1 == 'v') ? 'v' : 'n')
- endif
-
- if cmd_mode == 'v'
- " We are yanking either an entire line, or a range
- exec "normal! gv".
- \ (user_register==default_buffer?'':'"'.user_register).
- \ 'y'
- if a:do_delete_selection == 1
- exec "normal! gv".
- \ (user_register==default_buffer?'':'"'.user_register).
- \ 'd'
- endif
- else
- " In normal mode, always yank the complete line, since this
- " command is for a range. YRYankCount is used for parts
- " of a single line
- if a:do_delete_selection == 1
- exec a:firstline . ',' . a:lastline . 'delete '.user_register
- else
- exec a:firstline . ',' . a:lastline . 'yank ' . user_register
- endif
- endif
-
- if user_register == '_'
- " Black hole register, ignore
- return
- endif
-
- call s:YRSetPrevOP('', '', user_register, 'n')
- call YRRecord(user_register)
-endfunction
-
-
-" Paste from either the yankring or from a specified register
-" Optionally a count can be provided, so paste the same value 10 times
-function! s:YRPaste(replace_last_paste_selection, nextvalue, direction, ...)
- " Disabling the yankring removes the default maps.
- " But there are some maps the user can create on their own, and
- " these would most likely call this function. So place an extra
- " check and display a message.
- if g:yankring_enabled == 0
- call s:YRWarningMsg(
- \ 'YR: The yankring is currently disabled, use YRToggle.'
- \ )
- return
- endif
-
-
- let user_register = s:YRRegister()
- let default_buffer = ((&clipboard == 'unnamed')?'+':'"')
- let v_count = v:count
-
- " Default command mode to normal mode 'n'
- let cmd_mode = 'n'
- if a:0 > 0
- " Change to visual mode, if command executed via
- " a visual map
- let cmd_mode = ((a:1 == 'v') ? 'v' : 'n')
- endif
-
- " User has decided to bypass the yankring and specify a specific
- " register
- if user_register != default_buffer
- if a:replace_last_paste_selection == 1
- call s:YRWarningMsg( 'YR: A register cannot be specified in replace mode' )
- return
- else
- " Check for the expression register, in this special case
- " we must copy it's evaluation into the default buffer and paste
- if user_register == '='
- " Save the default register since Vim will only
- " allow the expression register to be pasted once
- " and will revert back to the default buffer
- let save_default_reg = @"
- call setreg(default_buffer, eval(histget('=', -1)) )
- else
- let user_register = '"'.user_register
- endif
- exec "normal! ".
- \ ((cmd_mode=='n') ? "" : "gv").
- \ ((v_count > 0)?(v_count):'').
- \ ((user_register=='=')?'':user_register).
- \ a:direction
- if user_register == '='
- let @" = save_default_reg
- endif
- " In this case, we have bypassed the yankring
- " If the user hits next or previous we want the
- " next item pasted to be the top of the yankring.
- let s:yr_last_paste_idx = 0
- endif
- let s:yr_paste_dir = a:direction
- let s:yr_prev_vis_mode = ((cmd_mode=='n') ? 0 : 1)
- return
- endif
-
- " Try to second guess the user to make these mappings less intrusive.
- " If the user hits paste, compare the contents of the paste register
- " to the current entry in the yankring. If they are different, lets
- " assume the user wants the contents of the paste register.
- " So if they pressed [yt ] (yank to space) and hit paste, the yankring
- " would not have the word in it, so assume they want the word pasted.
- if a:replace_last_paste_selection != 1
- if s:yr_count > 0 || (default_buffer == '+' && len(@+) == 0)
- " Only check the default buffer is the user wants us to.
- " This was necessary prior to version 4.0 since we did not
- " capture as many items as 4.0 and above does. (A. Budden)
- if g:yankring_paste_check_default_buffer == 1 &&
- \ getreg(default_buffer) != s:yr_prev_reg_unnamed
- " The user has performed a yank / delete operation
- " outside of the yankring maps. First, add this
- " value to the yankring.
- call YRRecord(default_buffer)
- " Now, use the most recently yanked text, rather than the
- " value from the yankring.
- exec "normal! ".
- \ ((cmd_mode=='n') ? "" : "gv").
- \ ((v_count > 0)?(v_count):'').
- \ a:direction
- let s:yr_paste_dir = a:direction
- let s:yr_prev_vis_mode = ((cmd_mode=='n') ? 0 : 1)
-
- " In this case, we have bypassed the yankring
- " If the user hits next or previous we want the
- " next item pasted to be the top of the yankring.
- let s:yr_last_paste_idx = 0
- return
- endif
- else
- exec "normal! ".
- \ ((cmd_mode=='n') ? "" : "gv").
- \ ((v_count > 0)?(v_count):'').
- \ a:direction
- let s:yr_paste_dir = a:direction
- let s:yr_prev_vis_mode = ((cmd_mode=='n') ? 0 : 1)
- return
- endif
- endif
-
- if s:yr_count == 0 || (default_buffer == '+' && len(@+) == 0)
- " Nothing to paste
- return
- endif
-
- if a:replace_last_paste_selection == 1
- " Replacing the previous put
- let start = line("'[")
- let end = line("']")
-
- if start != line('.')
- call s:YRWarningMsg( 'YR: You must paste text first, before you can replace' )
- return
- endif
-
- if start == 0 || end == 0
- return
- endif
-
- " If a count was provided (ie 5<C-P>), multiply the
- " nextvalue accordingly and position the next paste index
- let which_elem = a:nextvalue * ((v_count > 0)?(v_count):1) * -1
- let s:yr_last_paste_idx = s:YRGetNextElem(
- \ s:yr_last_paste_idx, which_elem
- \ )
-
- let save_reg = getreg(default_buffer)
- let save_reg_type = getregtype(default_buffer)
- call setreg( default_buffer
- \ , s:YRGetValElemNbr((s:yr_last_paste_idx-1),'v')
- \ , s:YRGetValElemNbr((s:yr_last_paste_idx-1),'t')
- \ )
-
- " First undo the previous paste
- exec "normal! u"
- " Check if the visual selection should be reselected
- " Next paste the correct item from the ring
- " This is done as separate statements since it appeared that if
- " there was nothing to undo, the paste never happened.
- exec "normal! ".
- \ ((s:yr_prev_vis_mode==0) ? "" : "gv").
- \ s:yr_paste_dir
- call setreg(default_buffer, save_reg, save_reg_type)
- call s:YRSetPrevOP('', '', '', 'n')
- else
- " User hit p or P
- " Supports this for example - 5"ayy
- " And restores the current register
- let save_reg = getreg(default_buffer)
- let save_reg_type = getregtype(default_buffer)
- let s:yr_last_paste_idx = 1
- call setreg(default_buffer
- \ , s:YRGetValElemNbr(0,'v')
- \ , s:YRGetValElemNbr(0,'t')
- \ )
- exec "normal! ".
- \ ((cmd_mode=='n') ? "" : "gv").
- \ (
- \ ((v_count > 0)?(v_count):'').
- \ a:direction
- \ )
- call setreg(default_buffer, save_reg, save_reg_type)
- call s:YRSetPrevOP(
- \ a:direction
- \ , v_count
- \ , default_buffer
- \ , 'n'
- \ )
- let s:yr_paste_dir = a:direction
- let s:yr_prev_vis_mode = ((cmd_mode=='n') ? 0 : 1)
- endif
-
-endfunction
-
-
-" Handle any omaps
-function! YRMapsExpression(sid, motion, ...)
- let cmds = a:motion
- " echomsg "YRMapsE:".localtime()
- " echomsg "YRMapsE 1:".cmds.":".v:operator.":".s:yr_maps_created_zap
-
- if (a:motion =~ '\.' && s:yr_remove_omap_dot == 1) || a:motion =~ '@'
- " If we are repeating a series of commands we must
- " unmap the _zap_ keys so that the user is not
- " prompted when a command is replayed.
- " These maps must be re-instated in YRRecord3()
- " after the action of the replay is completed.
- call s:YRMapsDelete('remove_only_zap_keys')
- endif
-
- " Check if we are in operator-pending mode
- if a:motion =~ '\('.substitute(g:yankring_zap_keys, ' ', '\\|', 'g').'\)'
- if a:motion =~ '\(/\|?\)'
- let zapto = (a:0==0 ? "" : input("YR:Enter string:"))
- if zapto != ""
- let zapto = zapto . "\<CR>"
- else
- let zapto = "\<C-C>"
- endif
- else
- let zapto = (a:0==0 ? "" : s:YRGetChar())
- endif
-
- if zapto == "\<C-C>"
- " Abort if the user hits Control C
- call s:YRWarningMsg( "YR:Aborting command:".v:operator.a:motion )
- return "\<C-C>"
- endif
-
- let cmds = cmds . zapto
- endif
-
- " There are a variety of commands which do not change the
- " registers, so these operators should be ignored when
- " determining which operations to record
- " Simple example is '=' which simply formats the
- " the selected text.
- if ' \('.escape(join(split(g:yankring_ignore_operator), '\|'), '/.*~$^[]' ).'\) ' !~ escape(v:operator, '/.*~$^[]')
- " Check if we are performing an action that will
- " take us into insert mode
- if '[cCsS]' !~ escape(v:operator, '/.*~$^[]') && a:motion !~ '@'
- " if '[cCsS]' !~ escape(v:operator, '/.*~$^[]')
- " If we have not entered insert mode, feed the call
- " to record the current change when the function ends.
- " This is necessary since omaps do not update registers
- " until the function completes.
- " The InsertLeave event will handle the motions
- " that place us in insert mode and record the
- " changes when insert mode ends.
- let cmds .= a:sid. "yrrecord"
- endif
- endif
-
- " echomsg "YRMapsE 5:".a:motion.":'".cmds."':".s:yr_maps_created_zap
- return cmds
-
-endfunction
-
-
-" Handle any the @
-function! s:YRMapsMacro(bang, ...) range
- " If we are repeating a series of commands we must
- " unmap the _zap_ keys so that the user is not
- " prompted when a command is replayed.
- " These maps must be re-instated in YRRecord3()
- " after the action of the replay is completed.
- call s:YRMapsDelete('remove_only_zap_keys')
-
- " let zapto = (a:0==0 ? "" : s:YRGetChar())
- let zapto = s:YRGetChar()
-
- if zapto == "\<C-C>"
- " Abort if the user hits Control C
- call s:YRWarningMsg( "YR:Aborting command:".v:operator.a:motion )
- return ""
- endif
-
- let v_count = v:count
- " If no count was specified it will have a value of 0
- " so set it to at least 1
- let v_count = ((v_count > 0)?(v_count):'')
-
- let range = ''
- if a:firstline != a:lastline
- let rannge = a:firstline.','.a:lastline
- endif
-
- let cmd = range."normal! ".v_count.'@'.zapto
- " DEBUG
- " echomsg cmd
- exec cmd
-
- call s:YRMapsCreate('add_only_zap_keys')
-endfunction
-
-
-" Create the default maps
-function! s:YRMapsCreate(...)
- " 7.1.patch205 introduces the v:operator function which was
- " essential to gain the omap support.
- if s:yr_has_voperator == 1
- let s:yr_remove_omap_dot = 1
- for key in split(g:yankring_zap_keys)
- try
- if key != '@'
- exec 'omap <expr>' key 'YRMapsExpression("<SID>", "'. key. '", 1)'
- endif
- catch
- endtry
- endfor
- endif
-
- silent! nmap <expr> @ YRMapsExpression("<SID>", "@", "1")
-
- let s:yr_maps_created_zap = 1
-
- if a:0 > 0
- " We have only removed the _zap_ keys temporarily
- " so abandon further changes.
- return
- endif
-
- " 7.1.patch205 introduces the v:operator function which was essential
- " to gain the omap support.
- if s:yr_has_voperator == 1
- let s:yr_remove_omap_dot = 1
- " Set option to add and remove _zap_ keys when
- " repeating commands
- let o_maps = split(g:yankring_o_keys)
- " Loop through and prompt the user for all buffer connection parameters.
- for key in o_maps
- exec 'omap <expr>' key 'YRMapsExpression("<SID>", "'. escape(key,'\"'). '")'
- endfor
- endif
-
- " Iterate through a space separated list of mappings and create
- " calls to the YRYankCount function
- let n_maps = split(g:yankring_n_keys)
- " Loop through and prompt the user for all buffer connection parameters.
- for key in n_maps
- " exec 'nnoremap <silent>'.key." :<C-U>YRYankCount '".key."'<CR>"
- " exec 'nnoremap <silent>'.key." :<C-U>YRYankCount '".key."'<CR>"
- " Andy Wokula's suggestion
- exec 'nmap' key key."<SID>yrrecord"
- endfor
-
- if g:yankring_map_dot == 1
- if s:yr_has_voperator == 1
- nmap <expr> . YRMapsExpression("<SID>", ".")
- else
- nnoremap <silent> . :<C-U>YRYankCount '.'<CR>
- endif
- endif
-
- if g:yankring_v_key != ''
- exec 'xnoremap <silent>'.g:yankring_v_key." :YRYankRange 'v'<CR>"
- endif
- if g:yankring_del_v_key != ''
- for v_map in split(g:yankring_del_v_key)
- if strlen(v_map) > 0
- try
- exec 'xnoremap <silent>'.v_map." :YRDeleteRange 'v'<CR>"
- catch
- endtry
- endif
- endfor
- endif
- if g:yankring_paste_n_bkey != ''
- exec 'nnoremap <silent>'.g:yankring_paste_n_bkey." :<C-U>YRPaste 'P'<CR>"
- if g:yankring_paste_using_g == 1
- exec 'nnoremap <silent> g'.g:yankring_paste_n_bkey." :<C-U>YRPaste 'gP'<CR>"
- endif
- endif
- if g:yankring_paste_n_akey != ''
- exec 'nnoremap <silent>'.g:yankring_paste_n_akey." :<C-U>YRPaste 'p'<CR>"
- if g:yankring_paste_using_g == 1
- exec 'nnoremap <silent> g'.g:yankring_paste_n_akey." :<C-U>YRPaste 'gp'<CR>"
- endif
- endif
- if g:yankring_paste_v_bkey != ''
- exec 'xnoremap <silent>'.g:yankring_paste_v_bkey." :<C-U>YRPaste 'P', 'v'<CR>"
- endif
- if g:yankring_paste_v_akey != ''
- exec 'xnoremap <silent>'.g:yankring_paste_v_akey." :<C-U>YRPaste 'p', 'v'<CR>"
- endif
- if g:yankring_replace_n_pkey != ''
- exec 'nnoremap <silent>'.g:yankring_replace_n_pkey." :<C-U>YRReplace '-1', 'P'<CR>"
- endif
- if g:yankring_replace_n_nkey != ''
- exec 'nnoremap <silent>'.g:yankring_replace_n_nkey." :<C-U>YRReplace '1', 'p'<CR>"
- endif
-
- let g:yankring_enabled = 1
- let s:yr_maps_created = 1
-
- if exists('*YRRunAfterMaps')
- " This will allow you to override the default maps if necessary
- call YRRunAfterMaps()
- endif
-endfunction
-
-
-" Create the default maps
-function! s:YRMapsDelete(...)
-
- let o_maps = split(g:yankring_zap_keys)
- for key in o_maps
- try
- if key != '@'
- silent! exec 'ounmap' key
- endif
- catch
- endtry
- endfor
-
- let s:yr_maps_created_zap = 0
-
- if a:0 > 0
- " We have only removed the _zap_ keys temporarily
- " so abandon further changes.
- return
- endif
-
- " Iterate through a space separated list of mappings and create
- " calls to an appropriate YankRing function
- let n_maps = split(g:yankring_n_keys)
- " Loop through and prompt the user for all buffer connection parameters.
- for key in n_maps
- try
- silent! exec 'nunmap' key
- catch
- endtry
- endfor
-
- let o_maps = split(g:yankring_o_keys)
- for key in o_maps
- try
- silent! exec 'ounmap' key
- catch
- endtry
- endfor
-
- if g:yankring_map_dot == 1
- exec "nunmap ."
- endif
- if g:yankring_v_key != ''
- exec 'vunmap '.g:yankring_v_key
- endif
- if g:yankring_del_v_key != ''
- for v_map in split(g:yankring_del_v_key)
- if strlen(v_map) > 0
- try
- exec 'vunmap '.v_map
- catch
- endtry
- endif
- endfor
- endif
- if g:yankring_paste_n_bkey != ''
- exec 'nunmap '.g:yankring_paste_n_bkey
- if g:yankring_paste_using_g == 1
- exec 'nunmap g'.g:yankring_paste_n_bkey
- endif
- endif
- if g:yankring_paste_n_akey != ''
- exec 'nunmap '.g:yankring_paste_n_akey
- if g:yankring_paste_using_g == 1
- exec 'nunmap g'.g:yankring_paste_n_akey
- endif
- endif
- if g:yankring_paste_v_bkey != ''
- exec 'vunmap '.g:yankring_paste_v_bkey
- endif
- if g:yankring_paste_v_akey != ''
- exec 'vunmap '.g:yankring_paste_v_akey
- endif
- if g:yankring_replace_n_pkey != ''
- exec 'nunmap '.g:yankring_replace_n_pkey
- endif
- if g:yankring_replace_n_nkey != ''
- exec 'nunmap '.g:yankring_replace_n_nkey
- endif
-
- let g:yankring_enabled = 0
- let s:yr_maps_created = 0
-endfunction
-
-function! s:YRGetValElemNbr( position, type )
- let needed_elem = a:position
-
- " The List which contains the items in the yankring
- " history is also ordered, most recent at the top
- let elem = s:YRMRUGet('s:yr_history_list', needed_elem)
-
- if a:type == 't'
- let elem = matchstr(elem, '^.*,\zs.*$')
- else
- let elem = matchstr(elem, '^.*\ze,.*$')
- if s:yr_history_version == 'v1'
- " Match three @@@ in a row as long as it is not
- " preceeded by a @@@
- " v1
- let elem = substitute(elem, s:yr_history_v1_nl_pat, "\n", 'g')
- let elem = substitute(elem, '\\@', '@', 'g')
- else
- let elem = substitute(elem, s:yr_history_v2_nl_pat, "\n", 'g')
- endif
- endif
-
- return elem
-endfunction
-
-function! s:YRMRUReset( mru_list )
- let {a:mru_list} = []
-
- return 1
-endfunction
-
-function! s:YRMRUSize( mru_list )
- return len({a:mru_list})
-endfunction
-
-function! s:YRMRUElemFormat( element, element_type )
- let elem = a:element
- if g:yankring_max_element_length != 0
- let elem = strpart(a:element, 0, g:yankring_max_element_length)
- if (g:yankring_warn_on_truncate > 0)
- let bytes = len (a:element) - len(elem)
- if (bytes > 0)
- call s:YRWarningMsg("Yankring truncated its element by ".
- \ bytes.
- \ " bytes due to a g:yankring_max_element_length of ".
- \ g:yankring_max_element_length
- \ )
- endif
- endif
- endif
- if s:yr_history_version == 'v1'
- let elem = escape(elem, '@')
- let elem = substitute(elem, "\n", s:yr_history_v1_nl, 'g')
- else
- let elem = substitute(elem, "\n", s:yr_history_v2_nl, 'g')
- endif
- " Append the regtype to the end so we have it available
- let elem = elem.",".a:element_type
-
- return elem
-endfunction
-
-function! s:YRMRUHas( mru_list, find_str )
- " This function will find a string and return the element #
- let find_idx = index({a:mru_list}, a:find_str)
-
- return find_idx
-endfunction
-
-function! s:YRMRUGet( mru_list, position )
- " This function will return the value of the item at a:position
- " Find the value of one element
- let value = get({a:mru_list}, a:position, -2)
-
- return value
-endfunction
-
-function! s:YRMRUAdd( mru_list, element, element_type )
- " Only add new items if they do not already exist in the MRU.
- " If the item is found, move it to the start of the MRU.
- let found = -1
- " let elem = a:element
- " if g:yankring_max_element_length != 0
- " let elem = strpart(a:element, 0, g:yankring_max_element_length)
- " endif
- " if s:yr_history_version == 'v1'
- " let elem = escape(elem, '@')
- " let elem = substitute(elem, "\n", s:yr_history_v1_nl, 'g')
- " else
- " let elem = substitute(elem, "\n", s:yr_history_v2_nl, 'g')
- " endif
- " " Append the regtype to the end so we have it available
- " let elem = elem.",".a:element_type
-
- if strlen(a:element) < g:yankring_min_element_length
- return 1
- endif
-
- let elem = s:YRMRUElemFormat(a:element, a:element_type)
-
- " Refresh the List
- call s:YRHistoryRead()
-
- let found = s:YRMRUHas(a:mru_list, elem)
-
- " Special case for efficiency, if it is first item in the
- " List, do nothing
- if found != 0
- if found != -1
- " Remove found item since we will add it to the top
- call remove({a:mru_list}, found)
- endif
- call insert({a:mru_list}, elem, 0)
- call s:YRHistorySave()
- endif
-
- return 1
-endfunction
-
-function! s:YRMRUDel( mru_list, elem_nbr )
- if a:elem_nbr >= 0 && a:elem_nbr < s:yr_count
- call remove({a:mru_list}, a:elem_nbr)
- call s:YRHistorySave()
- endif
-
- return 1
-endfunction
-
-function! s:YRHistoryDelete()
- let s:yr_history_list = []
- let yr_filename = s:yr_history_file_{s:yr_history_version}
-
- if filereadable(yr_filename)
- let rc = delete(yr_filename)
- if rc != 0
- call s:YRErrorMsg(
- \ 'YRHistoryDelete: Unable to delete the yankring history file: '.
- \ yr_filename
- \ )
- endif
- endif
-
- return 0
-endfunction
-
-function! s:YRHistoryRead()
- let refresh_needed = 1
- let yr_history_list = []
- let yr_filename = s:yr_history_file_{s:yr_history_version}
-
- if filereadable(yr_filename)
- let last_upd = getftime(yr_filename)
-
- if s:yr_history_last_upd != 0 && last_upd <= s:yr_history_last_upd
- let refresh_needed = 0
- endif
-
- if refresh_needed == 1
- let s:yr_history_list = readfile(yr_filename)
- let s:yr_history_last_upd = last_upd
- let s:yr_count = len(s:yr_history_list)
- return
- else
- return
- endif
- else
- if s:yr_history_version == 'v2'
- " Check to see if an upgrade is required
- " else, let the empty yr_history_list be returned.
- if filereadable(s:yr_history_file_v1)
- " Perform upgrade to v2 of the history file
- call s:YRHistoryUpgrade('v1')
- return
- endif
- endif
- endif
-
- let s:yr_history_list = yr_history_list
- call s:YRHistorySave()
-
-endfunction
-
-function! s:YRHistorySave()
- let yr_filename = s:yr_history_file_{s:yr_history_version}
-
- if len(s:yr_history_list) > g:yankring_max_history
- " Remove items which exceed the max # specified
- call remove(s:yr_history_list, g:yankring_max_history)
- endif
-
- let rc = writefile(s:yr_history_list, yr_filename)
-
- if rc == 0
- let s:yr_history_last_upd = getftime(yr_filename)
- let s:yr_count = len(s:yr_history_list)
- else
- call s:YRErrorMsg(
- \ 'YRHistorySave: Unable to save yankring history file: '.
- \ yr_filename
- \ )
- endif
-endfunction
-
-function! s:YRHistoryUpgrade(version)
- if a:version == 'v1'
- if filereadable(s:yr_history_file_v1)
- let v1_list = readfile(s:yr_history_file_v1)
- let v2_list = []
- for elem in v1_list
- " Restore from version 1
- let elem = substitute(elem, s:yr_history_v1_nl_pat, "\n", 'g')
- let elem = substitute(elem, '\\@', '@', 'g')
- " Encode to version 2
- let elem = substitute(elem, "\n", s:yr_history_v2_nl, 'g')
- call add(v2_list, elem)
- endfor
- let s:yr_history_list = v2_list
- call s:YRHistorySave()
- call s:YRWarningMsg(
- \ "YR:History file:".
- \ s:yr_history_file_v1.
- \ ' has been upgraded.'
- \ )
- endif
- endif
-endfunction
-
-" YRWindowUpdate
-" Checks if the yankring window is already open.
-" If it is, it will refresh it.
-function! s:YRWindowUpdate()
- let orig_win_bufnr = bufwinnr('%')
-
- " Switch to the yankring buffer
- " only if it is already visible
- if bufwinnr(s:yr_buffer_id) != -1
- call s:YRShow(0)
- " Switch back to the original buffer
- exec orig_win_bufnr . "wincmd w"
- endif
-endfunction
-
-" YRWindowStatus
-" Displays a brief command list and option settings.
-" It also will toggle the Help text.
-function! s:YRWindowStatus(show_help)
- let full_help = 0
- let orig_win_bufnr = bufwinnr('%')
- let yr_win_bufnr = bufwinnr(s:yr_buffer_id)
-
- if yr_win_bufnr == -1
- " Do not update the window status since the
- " yankring is not currently displayed.
- return ""
- endif
- " Switch to the yankring buffer
- if orig_win_bufnr != yr_win_bufnr
- " If the buffer is visible, switch to it
- exec yr_win_bufnr . "wincmd w"
- endif
-
- let msg = 'AutoClose='.g:yankring_window_auto_close.
- \ ';ClipboardMonitor='.g:yankring_clipboard_monitor.
- \ ';Cmds:<enter>,[g]p,[g]P,d,r,s,a,c,u,q,<space>;Help=?'.
- \ (s:yr_search==""?"":';SearchRegEx='.s:yr_search)
-
- if s:yr_has_voperator == 0
- let msg = msg . "\nYankRing has limited functionality without Vim 7.2 or higher"
- endif
-
- " Toggle help by checking the first line of the buffer
- if a:show_help == 1 && getline(1) !~ 'selection'
- let full_help = 1
- let msg =
- \ '" <enter> : [p]aste selection'."\n".
- \ '" double-click : [p]aste selection'."\n".
- \ '" [g]p : [g][p]aste selection'."\n".
- \ '" [g]P : [g][P]aste selection'."\n".
- \ '" r : [p]aste selection in reverse order'."\n".
- \ '" s : [s]earch the yankring for text'."\n".
- \ '" u : [u]pdate display'."\n".
- \ '" a : toggle [a]utoclose setting'."\n".
- \ '" c : toggle [c]lipboard monitor setting'."\n".
- \ '" q : [q]uit / close the yankring window'."\n".
- \ '" ? : Remove help text'."\n".
- \ '" <space> : toggles the width of the window'."\n".
- \ '" Visual mode is supported for above commands'."\n".
- \ msg
- endif
-
- let saveMod = &modifiable
-
- " Go to the top of the buffer and remove any previous status
- " Use the blackhole register so it does not affect the yankring
- setlocal modifiable
- exec 0
- silent! exec 'norm! "_d/^---'."\n"
- call histdel("search", -1)
-
- silent! 0put =msg
-
- " Erase it's contents to the blackhole
- silent! exec '%g/^\s*$/delete _'
- call histdel("search", -1)
-
- call cursor(1,1)
- if full_help == 0
- call search('^\d', 'W')
- endif
-
- let &modifiable = saveMod
-
- if orig_win_bufnr != s:yr_buffer_id
- exec orig_win_bufnr . "wincmd w"
- endif
-endfunction
-
-" YRWindowOpen
-" Display the Most Recently Used file list in a temporary window.
-function! s:YRWindowOpen(results)
-
- " Setup the cpoptions properly for the maps to work
- let old_cpoptions = &cpoptions
- set cpoptions&vim
- setlocal cpoptions-=a,A
-
- " Save the current buffer number. The yankring will switch back to
- " this buffer when an action is taken.
- let s:yr_buffer_last = bufnr('%')
- let s:yr_buffer_last_winnr = winnr()
-
- if bufwinnr(s:yr_buffer_id) == -1
- if g:yankring_window_use_horiz == 1
- if g:yankring_window_use_bottom == 1
- let location = 'botright'
- else
- let location = 'topleft'
- " Creating the new window will offset all other
- " window numbers. Account for that so we switch
- " back to the correct window.
- let s:yr_buffer_last_winnr = s:yr_buffer_last_winnr + 1
- endif
- let win_size = g:yankring_window_height
- else
- " Open a horizontally split window. Increase the window size, if
- " needed, to accomodate the new window
- if g:yankring_window_width &&
- \ &columns < (80 + g:yankring_window_width)
- " one extra column is needed to include the vertical split
- let &columns = &columns + g:yankring_window_width + 1
- let s:yr_winsize_chgd = 1
- else
- let s:yr_winsize_chgd = 0
- endif
-
- if g:yankring_window_use_right == 1
- " Open the window at the rightmost place
- let location = 'botright vertical'
- else
- " Open the window at the leftmost place
- let location = 'topleft vertical'
- " Creating the new window will offset all other
- " window numbers. Account for that so we switch
- " back to the correct window.
- let s:yr_buffer_last_winnr = s:yr_buffer_last_winnr + 1
- endif
- let win_size = g:yankring_window_width
- endif
-
- " Special consideration was involved with these sequence
- " of commands.
- " First, split the current buffer.
- " Second, edit a new file.
- " Third record the buffer number.
- " If a different sequence is followed when the yankring
- " buffer is closed, Vim's alternate buffer is the yanking
- " instead of the original buffer before the yankring
- " was shown.
- let cmd_mod = ''
- if v:version >= 700
- let cmd_mod = 'keepalt '
- endif
- exec 'silent! ' . cmd_mod . location . ' ' . win_size . 'split '
-
- " Using :e and hide prevents the alternate buffer
- " from being changed.
- exec ":e " . escape(s:yr_buffer_name, ' ')
- " Save buffer id
- let s:yr_buffer_id = bufnr('%') + 0
- else
- " If the buffer is visible, switch to it
- exec bufwinnr(s:yr_buffer_id) . "wincmd w"
- endif
-
- " Perform a double check to ensure we have entered the correct
- " buffer since we don't want to do the %d_ in the wrong buffer!
- if (bufnr('%') + 0) != s:yr_buffer_id
- call s:YRWarningMsg(
- \ "YR:Failed to change to the yankring buffer, please contact author id:".
- \ s:yr_buffer_id.
- \ ' last:'.s:yr_buffer_last
- \ )
- return -1
- endif
-
- " Mark the buffer as scratch
- setlocal buftype=nofile
- setlocal bufhidden=hide
- setlocal noswapfile
- setlocal nowrap
- setlocal nonumber
- setlocal nobuflisted
- setlocal noreadonly
- setlocal modifiable
-
- " set up syntax highlighting
- syn match yankringTitle #^--- YankRing ---$#hs=s+4,he=e-4
- syn match yankringHeaders #^Elem Content$#
- syn match yankringItemNumber #^\d\+#
-
- syn match yankringKey #^AutoClose.*<enter>#hs=e-6
- syn match yankringKey #^AutoClose.*\[g\]p#hs=e-3 contains=yankringKey
- syn match yankringKey #^AutoClose.*\[p\]P#hs=e-3 contains=yankringKey
- syn match yankringKey #^AutoClose.*,d,#hs=e-1,he=e-1 contains=yankringKey
- syn match yankringKey #^AutoClose.*,r,#hs=e-1,he=e-1 contains=yankringKey
- syn match yankringKey #^AutoClose.*,s,#hs=e-1,he=e-1 contains=yankringKey
- syn match yankringKey #^AutoClose.*,a,#hs=e-1,he=e-1 contains=yankringKey
- syn match yankringKey #^AutoClose.*,c,#hs=e-1,he=e-1 contains=yankringKey
- syn match yankringKey #^AutoClose.*,u,#hs=e-1,he=e-1 contains=yankringKey
- syn match yankringKey #^AutoClose.*,q,#hs=e-1,he=e-1 contains=yankringKey
- syn match yankringKey #^AutoClose.*<space>#hs=e-6 contains=yankringKey
- syn match yankringKey #^AutoClose.*?$#hs=e contains=yankringKey
-
- syn match yankringKey #^".*:#hs=s+1,he=e-1
- syn match yankringHelp #^".*$# contains=yankringKey
-
- hi link yankringTitle directory
- hi link yankringHeaders keyword
- hi link yankringItemNumber constant
- hi link yankringKey identifier
- hi link yankringHelp string
-
- " Clear all existing maps for this buffer
- " We should do this for all maps, but I am not sure how to do
- " this for this buffer/window only without affecting all the
- " other buffers.
- mapclear <buffer>
- " Create a mapping to act upon the yankring
- nnoremap <buffer> <silent> <2-LeftMouse> :call <SID>YRWindowActionN('p' ,'n')<CR>
- nnoremap <buffer> <silent> <CR> :call <SID>YRWindowActionN('p' ,'n')<CR>
- xnoremap <buffer> <silent> <CR> :call <SID>YRWindowAction ('p' ,'v')<CR>
- nnoremap <buffer> <silent> p :call <SID>YRWindowActionN('p' ,'n')<CR>
- xnoremap <buffer> <silent> p :call <SID>YRWindowAction ('p' ,'v')<CR>
- nnoremap <buffer> <silent> P :call <SID>YRWindowActionN('P' ,'n')<CR>
- xnoremap <buffer> <silent> P :call <SID>YRWindowAction ('P' ,'v')<CR>
- nnoremap <buffer> <silent> gp :call <SID>YRWindowActionN('gp','n')<CR>
- xnoremap <buffer> <silent> gp :call <SID>YRWindowAction ('gp','v')<CR>
- nnoremap <buffer> <silent> gP :call <SID>YRWindowActionN('gP','n')<CR>
- xnoremap <buffer> <silent> gP :call <SID>YRWindowAction ('gP','v')<CR>
- nnoremap <buffer> <silent> d :call <SID>YRWindowActionN('d' ,'n')<CR>
- xnoremap <buffer> <silent> d :call <SID>YRWindowAction ('d' ,'v')<CR>
- xnoremap <buffer> <silent> r :call <SID>YRWindowAction ('r' ,'v')<CR>
- nnoremap <buffer> <silent> s :call <SID>YRWindowAction ('s' ,'n')<CR>
- nnoremap <buffer> <silent> a :call <SID>YRWindowAction ('a' ,'n')<CR>
- nnoremap <buffer> <silent> c :call <SID>YRWindowAction ('c' ,'n')<CR>
- nnoremap <buffer> <silent> ? :call <SID>YRWindowAction ('?' ,'n')<CR>
- nnoremap <buffer> <silent> u :call <SID>YRWindowAction ('u' ,'n')<CR>
- nnoremap <buffer> <silent> q :call <SID>YRWindowAction ('q' ,'n')<CR>
- nnoremap <buffer> <silent> <space> \|:silent exec 'vertical resize '.
- \ (
- \ g:yankring_window_use_horiz!=1 && winwidth('.') > g:yankring_window_width
- \ ?(g:yankring_window_width)
- \ :(winwidth('.') + g:yankring_window_increment)
- \ )<CR>
-
- " Erase it's contents to the blackhole
- silent! exec '%delete _'
-
- " Display the status line / help
- call s:YRWindowStatus(0)
- exec 'normal! G'
-
- " Display the contents of the yankring
- silent! put =a:results
-
- if getline('$') == ''
- " Erase last blank line
- silent! exec '$delete _'
- endif
-
- " Move the cursor to the first line with an element
- exec 0
- call search('^\d','W')
-
- setlocal nomodifiable
- "
- " Restore the previous cpoptions settings
- let &cpoptions = old_cpoptions
-
-endfunction
-
-function! s:YRWindowActionN(op, cmd_mode)
- let v_count = v:count
- " If no count was specified it will have a value of 0
- " so set it to at least 1
- let v_count = ((v_count > 0)?(v_count):1)
-
- if v_count > 1
- if !exists("b:yankring_show_range_error")
- let b:yankring_show_range_error = v_count
- else
- let b:yankring_show_range_error = b:yankring_show_range_error - 1
- endif
-
- if b:yankring_show_range_error == 1
- call s:YRWarningMsg("YR:Use visual mode if you need to specify a count")
- unlet b:yankring_show_range_error
- endif
- return
- endif
-
- call s:YRWindowAction(a:op, a:cmd_mode)
- let v_count = v_count - 1
-
- if g:yankring_window_auto_close == 1 && v_count == 0 && a:op != 'd'
- " If autoclose is set close the window unless
- " you are removing items from the YankRing
- exec 'bdelete '.s:yr_buffer_id
- return ""
- endif
-
- return ""
-endfunction
-
-function! s:YRWindowAction(op, cmd_mode) range
- let default_buffer = ((&clipboard=='unnamed')?'+':'"')
- let opcode = a:op
- let lines = []
- let v_count = v:count
- let cmd_mode = a:cmd_mode
- let firstline = a:firstline
- let lastline = a:lastline
-
- if a:lastline < a:firstline
- let firstline = a:lastline
- let lastline = a:firstline
- endif
-
- if cmd_mode == 'n'
- let v_count = 1
- " If a count was provided (5p), we want to repeat the paste
- " 5 times, but this also alters the a:firstline and a:lastline
- " ranges, which while in normal mode we do not want
- let lastline = firstline
- endif
- " If no count was specified it will have a value of 0
- " so set it to at least 1
- let v_count = ((v_count > 0)?(v_count):1)
-
- if '[dr]' =~ opcode
- " Reverse the order of the lines to act on
- let begin = lastline
- while begin >= firstline
- call add(lines, getline(begin))
- let begin = begin - 1
- endwhile
- else
- " Process the selected items in order
- let begin = firstline
- while begin <= lastline
- call add(lines, getline(begin))
- let begin = begin + 1
- endwhile
- endif
-
- if opcode ==# 'q'
- " Close the yankring window
- if s:yr_winsize_chgd == 1
- " Adjust the Vim window width back to the width
- " it was before we showed the yankring window
- let &columns= &columns - (g:yankring_window_width)
- endif
-
- " Hide the YankRing window
- hide
-
- if bufwinnr(s:yr_buffer_last) != -1
- " If the buffer is visible, switch to it
- exec s:yr_buffer_last_winnr . "wincmd w"
- endif
-
- return
- elseif opcode ==# 's'
- " Switch back to the original buffer
- exec s:yr_buffer_last_winnr . "wincmd w"
-
- call s:YRSearch()
- return
- elseif opcode ==# 'u'
- " Switch back to the original buffer
- exec s:yr_buffer_last_winnr . "wincmd w"
-
- call s:YRShow(0)
- return
- elseif opcode ==# 'a'
- let l:curr_line = line(".")
- " Toggle the auto close setting
- let g:yankring_window_auto_close =
- \ (g:yankring_window_auto_close == 1?0:1)
- " Display the status line / help
- call s:YRWindowStatus(0)
- call cursor(l:curr_line,0)
- return
- elseif opcode ==# 'c'
- let l:curr_line = line(".")
- " Toggle the clipboard monitor setting
- let g:yankring_clipboard_monitor =
- \ (g:yankring_clipboard_monitor == 1?0:1)
- " Display the status line / help
- call s:YRWindowStatus(0)
- call cursor(l:curr_line,0)
- return
- elseif opcode ==# '?'
- " Display the status line / help
- call s:YRWindowStatus(1)
- return
- endif
-
- " Switch back to the original buffer
- exec s:yr_buffer_last_winnr . "wincmd w"
-
- " Intentional case insensitive comparision
- if opcode =~? 'p'
- let cmd = 'YRGetElem '
- let parms = ", '".opcode."' "
- elseif opcode ==? 'r'
- let opcode = 'p'
- let cmd = 'YRGetElem '
- let parms = ", 'p' "
- elseif opcode ==# 'd'
- let cmd = 'YRPop '
- let parms = ""
- endif
-
- " Only execute this code if we are operating on elements
- " within the yankring
- if '[auq?]' !~# opcode
- while v_count > 0
- " let iter = 0
- " let index = 0
- for line in lines
- let elem = matchstr(line, '^\d\+')
- if elem > 0
- if elem > 0 && elem <= s:yr_count
- " if iter > 0 && opcode =~# 'p'
- if opcode =~# 'p'
- " Move to the end of the last pasted item
- " only if pasting after (not above)
- " ']
- endif
- exec cmd . elem . parms
- " let iter += 1
- endif
- endif
- endfor
- let v_count = v_count - 1
- endwhile
-
- if opcode ==# 'd'
- call s:YRShow(0)
- return ""
- endif
-
- if g:yankring_window_auto_close == 1 && cmd_mode == 'v'
- exec 'bdelete '.s:yr_buffer_id
- return ""
- endif
-
- endif
-
- return ""
-
-endfunction
-
-function! s:YRWarningMsg(msg)
- echohl WarningMsg
- echomsg a:msg
- echohl None
-endfunction
-
-function! s:YRErrorMsg(msg)
- echohl ErrorMsg
- echomsg a:msg
- echohl None
-endfunction
-
-function! s:YRWinLeave()
- " Track which window we are last in. We will use this information
- " to determine where we need to paste any contents, or which
- " buffer to return to.
-
- if s:yr_buffer_id < 0
- " The yankring window has never been activated
- return
- endif
-
- if winbufnr(winnr()) == s:yr_buffer_id
- " Ignore leaving the yankring window
- return
- endif
-
- if bufwinnr(s:yr_buffer_id) != -1
- " YankRing window is visible, so save off the previous buffer ids
- let s:yr_buffer_last_winnr = winnr()
- let s:yr_buffer_last = winbufnr(s:yr_buffer_last_winnr)
- " else
- " let s:yr_buffer_last_winnr = -1
- " let s:yr_buffer_last = -1
- endif
-endfunction
-
-function! s:YRFocusGained()
- if g:yankring_clipboard_monitor == 1
- " If the clipboard has changed record it inside the yankring
- " echomsg "YRFocusGained[".len(@+)."][".@+.']['.s:yr_prev_clipboard.']'
- if len(@+) > 0 && @+ != s:yr_prev_clipboard
- let elem = s:YRMRUElemFormat(
- \ getreg('+')
- \ , getregtype('+')
- \ )
- let found = s:YRMRUHas('s:yr_history_list', elem)
-
- " Only add the item to the "top" of the ring if it is
- " not in the ring already.
- if found == -1
- call YRRecord("+")
- " silent! call YRRecord("+")
- endif
- endif
-
- " If the yankring window is open, refresh it
- call s:YRWindowUpdate()
- endif
-endfunction
-
-function! s:YRInsertLeave()
- " The YankRing uses omaps to execute the prescribed motion
- " and then appends to the motion a call to a YankRing
- " function to record the contents of the changed register.
- "
- " We cannot append a function call to the end of a motion
- " that results in Insert mode. For example, any command
- " like 'cw' enters insert mode. Appending a function call
- " after the w, simply writes out the call as if the user
- " typed it.
- "
- " Using the InsertLeave event, allows us to capture the
- " contents of any changed register after it completes.
-
- call YRRecord(s:YRRegister())
-
- " When performing a change (not a yank or delete)
- " it is not possible to call <SID>yrrecord at the end
- " of the command (or it's contents will be inserted
- " into the buffer instead of executed).
- " So, when using ".", we have to remove the _zap_
- " keys and then re-add them back again after we
- " record the updates.
- if s:yr_remove_omap_dot == 1
- call s:YRMapsCreate('add_only_zap_keys')
- endif
-
-endfunction
-
-" Deleting autocommands first is a good idea especially if we want to reload
-" the script without restarting vim.
-" Call YRFocusGained to check if the clipboard has been updated
-augroup YankRing
- autocmd!
- autocmd VimEnter * :if has('clipboard') | call <SID>YRFocusGained() | endif
- autocmd WinLeave * :call <SID>YRWinLeave()
- autocmd FocusGained * :if has('clipboard') | call <SID>YRFocusGained() | endif
- autocmd InsertLeave * :call <SID>YRInsertLeave()
-augroup END
-
-
-" copy register
-inoremap <script> <SID>YRGetChar <c-r>=YRGetChar()<CR>
-" inoremap <script> <SID>YRGetSearch <c-r>=YRGetSearch()<CR>
-nnoremap <silent> <SID>yrrecord :call YRRecord3()<cr>
-inoremap <silent> <SID>yrrecord <C-R>=YRRecord3()<cr>
-
-
-" Public commands
-command! YRClear call s:YRClear()
-command! -nargs=0 YRMapsCreate call s:YRMapsCreate()
-command! -nargs=0 YRMapsDelete call s:YRMapsDelete()
-command! -range -bang -nargs=? YRDeleteRange <line1>,<line2>call s:YRYankRange(<bang>1, <args>)
-command! -nargs=* YRGetElem call s:YRGetElem(<args>)
-command! -bang -nargs=? YRGetMultiple call s:YRGetMultiple(<bang>0, <args>)
-command! -count -register -nargs=* YRPaste call s:YRPaste(0,1,<args>)
-command! -nargs=? YRPop <line1>,<line2>call s:YRPop(<args>)
-command! -register -nargs=? YRPush call s:YRPush(<args>)
-command! -count -register -nargs=* YRReplace call s:YRPaste(1,<args>)
-command! -nargs=? YRSearch call s:YRSearch(<q-args>)
-command! -nargs=? YRShow call s:YRShow(<args>)
-command! -nargs=? YRToggle call s:YRToggle(<args>)
-command! -count -register -nargs=* YRYankCount call s:YRYankCount(<args>)
-command! -range -bang -nargs=? YRYankRange <line1>,<line2>call s:YRYankRange(<bang>0, <args>)
-" command! -range -bang -nargs=0 YRMapsMacro <line1>,<line2>call s:YRMapsMacro(<bang>0, <args>)
-
-" Menus
-if has("gui_running") && has("menu") && g:yankring_default_menu_mode != 0
- if g:yankring_default_menu_mode == 1
- let menuRoot = 'YankRing'
- let menuPriority = ''
- elseif g:yankring_default_menu_mode == 2
- let menuRoot = '&YankRing'
- let menuPriority = ''
- elseif g:yankring_default_menu_mode == 3
- let menuRoot = exists("g:yankring_menu_root") ? g:yankring_menu_root : '&Plugin.&YankRing'
- let menuPriority = exists("g:yankring_menu_priority") ? yankring_menu_priority : ''
- else
- let menuRoot = '&Plugin.&YankRing'
- let menuPriority = ''
- endif
-
- let leader = '\'
- if exists('g:mapleader')
- let leader = g:mapleader
- endif
- let leader = escape(leader, '\')
-
- exec 'noremenu <script> '.menuPriority.' '.menuRoot.'.YankRing\ Window :YRShow<CR>'
- exec 'noremenu <script> '.menuPriority.' '.menuRoot.'.YankRing\ Search :YRSearch<CR>'
- exec 'noremenu <script> '.menuPriority.' '.menuRoot.'.Replace\ with\ Previous<TAB>'.leader.'<C-P> :YRReplace ''-1'', ''P''<CR>'
- exec 'noremenu <script> '.menuPriority.' '.menuRoot.'.Replace\ with\ Next<TAB>'.leader.'<C-N> :YRReplace ''1'', ''P''<CR>'
- exec 'noremenu <script> '.menuPriority.' '.menuRoot.'.Clear :YRClear<CR>'
- exec 'noremenu <script> '.menuPriority.' '.menuRoot.'.Toggle :YRToggle<CR>'
-endif
-
-if g:yankring_enabled == 1
- " Create YankRing Maps
- call s:YRMapsCreate()
-endif
-
-call s:YRInit()
-call s:YRHistoryRead()
-
-" vim:fdm=marker:nowrap:ts=4:expandtab:
diff --git a/vim/plugin/zencoding.vim b/vim/plugin/zencoding.vim
deleted file mode 100644
index a92bcec..0000000
--- a/vim/plugin/zencoding.vim
+++ /dev/null
@@ -1,137 +0,0 @@
-"=============================================================================
-" File: zencoding.vim
-" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
-" Last Change: 14-Jan-2011.
-" Version: 0.52
-" WebPage: http://github.com/mattn/zencoding-vim
-" Description: vim plugins for HTML and CSS hi-speed coding.
-" SeeAlso: http://code.google.com/p/zen-coding/
-" Usage:
-"
-" This is vim script support expanding abbreviation like zen-coding.
-" ref: http://code.google.com/p/zen-coding/
-"
-" Type abbreviation
-" +-------------------------------------
-" | html:5_
-" +-------------------------------------
-" "_" is a cursor position. and type "<c-y>," (Ctrl+y and Comma)
-" NOTE: Don't worry about key map. you can change it easily.
-" +-------------------------------------
-" | <!DOCTYPE HTML>
-" | <html lang="en">
-" | <head>
-" | <title></title>
-" | <meta charset="UTF-8">
-" | </head>
-" | <body>
-" | _
-" | </body>
-" | </html>
-" +-------------------------------------
-" Type following
-" +-------------------------------------
-" | div#foo$*2>div.bar
-" +-------------------------------------
-" And type "<c-y>,"
-" +-------------------------------------
-" |<div id="foo1">
-" | <div class="bar">_</div>
-" |</div>
-" |<div id="foo2">
-" | <div class="bar"></div>
-" |</div>
-" +-------------------------------------
-"
-" Tips:
-"
-" You can customize behavior of expanding with overriding config.
-" This configuration will be marged at loading plugin.
-"
-" let g:user_zen_settings = {
-" \ 'indentation' : ' ',
-" \ 'perl' : {
-" \ 'aliases' : {
-" \ 'req' : 'require '
-" \ },
-" \ 'snippets' : {
-" \ 'use' : "use strict\nuse warnings\n\n",
-" \ 'warn' : "warn \"|\";",
-" \ }
-" \ }
-" \}
-"
-" You can set language attribute in html using 'zen_settings.lang'.
-"
-" GetLatestVimScripts: 2981 1 :AutoInstall: zencoding.vim
-" script type: plugin
-
-if &cp || (exists('g:loaded_zencoding_vim') && g:loaded_zencoding_vim)
- finish
-endif
-let g:loaded_zencoding_vim = 1
-
-let s:save_cpo = &cpo
-set cpo&vim
-
-if !exists('g:zencoding_debug')
- let g:zencoding_debug = 0
-endif
-
-if exists('g:use_zen_complete_tag') && g:use_zen_complete_tag
- setlocal omnifunc=zencoding#CompleteTag
-endif
-
-if !exists('g:user_zen_leader_key')
- let g:user_zen_leader_key = '<c-y>'
-endif
-
-function! s:install_plugin()
- for item in [
- \ {'mode': 'i', 'var': 'user_zen_expandabbr_key', 'key': ',', 'plug': 'ZenCodingExpandAbbr', 'func': '<c-g>u<esc>:call zencoding#expandAbbr(0)<cr>a'},
- \ {'mode': 'v', 'var': 'user_zen_expandabbr_key', 'key': ',', 'plug': 'ZenCodingExpandVisual', 'func': ':call zencoding#expandAbbr(2)<cr>'},
- \ {'mode': 'n', 'var': 'user_zen_expandabbr_key', 'key': ',', 'plug': 'ZenCodingExpandNormal', 'func': ':call zencoding#expandAbbr(3)<cr>'},
- \ {'mode': 'i', 'var': 'user_zen_expandword_key', 'key': ';', 'plug': 'ZenCodingExpandWord', 'func': '<c-g>u<esc>:call zencoding#expandAbbr(1)<cr>a'},
- \ {'mode': 'n', 'var': 'user_zen_expandword_key', 'key': ',', 'plug': 'ZenCodingExpandWord', 'func': ':call zencoding#expandAbbr(1)<cr>'},
- \ {'mode': 'i', 'var': 'user_zen_balancetaginward_key', 'key': 'd', 'plug': 'ZenCodingBalanceTagInwardInsert', 'func': '<esc>:call zencoding#balanceTag(1)<cr>a'},
- \ {'mode': 'n', 'var': 'user_zen_balancetaginward_key', 'key': 'd', 'plug': 'ZenCodingBalanceTagInwardNormal', 'func': ':call zencoding#balanceTag(1)<cr>'},
- \ {'mode': 'v', 'var': 'user_zen_balancetaginward_key', 'key': 'd', 'plug': 'ZenCodingBalanceTagInwardVisual', 'func': ':call zencoding#balanceTag(2)<cr>'},
- \ {'mode': 'i', 'var': 'user_zen_balancetagoutward_key', 'key': 'D', 'plug': 'ZenCodingBalanceTagOutwardInsert', 'func': '<esc>:call zencoding#balanceTag(-1)<cr>a'},
- \ {'mode': 'n', 'var': 'user_zen_balancetagoutward_key', 'key': 'D', 'plug': 'ZenCodingBalanceTagOutwardNormal', 'func': ':call zencoding#balanceTag(-1)<cr>'},
- \ {'mode': 'v', 'var': 'user_zen_balancetagoutward_key', 'key': 'D', 'plug': 'ZenCodingBalanceTagOutwardVisual', 'func': ':call zencoding#balanceTag(-2)<cr>'},
- \ {'mode': 'i', 'var': 'user_zen_next_key', 'key': 'n', 'plug': 'ZenCodingNext', 'func': '<esc>:call zencoding#moveNextPrev(0)<cr>'},
- \ {'mode': 'n', 'var': 'user_zen_next_key', 'key': 'n', 'plug': 'ZenCodingNext', 'func': ':call zencoding#moveNextPrev(0)<cr>'},
- \ {'mode': 'i', 'var': 'user_zen_prev_key', 'key': 'N', 'plug': 'ZenCodingPrev', 'func': '<esc>:call zencoding#moveNextPrev(1)<cr>'},
- \ {'mode': 'n', 'var': 'user_zen_prev_key', 'key': 'N', 'plug': 'ZenCodingPrev', 'func': ':call zencoding#moveNextPrev(1)<cr>'},
- \ {'mode': 'i', 'var': 'user_zen_imagesize_key', 'key': 'i', 'plug': 'ZenCodingImageSize', 'func': '<esc>:call zencoding#imageSize()<cr>a'},
- \ {'mode': 'n', 'var': 'user_zen_imagesize_key', 'key': 'i', 'plug': 'ZenCodingImageSize', 'func': ':call zencoding#imageSize()<cr>'},
- \ {'mode': 'i', 'var': 'user_zen_togglecomment_key', 'key': '/', 'plug': 'ZenCodingToggleComment', 'func': '<esc>:call zencoding#toggleComment()<cr>a'},
- \ {'mode': 'n', 'var': 'user_zen_togglecomment_key', 'key': '/', 'plug': 'ZenCodingToggleComment', 'func': ':call zencoding#toggleComment()<cr>'},
- \ {'mode': 'i', 'var': 'user_zen_splitjointag_key', 'key': 'j', 'plug': 'ZenCodingSplitJoinTagInsert', 'func': '<esc>:call zencoding#splitJoinTag()<cr>a'},
- \ {'mode': 'n', 'var': 'user_zen_splitjointag_key', 'key': 'j', 'plug': 'ZenCodingSplitJoinTagNormal', 'func': ':call zencoding#splitJoinTag()<cr>'},
- \ {'mode': 'i', 'var': 'user_zen_removetag_key', 'key': 'k', 'plug': 'ZenCodingRemoveTag', 'func': '<esc>:call zencoding#removeTag()<cr>a'},
- \ {'mode': 'n', 'var': 'user_zen_removetag_key', 'key': 'k', 'plug': 'ZenCodingRemoveTag', 'func': ':call zencoding#removeTag()<cr>'},
- \ {'mode': 'i', 'var': 'user_zen_anchorizeurl_key', 'key': 'a', 'plug': 'ZenCodingAnchorizeURL', 'func': '<esc>:call zencoding#anchorizeURL(0)<cr>a'},
- \ {'mode': 'n', 'var': 'user_zen_anchorizeurl_key', 'key': 'a', 'plug': 'ZenCodingAnchorizeURL', 'func': ':call zencoding#anchorizeURL(0)<cr>'},
- \ {'mode': 'i', 'var': 'user_zen_anchorizesummary_key', 'key': 'A', 'plug': 'ZenCodingAnchorizeSummary', 'func': '<esc>:call zencoding#anchorizeURL(1)<cr>a'},
- \ {'mode': 'n', 'var': 'user_zen_anchorizesummary_key', 'key': 'A', 'plug': 'ZenCodingAnchorizeSummary', 'func': ':call zencoding#anchorizeURL(1)<cr>'},
- \]
-
- if !hasmapto('<plug>'.item.plug, item.mode)
- exe item.mode . 'noremap <silent> <plug>' . item.plug . ' ' . item.func
- endif
- if !exists('g:' . item.var)
- exe 'let g:' . item.var . " = '" . g:user_zen_leader_key . item.key . "'"
- endif
- if len(maparg(eval('g:' . item.var), item.mode)) == 0
- exe item.mode . 'map <silent> <unique> ' . eval('g:' . item.var) . ' <plug>' . item.plug
- endif
- endfor
-endfunction
-call s:install_plugin()
-delfunction s:install_plugin
-
-let &cpo = s:save_cpo
-unlet s:save_cpo
-
-" vim:set et:
diff --git a/vim/snippets/_.snippets b/vim/snippets/_.snippets
deleted file mode 100644
index c3925a5..0000000
--- a/vim/snippets/_.snippets
+++ /dev/null
@@ -1,7 +0,0 @@
-# Global snippets
-
-# (c) holds no legal value ;)
-snippet c)
- `&enc[:2] == "utf" ? "©" : "(c)"` Copyright `strftime("%Y")` ${1:`g:snips_author`}. All Rights Reserved.${2}
-snippet date
- `strftime("%Y-%m-%d")`
diff --git a/vim/snippets/autoit.snippets b/vim/snippets/autoit.snippets
deleted file mode 100644
index 690018c..0000000
--- a/vim/snippets/autoit.snippets
+++ /dev/null
@@ -1,66 +0,0 @@
-snippet if
- If ${1:condition} Then
- ${2:; True code}
- EndIf
-snippet el
- Else
- ${1}
-snippet elif
- ElseIf ${1:condition} Then
- ${2:; True code}
-# If/Else block
-snippet ifel
- If ${1:condition} Then
- ${2:; True code}
- Else
- ${3:; Else code}
- EndIf
-# If/ElseIf/Else block
-snippet ifelif
- If ${1:condition 1} Then
- ${2:; True code}
- ElseIf ${3:condition 2} Then
- ${4:; True code}
- Else
- ${5:; Else code}
- EndIf
-# Switch block
-snippet switch
- Switch (${1:condition})
- Case {$2:case1}:
- {$3:; Case 1 code}
- Case Else:
- {$4:; Else code}
- EndSwitch
-# Select block
-snippet select
- Select (${1:condition})
- Case {$2:case1}:
- {$3:; Case 1 code}
- Case Else:
- {$4:; Else code}
- EndSelect
-# While loop
-snippet while
- While (${1:condition})
- ${2:; code...}
- WEnd
-# For loop
-snippet for
- For ${1:n} = ${3:1} to ${2:count}
- ${4:; code...}
- Next
-# New Function
-snippet func
- Func ${1:fname}(${2:`indent('.') ? 'self' : ''`}):
- ${4:Return}
- EndFunc
-# Message box
-snippet msg
- MsgBox(${3:MsgType}, ${1:"Title"}, ${2:"Message Text"})
-# Debug Message
-snippet debug
- MsgBox(0, "Debug", ${1:"Debug Message"})
-# Show Variable Debug Message
-snippet showvar
- MsgBox(0, "${1:VarName}", $1)
diff --git a/vim/snippets/c.snippets b/vim/snippets/c.snippets
deleted file mode 100644
index 8824329..0000000
--- a/vim/snippets/c.snippets
+++ /dev/null
@@ -1,107 +0,0 @@
-# main()
-snippet main
- int main(int argc, const char *argv[])
- {
- ${1}
- return 0;
- }
-# #include <...>
-snippet inc
- #include <${1:stdio}.h>${2}
-# #include "..."
-snippet Inc
- #include "${1:`Filename("$1.h")`}"${2}
-# #ifndef ... #define ... #endif
-snippet Def
- #ifndef $1
- #define ${1:SYMBOL} ${2:value}
- #endif${3}
-snippet def
- #define
-snippet ifdef
- #ifdef ${1:FOO}
- ${2:#define }
- #endif
-snippet #if
- #if ${1:FOO}
- ${2}
- #endif
-# Header Include-Guard
-snippet once
- #ifndef ${1:`toupper(Filename('', 'UNTITLED').'_H')`}
- #define $1
-
- ${2}
-
- #endif
-# If Condition
-snippet if
- if (${1:/* condition */}) {
- ${2:/* code */}
- }
-snippet el
- else {
- ${1}
- }
-# Tertiary conditional
-snippet t
- ${1:/* condition */} ? ${2:a} : ${3:b}
-# Do While Loop
-snippet do
- do {
- ${2:/* code */}
- } while (${1:/* condition */});
-# While Loop
-snippet wh
- while (${1:/* condition */}) {
- ${2:/* code */}
- }
-# For Loop
-snippet for
- for (${1:int }${2:i} = 0; $2 < ${3:count}; $2${4:++}) {
- ${5:/* code */}
- }
-# Custom For Loop
-snippet forr
- for (${1:int }${2:i} = ${3:0}; ${4:$2 < 10}; $2${5:++}) {
- ${6:/* code */}
- }
-# Function
-snippet fun
- ${1:void} ${2:function_name}(${3})
- {
- ${4:/* code */}
- }
-# Function Declaration
-snippet fund
- ${1:void} ${2:function_name}(${3});${4}
-# Typedef
-snippet td
- typedef ${1:int} ${2:MyCustomType};${3}
-# Struct
-snippet st
- struct ${1:`Filename('$1_t', 'name')`} {
- ${2:/* data */}
- }${3: /* optional variable list */};${4}
-# Typedef struct
-snippet tds
- typedef struct ${2:_$1 }{
- ${3:/* data */}
- } ${1:`Filename('$1_t', 'name')`};
-# Typdef enum
-snippet tde
- typedef enum {
- ${1:/* data */}
- } ${2:foo};
-# printf
-# unfortunately version this isn't as nice as TextMates's, given the lack of a
-# dynamic `...`
-snippet pr
- printf("${1:%s}\n"${2});${3}
-# fprintf (again, this isn't as nice as TextMate's version, but it works)
-snippet fpr
- fprintf(${1:stderr}, "${2:%s}\n"${3});${4}
-snippet .
- [${1}]${2}
-snippet un
- unsigned
diff --git a/vim/snippets/cpp.snippets b/vim/snippets/cpp.snippets
deleted file mode 100644
index 65fe5e1..0000000
--- a/vim/snippets/cpp.snippets
+++ /dev/null
@@ -1,37 +0,0 @@
-# Read File Into Vector
-snippet readfile
- std::vector<char> v;
- if (FILE *${2:fp} = fopen(${1:"filename"}, "r")) {
- char buf[1024];
- while (size_t len = fread(buf, 1, sizeof(buf), $2))
- v.insert(v.end(), buf, buf + len);
- fclose($2);
- }${3}
-# std::map
-snippet map
- std::map<${1:key}, ${2:value}> ${3};
-# std::vector
-snippet vector
- std::vector<${1:char}> ${2};
-# Namespace
-snippet ns
- namespace ${1:`Filename('', 'my')`} {
- ${2}
- }
-# Class
-snippet cl
- class ${1:`Filename('$1', 'name')`} {
- public:
- $1(${2:arguments});
- virtual ~$1();
-
- private:
- ${3:/* data */}
- };
-# for loop with iterators
-snippet forv
- for (std::vector<${1:int}>::const_iterator ${2:it} = ${3:vec}.begin();
- $2 != $3.end();
- ++$2) {
- ${4:/* code */}
- }
diff --git a/vim/snippets/html.snippets b/vim/snippets/html.snippets
deleted file mode 100644
index aefb9db..0000000
--- a/vim/snippets/html.snippets
+++ /dev/null
@@ -1,190 +0,0 @@
-# Some useful Unicode entities
-# Non-Breaking Space
-snippet nbs
- &nbsp;
-# â†
-snippet left
- &#x2190;
-# →
-snippet right
- &#x2192;
-# ↑
-snippet up
- &#x2191;
-# ↓
-snippet down
- &#x2193;
-# ↩
-snippet return
- &#x21A9;
-# ⇤
-snippet backtab
- &#x21E4;
-# ⇥
-snippet tab
- &#x21E5;
-# ⇧
-snippet shift
- &#x21E7;
-# ⌃
-snippet control
- &#x2303;
-# ⌅
-snippet enter
- &#x2305;
-# ⌘
-snippet command
- &#x2318;
-# ⌥
-snippet option
- &#x2325;
-# ⌦
-snippet delete
- &#x2326;
-# ⌫
-snippet backspace
- &#x232B;
-# ⎋
-snippet escape
- &#x238B;
-# Generic Doctype
-snippet doctype HTML 4.01 Strict
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""
- "http://www.w3.org/TR/html4/strict.dtd">
-snippet doctype HTML 4.01 Transitional
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""
- "http://www.w3.org/TR/html4/loose.dtd">
-snippet doctype HTML 5
- <!DOCTYPE HTML>
-snippet doctype XHTML 1.0 Frameset
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-snippet doctype XHTML 1.0 Strict
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-snippet doctype XHTML 1.0 Transitional
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-snippet doctype XHTML 1.1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
- "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-# HTML Doctype 4.01 Strict
-snippet docts
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""
- "http://www.w3.org/TR/html4/strict.dtd">
-# HTML Doctype 4.01 Transitional
-snippet doct
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""
- "http://www.w3.org/TR/html4/loose.dtd">
-# HTML Doctype 5
-snippet doct5
- <!DOCTYPE HTML>
-# XHTML Doctype 1.0 Frameset
-snippet docxf
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
-# XHTML Doctype 1.0 Strict
-snippet docxs
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-# XHTML Doctype 1.0 Transitional
-snippet docxt
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-# XHTML Doctype 1.1
-snippet docx
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
- "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-snippet html
- <html>
- ${1}
- </html>
-snippet xhtml
- <html xmlns="http://www.w3.org/1999/xhtml">
- ${1}
- </html>
-snippet body
- <body>
- ${1}
- </body>
-snippet head
- <head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8"`Close()`>
-
- <title>${1:`substitute(Filename('', 'Page Title'), '^.', '\u&', '')`}</title>
- ${2}
- </head>
-snippet title
- <title>${1:`substitute(Filename('', 'Page Title'), '^.', '\u&', '')`}</title>${2}
-snippet script
- <script type="text/javascript" charset="utf-8">
- ${1}
- </script>${2}
-snippet scriptsrc
- <script src="${1}.js" type="text/javascript" charset="utf-8"></script>${2}
-snippet style
- <style type="text/css" media="${1:screen}">
- ${2}
- </style>${3}
-snippet base
- <base href="${1}" target="${2}"`Close()`>
-snippet r
- <br`Close()[1:]`>
-snippet div
- <div id="${1:name}">
- ${2}
- </div>
-# Embed QT Movie
-snippet movie
- <object width="$2" height="$3" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
- codebase="http://www.apple.com/qtactivex/qtplugin.cab">
- <param name="src" value="$1"`Close()`>
- <param name="controller" value="$4"`Close()`>
- <param name="autoplay" value="$5"`Close()`>
- <embed src="${1:movie.mov}"
- width="${2:320}" height="${3:240}"
- controller="${4:true}" autoplay="${5:true}"
- scale="tofit" cache="true"
- pluginspage="http://www.apple.com/quicktime/download/"
- `Close()[1:]`>
- </object>${6}
-snippet fieldset
- <fieldset id="$1">
- <legend>${1:name}</legend>
-
- ${3}
- </fieldset>
-snippet form
- <form action="${1:`Filename('$1_submit')`}" method="${2:get}" accept-charset="utf-8">
- ${3}
-
-
- <p><input type="submit" value="Continue &rarr;"`Close()`></p>
- </form>
-snippet h1
- <h1 id="${1:heading}">${2:$1}</h1>
-snippet input
- <input type="${1:text/submit/hidden/button}" name="${2:some_name}" value="${3}"`Close()`>${4}
-snippet label
- <label for="${2:$1}">${1:name}</label><input type="${3:text/submit/hidden/button}" name="${4:$2}" value="${5}" id="${6:$2}"`Close()`>${7}
-snippet link
- <link rel="${1:stylesheet}" href="${2:/css/master.css}" type="text/css" media="${3:screen}" charset="utf-8"`Close()`>${4}
-snippet mailto
- <a href="mailto:${1:joe@example.com}?subject=${2:feedback}">${3:email me}</a>
-snippet meta
- <meta name="${1:name}" content="${2:content}"`Close()`>${3}
-snippet opt
- <option value="${1:option}">${2:$1}</option>${3}
-snippet optt
- <option>${1:option}</option>${2}
-snippet select
- <select name="${1:some_name}" id="${2:$1}">
- <option value="${3:option}">${4:$3}</option>
- </select>${5}
-snippet table
- <table border="${1:0}">
- <tr><th>${2:Header}</th></tr>
- <tr><th>${3:Data}</th></tr>
- </table>${4}
-snippet textarea
- <textarea name="${1:Name}" rows="${2:8}" cols="${3:40}">${4}</textarea>${5}
diff --git a/vim/snippets/java.snippets b/vim/snippets/java.snippets
deleted file mode 100644
index fd705cb..0000000
--- a/vim/snippets/java.snippets
+++ /dev/null
@@ -1,78 +0,0 @@
-snippet main
- public static void main (String [] args)
- {
- ${1:/* code */}
- }
-snippet pu
- public
-snippet po
- protected
-snippet pr
- private
-snippet st
- static
-snippet fi
- final
-snippet ab
- abstract
-snippet re
- return
-snippet br
- break;
-snippet de
- default:
- ${1}
-snippet ca
- catch(${1:Exception} ${2:e}) ${3}
-snippet th
- throw
-snippet sy
- synchronized
-snippet im
- import
-snippet j.u
- java.util
-snippet j.i
- java.io.
-snippet j.b
- java.beans.
-snippet j.n
- java.net.
-snippet j.m
- java.math.
-snippet if
- if (${1}) ${2}
-snippet el
- else
-snippet elif
- else if (${1}) ${2}
-snippet wh
- while (${1}) ${2}
-snippet for
- for (${1}; ${2}; ${3}) ${4}
-snippet fore
- for (${1} : ${2}) ${3}
-snippet sw
- switch (${1}) ${2}
-snippet cs
- case ${1}:
- ${2}
- ${3}
-snippet tc
- public class ${1:`Filename()`} extends ${2:TestCase}
-snippet t
- public void test${1:Name}() throws Exception ${2}
-snippet cl
- class ${1:`Filename("", "untitled")`} ${2}
-snippet in
- interface ${1:`Filename("", "untitled")`} ${2:extends Parent}${3}
-snippet m
- ${1:void} ${2:method}(${3}) ${4:throws }${5}
-snippet v
- ${1:String} ${2:var}${3: = null}${4};${5}
-snippet co
- static public final ${1:String} ${2:var} = ${3};${4}
-snippet cos
- static public final String ${1:var} = "${2}";${3}
-snippet as
- assert ${1:test} : "${2:Failure message}";${3}
diff --git a/vim/snippets/javascript.snippets b/vim/snippets/javascript.snippets
deleted file mode 100644
index 37986a5..0000000
--- a/vim/snippets/javascript.snippets
+++ /dev/null
@@ -1,74 +0,0 @@
-# Prototype
-snippet proto
- ${1:class_name}.prototype.${2:method_name} =
- function(${3:first_argument}) {
- ${4:// body...}
- };
-# Function
-snippet fun
- function ${1:function_name} (${2:argument}) {
- ${3:// body...}
- }
-# Anonymous Function
-snippet f
- function(${1}) {${2}};
-# if
-snippet if
- if (${1:true}) {${2}};
-# if ... else
-snippet ife
- if (${1:true}) {${2}}
- else {${3}};
-# tertiary conditional
-snippet t
- ${1:/* condition */} ? ${2:a} : ${3:b}
-# switch
-snippet switch
- switch(${1:expression}) {
- case '${3:case}':
- ${4:// code}
- break;
- ${5}
- default:
- ${2:// code}
- }
-# case
-snippet case
- case '${1:case}':
- ${2:// code}
- break;
- ${3}
-# for (...) {...}
-snippet for
- for (var ${2:i} = 0; $2 < ${1:Things}.length; $2${3:++}) {
- ${4:$1[$2]}
- };
-# for (...) {...} (Improved Native For-Loop)
-snippet forr
- for (var ${2:i} = ${1:Things}.length - 1; $2 >= 0; $2${3:--}) {
- ${4:$1[$2]}
- };
-# while (...) {...}
-snippet wh
- while (${1:/* condition */}) {
- ${2:/* code */}
- }
-# do...while
-snippet do
- do {
- ${2:/* code */}
- } while (${1:/* condition */});
-# Object Method
-snippet :f
- ${1:method_name}: function(${2:attribute}) {
- ${4}
- }${3:,}
-# setTimeout function
-snippet timeout
- setTimeout(function() {${3}}${2}, ${1:10};
-# Get Elements
-snippet get
- getElementsBy${1:TagName}('${2}')${3}
-# Get Element
-snippet gett
- getElementBy${1:Id}('${2}')${3}
diff --git a/vim/snippets/mako.snippets b/vim/snippets/mako.snippets
deleted file mode 100644
index 2a0aef9..0000000
--- a/vim/snippets/mako.snippets
+++ /dev/null
@@ -1,54 +0,0 @@
-snippet def
- <%def name="${1:name}">
- ${2:}
- </%def>
-snippet call
- <%call expr="${1:name}">
- ${2:}
- </%call>
-snippet doc
- <%doc>
- ${1:}
- </%doc>
-snippet text
- <%text>
- ${1:}
- </%text>
-snippet for
- % for ${1:i} in ${2:iter}:
- ${3:}
- % endfor
-snippet if if
- % if ${1:condition}:
- ${2:}
- % endif
-snippet if if/else
- % if ${1:condition}:
- ${2:}
- % else:
- ${3:}
- % endif
-snippet try
- % try:
- ${1:}
- % except${2:}:
- ${3:pass}
- % endtry
-snippet wh
- % while ${1:}:
- ${2:}
- % endwhile
-snippet $
- ${ ${1:} }
-snippet <%
- <% ${1:} %>
-snippet <!%
- <!% ${1:} %>
-snippet inherit
- <%inherit file="${1:filename}" />
-snippet include
- <%include file="${1:filename}" />
-snippet namespace
- <%namespace file="${1:name}" />
-snippet page
- <%page args="${1:}" />
diff --git a/vim/snippets/objc.snippets b/vim/snippets/objc.snippets
deleted file mode 100644
index 4749bb7..0000000
--- a/vim/snippets/objc.snippets
+++ /dev/null
@@ -1,184 +0,0 @@
-# #import <...>
-snippet Imp
- #import <${1:Cocoa/Cocoa.h}>${2}
-# #import "..."
-snippet imp
- #import "${1:`Filename()`.h}"${2}
-# @selector(...)
-snippet sel
- @selector(${1:method}:)${3}
-# @"..." string
-snippet s
- @"${1}"${2}
-# Object
-snippet o
- ${1:NSObject} *${2:foo} = [${3:$1 alloc}]${4};${5}
-# NSLog(...)
-snippet log
- NSLog(@"${1:%@}"${2});${3}
-# Class
-snippet objc
- @interface ${1:`Filename('', 'someClass')`} : ${2:NSObject}
- {
- }
- @end
-
- @implementation $1
- ${3}
- @end
-# Class Interface
-snippet int
- @interface ${1:`Filename('', 'someClass')`} : ${2:NSObject}
- {${3}
- }
- ${4}
- @end
-# Class Implementation
-snippet impl
- @implementation ${1:`Filename('', 'someClass')`}
- ${2}
- @end
-snippet init
- - (id)init
- {
- [super init];
- return self;
- }
-snippet ifself
- if (self = [super init]) {
- ${1:/* code */}
- }
- return self;
-snippet ibo
- IBOutlet ${1:NSSomeClass} *${2:$1};${3}
-# Category
-snippet cat
- @interface ${1:NSObject} (${2:Category})
- @end
-
- @implementation $1 ($2)
- ${3}
- @end
-# Category Interface
-snippet cath
- @interface ${1:NSObject} (${2:Category})
- ${3}
- @end
-# NSArray
-snippet array
- NSMutableArray *${1:array} = [NSMutable array];${2}
-# NSDictionary
-snippet dict
- NSMutableDictionary *${1:dict} = [NSMutableDictionary dictionary];${2}
-# NSBezierPath
-snippet bez
- NSBezierPath *${1:path} = [NSBezierPath bezierPath];${2}
-# Method
-snippet m
- - (${1:id})${2:method}
- {
- ${3}
- }
-# Method declaration
-snippet md
- - (${1:id})${2:method};${3}
-# IBAction declaration
-snippet ibad
- - (IBAction)${1:method}:(${2:id})sender;${3}
-# IBAction method
-snippet iba
- - (IBAction)${1:method}:(${2:id})sender
- {
- ${3}
- }
-# awakeFromNib method
-snippet wake
- - (void)awakeFromNib
- {
- ${1}
- }
-# Class Method
-snippet M
- + (${1:id})${2:method}
- {${3}
- return nil;
- }
-# Sub-method (Call super)
-snippet sm
- - (${1:id})${2:method}
- {
- [super $2];${3}
- return self;
- }
-# Method: Initialize
-snippet I
- + (void) initialize
- {
- [[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary dictionaryWIthObjectsAndKeys:
- ${1}@"value", @"key",
- nil]];
- }
-# Accessor Methods For:
-# Object
-snippet objacc
- - (${1:id})${2:thing}
- {
- return $2;
- }
-
- - (void)set$2:($1)${3:new$2}
- {
- [$3 retain];
- [$2 release];
- $2 = $3;
- }${4}
-# for (object in array)
-snippet forin
- for (${1:Class} *${2:some$1} in ${3:array}) {
- ${4}
- }
-snippet forarray
- unsigned int ${1:object}Count = [${2:array} count];
-
- for (unsigned int index = 0; index < $1Count; index++) {
- ${3:id} $1 = [$2 $1AtIndex:index];
- ${4}
- }
-# IBOutlet
-# @property (Objective-C 2.0)
-snippet prop
- @property (${1:retain}) ${2:NSSomeClass} ${3:*$2};${4}
-# @synthesize (Objective-C 2.0)
-snippet syn
- @synthesize ${1:property};${2}
-# [[ alloc] init]
-snippet alloc
- [[${1:foo} alloc] init${2}];${3}
-# retain
-snippet ret
- [${1:foo} retain];${2}
-# release
-snippet rel
- [${1:foo} release];
- ${2:$1 = nil;}
-# autorelease
-snippet arel
- [${1:foo} autorelease];
-# autorelease pool
-snippet pool
- NSAutoreleasePool *${1:pool} = [[NSAutoreleasePool alloc] init];
- ${2:/* code */}
- [$1 drain];
-# Throw an exception
-snippet except
- NSException *${1:badness};
- $1 = [NSException exceptionWithName:@"${2:$1Name}"
- reason:@"${3}"
- userInfo:nil];
- [$1 raise];
-snippet prag
- #pragma mark ${1:foo}
-snippet cl
- @class ${1:Foo};${2}
-snippet color
- [[NSColor ${1:blackColor}] set];
diff --git a/vim/snippets/perl.snippets b/vim/snippets/perl.snippets
index 06c7226..0478676 100644
--- a/vim/snippets/perl.snippets
+++ b/vim/snippets/perl.snippets
@@ -1,50 +1,3 @@
-# #!/usr/bin/perl
-snippet #!
- #!/usr/bin/env perl
-
-# Hash Pointer
-snippet .
- =>
-snippet sub
- sub ${1:foo} {
- ${2}
- }
-snippet if
- if (${1}) {
- ${2:# body...}
- }
-snippet ife
- if (${1}) {
- ${2:# body...}
- }
- else {
- ${3:# else...}
- }
-snippet elsif
- elsif (${1:}) {
- ${2:# else...}
- }
-snippet else
- else {
- ${1:# else...}
- }
-snippet for
- for my $${1:var} (${2:1..10}) {
- ${3}
- }
-snippet fora
- for my $${1:var} (@${2:array}) {
- ${3}
- }
-snippet while
- while (${1:cond}) {
- ${2}
- }
-snippet eval
- eval {${1}};
- if ($@) {
- ${2}
- }
snippet try
try {
${1}
diff --git a/vim/snippets/php.snippets b/vim/snippets/php.snippets
deleted file mode 100644
index 3ce9e26..0000000
--- a/vim/snippets/php.snippets
+++ /dev/null
@@ -1,216 +0,0 @@
-snippet php
- <?php
- ${1}
- ?>
-snippet ec
- echo "${1:string}"${2};
-snippet inc
- include '${1:file}';${2}
-snippet inc1
- include_once '${1:file}';${2}
-snippet req
- require '${1:file}';${2}
-snippet req1
- require_once '${1:file}';${2}
-# $GLOBALS['...']
-snippet globals
- $GLOBALS['${1:variable}']${2: = }${3:something}${4:;}${5}
-snippet $_ COOKIE['...']
- $_COOKIE['${1:variable}']${2}
-snippet $_ ENV['...']
- $_ENV['${1:variable}']${2}
-snippet $_ FILES['...']
- $_FILES['${1:variable}']${2}
-snippet $_ Get['...']
- $_GET['${1:variable}']${2}
-snippet $_ POST['...']
- $_POST['${1:variable}']${2}
-snippet $_ REQUEST['...']
- $_REQUEST['${1:variable}']${2}
-snippet $_ SERVER['...']
- $_SERVER['${1:variable}']${2}
-snippet $_ SESSION['...']
- $_SESSION['${1:variable}']${2}
-# Start Docblock
-snippet /*
- /**
- * ${1}
- **/
-# Class - post doc
-snippet doc_cp
- /**
- * ${1:undocumented class}
- *
- * @package ${2:default}
- * @author ${3:`g:snips_author`}
- **/${4}
-# Class Variable - post doc
-snippet doc_vp
- /**
- * ${1:undocumented class variable}
- *
- * @var ${2:string}
- **/${3}
-# Class Variable
-snippet doc_v
- /**
- * ${3:undocumented class variable}
- *
- * @var ${4:string}
- **/
- ${1:var} $${2};${5}
-# Class
-snippet doc_c
- /**
- * ${3:undocumented class}
- *
- * @packaged ${4:default}
- * @author ${5:`g:snips_author`}
- **/
- ${1:}class ${2:}
- {${6}
- } // END $1class $2
-# Constant Definition - post doc
-snippet doc_dp
- /**
- * ${1:undocumented constant}
- **/${2}
-# Constant Definition
-snippet doc_d
- /**
- * ${3:undocumented constant}
- **/
- define(${1}, ${2});${4}
-# Function - post doc
-snippet doc_fp
- /**
- * ${1:undocumented function}
- *
- * @return ${2:void}
- * @author ${3:`g:snips_author`}
- **/${4}
-# Function signature
-snippet doc_s
- /**
- * ${4:undocumented function}
- *
- * @return ${5:void}
- * @author ${6:`g:snips_author`}
- **/
- ${1}function ${2}(${3});${7}
-# Function
-snippet doc_f
- /**
- * ${4:undocumented function}
- *
- * @return ${5:void}
- * @author ${6:`g:snips_author`}
- **/
- ${1}function ${2}(${3})
- {${7}
- }
-# Header
-snippet doc_h
- /**
- * ${1}
- *
- * @author ${2:`g:snips_author`}
- * @version ${3:$Id$}
- * @copyright ${4:$2}, `strftime('%d %B, %Y')`
- * @package ${5:default}
- **/
-
- /**
- * Define DocBlock
- *//
-# Interface
-snippet doc_i
- /**
- * ${2:undocumented class}
- *
- * @package ${3:default}
- * @author ${4:`g:snips_author`}
- **/
- interface ${1:}
- {${5}
- } // END interface $1
-# class ...
-snippet class
- /**
- * ${1}
- **/
- class ${2:ClassName}
- {
- ${3}
- function ${4:__construct}(${5:argument})
- {
- ${6:// code...}
- }
- }
-# define(...)
-snippet def
- define('${1}'${2});${3}
-# defined(...)
-snippet def?
- ${1}defined('${2}')${3}
-snippet wh
- while (${1:/* condition */}) {
- ${2:// code...}
- }
-# do ... while
-snippet do
- do {
- ${2:// code... }
- } while (${1:/* condition */});
-snippet if
- if (${1:/* condition */}) {
- ${2:// code...}
- }
-snippet ife
- if (${1:/* condition */}) {
- ${2:// code...}
- } else {
- ${3:// code...}
- }
- ${4}
-snippet else
- else {
- ${1:// code...}
- }
-snippet elseif
- elseif (${1:/* condition */}) {
- ${2:// code...}
- }
-# Tertiary conditional
-snippet t
- $${1:retVal} = (${2:condition}) ? ${3:a} : ${4:b};${5}
-snippet switch
- switch ($${1:variable}) {
- case '${2:value}':
- ${3:// code...}
- break;
- ${5}
- default:
- ${4:// code...}
- break;
- }
-snippet case
- case '${1:value}':
- ${2:// code...}
- break;${3}
-snippet for
- for ($${2:i} = 0; $$2 < ${1:count}; $$2${3:++}) {
- ${4: // code...}
- }
-snippet foreach
- foreach ($${1:variable} as $${2:key}) {
- ${3:// code...}
- }
-snippet fun
- ${1:public }function ${2:FunctionName}(${3})
- {
- ${4:// code...}
- }
-# $... = array (...)
-snippet array
- $${1:arrayName} = array('${2}' => ${3});${4}
diff --git a/vim/snippets/python.snippets b/vim/snippets/python.snippets
deleted file mode 100644
index d511184..0000000
--- a/vim/snippets/python.snippets
+++ /dev/null
@@ -1,86 +0,0 @@
-snippet #!
- #!/usr/bin/python
-
-snippet imp
- import ${1:module}
-# Module Docstring
-snippet docs
- '''
- File: ${1:`Filename('$1.py', 'foo.py')`}
- Author: ${2:`g:snips_author`}
- Description: ${3}
- '''
-snippet wh
- while ${1:condition}:
- ${2:# code...}
-snippet for
- for ${1:needle} in ${2:haystack}:
- ${3:# code...}
-# New Class
-snippet cl
- class ${1:ClassName}(${2:object}):
- """${3:docstring for $1}"""
- def __init__(self, ${4:arg}):
- ${5:super($1, self).__init__()}
- self.$4 = $4
- ${6}
-# New Function
-snippet def
- def ${1:fname}(${2:`indent('.') ? 'self' : ''`}):
- """${3:docstring for $1}"""
- ${4:pass}
-snippet deff
- def ${1:fname}(${2:`indent('.') ? 'self' : ''`}):
- ${3}
-# New Method
-snippet defs
- def ${1:mname}(self, ${2:arg}):
- ${3:pass}
-# New Property
-snippet property
- def ${1:foo}():
- doc = "${2:The $1 property.}"
- def fget(self):
- ${3:return self._$1}
- def fset(self, value):
- ${4:self._$1 = value}
-# Lambda
-snippet ld
- ${1:var} = lambda ${2:vars} : ${3:action}
-snippet .
- self.
-snippet try Try/Except
- try:
- ${1:pass}
- except ${2:Exception}, ${3:e}:
- ${4:raise $3}
-snippet try Try/Except/Else
- try:
- ${1:pass}
- except ${2:Exception}, ${3:e}:
- ${4:raise $3}
- else:
- ${5:pass}
-snippet try Try/Except/Finally
- try:
- ${1:pass}
- except ${2:Exception}, ${3:e}:
- ${4:raise $3}
- finally:
- ${5:pass}
-snippet try Try/Except/Else/Finally
- try:
- ${1:pass}
- except ${2:Exception}, ${3:e}:
- ${4:raise $3}
- else:
- ${5:pass}
- finally:
- ${6:pass}
-# if __name__ == '__main__':
-snippet ifmain
- if __name__ == '__main__':
- ${1:main()}
-# __magic__
-snippet _
- __${1:init}__${2}
diff --git a/vim/snippets/ruby.snippets b/vim/snippets/ruby.snippets
deleted file mode 100644
index bf1d7f1..0000000
--- a/vim/snippets/ruby.snippets
+++ /dev/null
@@ -1,420 +0,0 @@
-# #!/usr/bin/ruby
-snippet #!
- #!/usr/bin/ruby
-
-# New Block
-snippet =b
- =begin rdoc
- ${1}
- =end
-snippet y
- :yields: ${1:arguments}
-snippet rb
- #!/usr/bin/env ruby -wKU
-
-snippet req
- require "${1}"${2}
-snippet #
- # =>
-snippet end
- __END__
-snippet case
- case ${1:object}
- when ${2:condition}
- ${3}
- end
-snippet when
- when ${1:condition}
- ${2}
-snippet def
- def ${1:method_name}
- ${2}
- end
-snippet deft
- def test_${1:case_name}
- ${2}
- end
-snippet if
- if ${1:condition}
- ${2}
- end
-snippet ife
- if ${1:condition}
- ${2}
- else
- ${3}
- end
-snippet elsif
- elsif ${1:condition}
- ${2}
-snippet unless
- unless ${1:condition}
- ${2}
- end
-snippet while
- while ${1:condition}
- ${2}
- end
-snippet until
- until ${1:condition}
- ${2}
- end
-snippet cla class .. end
- class ${1:`substitute(Filename(), '^.', '\u&', '')`}
- ${2}
- end
-snippet cla class .. initialize .. end
- class ${1:`substitute(Filename(), '^.', '\u&', '')`}
- def initialize(${2:args})
- ${3}
- end
-
-
- end
-snippet cla class .. < ParentClass .. initialize .. end
- class ${1:`substitute(Filename(), '^.', '\u&', '')`} < ${2:ParentClass}
- def initialize(${3:args})
- ${4}
- end
-
-
- end
-snippet cla ClassName = Struct .. do .. end
- ${1:`substitute(Filename(), '^.', '\u&', '')`} = Struct.new(:${2:attr_names}) do
- def ${3:method_name}
- ${4}
- end
-
-
- end
-snippet cla class BlankSlate .. initialize .. end
- class ${1:BlankSlate}
- instance_methods.each { |meth| undef_method(meth) unless meth =~ /\A__/ }
-snippet cla class << self .. end
- class << ${1:self}
- ${2}
- end
-# class .. < DelegateClass .. initialize .. end
-snippet cla-
- class ${1:`substitute(Filename(), '^.', '\u&', '')`} < DelegateClass(${2:ParentClass})
- def initialize(${3:args})
- super(${4:del_obj})
-
- ${5}
- end
-
-
- end
-snippet mod module .. end
- module ${1:`substitute(Filename(), '^.', '\u&', '')`}
- ${2}
- end
-snippet mod module .. module_function .. end
- module ${1:`substitute(Filename(), '^.', '\u&', '')`}
- module_function
-
- ${2}
- end
-snippet mod module .. ClassMethods .. end
- module ${1:`substitute(Filename(), '^.', '\u&', '')`}
- module ClassMethods
- ${2}
- end
-
- module InstanceMethods
-
- end
-
- def self.included(receiver)
- receiver.extend ClassMethods
- receiver.send :include, InstanceMethods
- end
- end
-# attr_reader
-snippet r
- attr_reader :${1:attr_names}
-# attr_writer
-snippet w
- attr_writer :${1:attr_names}
-# attr_accessor
-snippet rw
- attr_accessor :${1:attr_names}
-# include Enumerable
-snippet Enum
- include Enumerable
-
- def each(&block)
- ${1}
- end
-# include Comparable
-snippet Comp
- include Comparable
-
- def <=>(other)
- ${1}
- end
-# extend Forwardable
-snippet Forw-
- extend Forwardable
-# def self
-snippet defs
- def self.${1:class_method_name}
- ${2}
- end
-# def method_missing
-snippet defmm
- def method_missing(meth, *args, &blk)
- ${1}
- end
-snippet defd
- def_delegator :${1:@del_obj}, :${2:del_meth}, :${3:new_name}
-snippet defds
- def_delegators :${1:@del_obj}, :${2:del_methods}
-snippet am
- alias_method :${1:new_name}, :${2:old_name}
-snippet app
- if __FILE__ == $PROGRAM_NAME
- ${1}
- end
-# usage_if()
-snippet usai
- if ARGV.${1}
- abort "Usage: #{$PROGRAM_NAME} ${2:ARGS_GO_HERE}"${3}
- end
-# usage_unless()
-snippet usau
- unless ARGV.${1}
- abort "Usage: #{$PROGRAM_NAME} ${2:ARGS_GO_HERE}"${3}
- end
-snippet array
- Array.new(${1:10}) { |${2:i}| ${3} }
-snippet hash
- Hash.new { |${1:hash}, ${2:key}| $1[$2] = ${3} }
-snippet file File.foreach() { |line| .. }
- File.foreach(${1:"path/to/file"}) { |${2:line}| ${3} }
-snippet file File.read()
- File.read(${1:"path/to/file"})${2}
-snippet Dir Dir.global() { |file| .. }
- Dir.glob(${1:"dir/glob/*"}) { |${2:file}| ${3} }
-snippet Dir Dir[".."]
- Dir[${1:"glob/**/*.rb"}]${2}
-snippet dir
- Filename.dirname(__FILE__)
-snippet deli
- delete_if { |${1:e}| ${2} }
-snippet fil
- fill(${1:range}) { |${2:i}| ${3} }
-# flatten_once()
-snippet flao
- inject(Array.new) { |${1:arr}, ${2:a}| $1.push(*$2)}${3}
-snippet zip
- zip(${1:enums}) { |${2:row}| ${3} }
-# downto(0) { |n| .. }
-snippet dow
- downto(${1:0}) { |${2:n}| ${3} }
-snippet ste
- step(${1:2}) { |${2:n}| ${3} }
-snippet tim
- times { |${1:n}| ${2} }
-snippet upt
- upto(${1:1.0/0.0}) { |${2:n}| ${3} }
-snippet loo
- loop { ${1} }
-snippet ea
- each { |${1:e}| ${2} }
-snippet eab
- each_byte { |${1:byte}| ${2} }
-snippet eac- each_char { |chr| .. }
- each_char { |${1:chr}| ${2} }
-snippet eac- each_cons(..) { |group| .. }
- each_cons(${1:2}) { |${2:group}| ${3} }
-snippet eai
- each_index { |${1:i}| ${2} }
-snippet eak
- each_key { |${1:key}| ${2} }
-snippet eal
- each_line { |${1:line}| ${2} }
-snippet eap
- each_pair { |${1:name}, ${2:val}| ${3} }
-snippet eas-
- each_slice(${1:2}) { |${2:group}| ${3} }
-snippet eav
- each_value { |${1:val}| ${2} }
-snippet eawi
- each_with_index { |${1:e}, ${2:i}| ${3} }
-snippet reve
- reverse_each { |${1:e}| ${2} }
-snippet inj
- inject(${1:init}) { |${2:mem}, ${3:var}| ${4} }
-snippet map
- map { |${1:e}| ${2} }
-snippet mapwi-
- enum_with_index.map { |${1:e}, ${2:i}| ${3} }
-snippet sor
- sort { |a, b| ${1} }
-snippet sorb
- sort_by { |${1:e}| ${2} }
-snippet ran
- sort_by { rand }
-snippet all
- all? { |${1:e}| ${2} }
-snippet any
- any? { |${1:e}| ${2} }
-snippet cl
- classify { |${1:e}| ${2} }
-snippet col
- collect { |${1:e}| ${2} }
-snippet det
- detect { |${1:e}| ${2} }
-snippet fet
- fetch(${1:name}) { |${2:key}| ${3} }
-snippet fin
- find { |${1:e}| ${2} }
-snippet fina
- find_all { |${1:e}| ${2} }
-snippet gre
- grep(${1:/pattern/}) { |${2:match}| ${3} }
-snippet sub
- ${1:g}sub(${2:/pattern/}) { |${3:match}| ${4} }
-snippet sca
- scan(${1:/pattern/}) { |${2:match}| ${3} }
-snippet max
- max { |a, b|, ${1} }
-snippet min
- min { |a, b|, ${1} }
-snippet par
- partition { |${1:e}|, ${2} }
-snippet rej
- reject { |${1:e}|, ${2} }
-snippet sel
- select { |${1:e}|, ${2} }
-snippet lam
- lambda { |${1:args}| ${2} }
-snippet do
- do |${1:variable}|
- ${2}
- end
-snippet :
- :${1:key} => ${2:"value"}${3}
-snippet ope
- open(${1:"path/or/url/or/pipe"}, "${2:w}") { |${3:io}| ${4} }
-# path_from_here()
-snippet patfh
- File.join(File.dirname(__FILE__), *%2[${1:rel path here}])${2}
-# unix_filter {}
-snippet unif
- ARGF.each_line${1} do |${2:line}|
- ${3}
- end
-# option_parse {}
-snippet optp
- require "optparse"
-
- options = {${1:default => "args"}}
-
- ARGV.options do |opts|
- opts.banner = "Usage: #{File.basename($PROGRAM_NAME)}
-snippet opt
- opts.on( "-${1:o}", "--${2:long-option-name}", ${3:String},
- "${4:Option description.}") do |${5:opt}|
- ${6}
- end
-snippet tc
- require "test/unit"
-
- require "${1:library_file_name}"
-
- class Test${2:$1} < Test::Unit::TestCase
- def test_${3:case_name}
- ${4}
- end
- end
-snippet ts
- require "test/unit"
-
- require "tc_${1:test_case_file}"
- require "tc_${2:test_case_file}"${3}
-snippet as
- assert(${1:test}, "${2:Failure message.}")${3}
-snippet ase
- assert_equal(${1:expected}, ${2:actual})${3}
-snippet asne
- assert_not_equal(${1:unexpected}, ${2:actual})${3}
-snippet asid
- assert_in_delta(${1:expected_float}, ${2:actual_float}, ${3:2 ** -20})${4}
-snippet asio
- assert_instance_of(${1:ExpectedClass}, ${2:actual_instance})${3}
-snippet asko
- assert_kind_of(${1:ExpectedKind}, ${2:actual_instance})${3}
-snippet asn
- assert_nil(${1:instance})${2}
-snippet asnn
- assert_not_nil(${1:instance})${2}
-snippet asm
- assert_match(/${1:expected_pattern}/, ${2:actual_string})${3}
-snippet asnm
- assert_no_match(/${1:unexpected_pattern}/, ${2:actual_string})${3}
-snippet aso
- assert_operator(${1:left}, :${2:operator}, ${3:right})${4}
-snippet asr
- assert_raise(${1:Exception}) { ${2} }
-snippet asnr
- assert_nothing_raised(${1:Exception}) { ${2} }
-snippet asrt
- assert_respond_to(${1:object}, :${2:method})${3}
-snippet ass assert_same(..)
- assert_same(${1:expected}, ${2:actual})${3}
-snippet ass assert_send(..)
- assert_send([${1:object}, :${2:message}, ${3:args}])${4}
-snippet asns
- assert_not_same(${1:unexpected}, ${2:actual})${3}
-snippet ast
- assert_throws(:${1:expected}) { ${2} }
-snippet asnt
- assert_nothing_thrown { ${1} }
-snippet fl
- flunk("${1:Failure message.}")${2}
-# Benchmark.bmbm do .. end
-snippet bm-
- TESTS = ${1:10_000}
- Benchmark.bmbm do |results|
- ${2}
- end
-snippet rep
- results.report("${1:name}:") { TESTS.times { ${2} }}
-# Marshal.dump(.., file)
-snippet Md
- File.open(${1:"path/to/file.dump"}, "wb") { |${2:file}| Marshal.dump(${3:obj}, $2) }${4}
-# Mashal.load(obj)
-snippet Ml
- File.open(${1:"path/to/file.dump"}, "rb") { |${2:file}| Marshal.load($2) }${3}
-# deep_copy(..)
-snippet deec
- Marshal.load(Marshal.dump(${1:obj_to_copy}))${2}
-snippet Pn-
- PStore.new(${1:"file_name.pstore"})${2}
-snippet tra
- transaction(${1:true}) { ${2} }
-# xmlread(..)
-snippet xml-
- REXML::Document.new(File.read(${1:"path/to/file"}))${2}
-# xpath(..) { .. }
-snippet xpa
- elements.each(${1:"//Xpath"}) do |${2:node}|
- ${3}
- end
-# class_from_name()
-snippet clafn
- split("::").inject(Object) { |par, const| par.const_get(const) }
-# singleton_class()
-snippet sinc
- class << self; self end
-snippet nam
- namespace :${1:`Filename()`} do
- ${2}
- end
-snippet tas
- desc "${1:Task description\}"
- task :${2:task_name => [:dependent, :tasks]} do
- ${3}
- end
diff --git a/vim/snippets/sh.snippets b/vim/snippets/sh.snippets
deleted file mode 100644
index f035126..0000000
--- a/vim/snippets/sh.snippets
+++ /dev/null
@@ -1,28 +0,0 @@
-# #!/bin/bash
-snippet #!
- #!/bin/bash
-
-snippet if
- if [[ ${1:condition} ]]; then
- ${2:#statements}
- fi
-snippet elif
- elif [[ ${1:condition} ]]; then
- ${2:#statements}
-snippet for
- for (( ${2:i} = 0; $2 < ${1:count}; $2++ )); do
- ${3:#statements}
- done
-snippet wh
- while [[ ${1:condition} ]]; do
- ${2:#statements}
- done
-snippet until
- until [[ ${1:condition} ]]; do
- ${2:#statements}
- done
-snippet case
- case ${1:word} in
- ${2:pattern})
- ${3};;
- esac
diff --git a/vim/snippets/snippet.snippets b/vim/snippets/snippet.snippets
deleted file mode 100644
index 854c058..0000000
--- a/vim/snippets/snippet.snippets
+++ /dev/null
@@ -1,7 +0,0 @@
-# snippets for making snippets :)
-snippet snip
- snippet ${1:trigger}
- ${2}
-snippet msnip
- snippet ${1:trigger} ${2:description}
- ${3}
diff --git a/vim/snippets/tcl.snippets b/vim/snippets/tcl.snippets
deleted file mode 100644
index bee2ef8..0000000
--- a/vim/snippets/tcl.snippets
+++ /dev/null
@@ -1,92 +0,0 @@
-# #!/usr/bin/tclsh
-snippet #!
- #!/usr/bin/tclsh
-
-# Process
-snippet pro
- proc ${1:function_name} {${2:args}} {
- ${3:#body ...}
- }
-#xif
-snippet xif
- ${1:expr}? ${2:true} : ${3:false}
-# Conditional
-snippet if
- if {${1}} {
- ${2:# body...}
- }
-# Conditional if..else
-snippet ife
- if {${1}} {
- ${2:# body...}
- } else {
- ${3:# else...}
- }
-# Conditional if..elsif..else
-snippet ifee
- if {${1}} {
- ${2:# body...}
- } elseif {${3}} {
- ${4:# elsif...}
- } else {
- ${5:# else...}
- }
-# If catch then
-snippet ifc
- if { [catch {${1:#do something...}} ${2:err}] } {
- ${3:# handle failure...}
- }
-# Catch
-snippet catch
- catch {${1}} ${2:err} ${3:options}
-# While Loop
-snippet wh
- while {${1}} {
- ${2:# body...}
- }
-# For Loop
-snippet for
- for {set ${2:var} 0} {$$2 < ${1:count}} {${3:incr} $2} {
- ${4:# body...}
- }
-# Foreach Loop
-snippet fore
- foreach ${1:x} {${2:#list}} {
- ${3:# body...}
- }
-# after ms script...
-snippet af
- after ${1:ms} ${2:#do something}
-# after cancel id
-snippet afc
- after cancel ${1:id or script}
-# after idle
-snippet afi
- after idle ${1:script}
-# after info id
-snippet afin
- after info ${1:id}
-# Expr
-snippet exp
- expr {${1:#expression here}}
-# Switch
-snippet sw
- switch ${1:var} {
- ${3:pattern 1} {
- ${4:#do something}
- }
- default {
- ${2:#do something}
- }
- }
-# Case
-snippet ca
- ${1:pattern} {
- ${2:#do something}
- }${3}
-# Namespace eval
-snippet ns
- namespace eval ${1:path} {${2:#script...}}
-# Namespace current
-snippet nsc
- namespace current
diff --git a/vim/snippets/tex.snippets b/vim/snippets/tex.snippets
deleted file mode 100644
index 22f7316..0000000
--- a/vim/snippets/tex.snippets
+++ /dev/null
@@ -1,115 +0,0 @@
-# \begin{}...\end{}
-snippet begin
- \begin{${1:env}}
- ${2}
- \end{$1}
-# Tabular
-snippet tab
- \begin{${1:tabular}}{${2:c}}
- ${3}
- \end{$1}
-# Align(ed)
-snippet ali
- \begin{align${1:ed}}
- ${2}
- \end{align$1}
-# Gather(ed)
-snippet gat
- \begin{gather${1:ed}}
- ${2}
- \end{gather$1}
-# Equation
-snippet eq
- \begin{equation}
- ${1}
- \end{equation}
-# Unnumbered Equation
-snippet \
- \\[
- ${1}
- \\]
-# Enumerate
-snippet enum
- \begin{enumerate}
- \item ${1}
- \end{enumerate}
-# Itemize
-snippet item
- \begin{itemize}
- \item ${1}
- \end{itemize}
-# Description
-snippet desc
- \begin{description}
- \item[${1}] ${2}
- \end{description}
-# Matrix
-snippet mat
- \begin{${1:p/b/v/V/B/small}matrix}
- ${2}
- \end{$1matrix}
-# Cases
-snippet cas
- \begin{cases}
- ${1:equation}, &\text{ if }${2:case}\\
- ${3}
- \end{cases}
-# Split
-snippet spl
- \begin{split}
- ${1}
- \end{split}
-# Part
-snippet part
- \part{${1:part name}} % (fold)
- \label{prt:${2:$1}}
- ${3}
- % part $2 (end)
-# Chapter
-snippet cha
- \chapter{${1:chapter name}} % (fold)
- \label{cha:${2:$1}}
- ${3}
- % chapter $2 (end)
-# Section
-snippet sec
- \section{${1:section name}} % (fold)
- \label{sec:${2:$1}}
- ${3}
- % section $2 (end)
-# Sub Section
-snippet sub
- \subsection{${1:subsection name}} % (fold)
- \label{sub:${2:$1}}
- ${3}
- % subsection $2 (end)
-# Sub Sub Section
-snippet subs
- \subsubsection{${1:subsubsection name}} % (fold)
- \label{ssub:${2:$1}}
- ${3}
- % subsubsection $2 (end)
-# Paragraph
-snippet par
- \paragraph{${1:paragraph name}} % (fold)
- \label{par:${2:$1}}
- ${3}
- % paragraph $2 (end)
-# Sub Paragraph
-snippet subp
- \subparagraph{${1:subparagraph name}} % (fold)
- \label{subp:${2:$1}}
- ${3}
- % subparagraph $2 (end)
-snippet itd
- \item[${1:description}] ${2:item}
-snippet figure
- ${1:Figure}~\ref{${2:fig:}}${3}
-snippet table
- ${1:Table}~\ref{${2:tab:}}${3}
-snippet listing
- ${1:Listing}~\ref{${2:list}}${3}
-snippet section
- ${1:Section}~\ref{${2:sec:}}${3}
-snippet page
- ${1:page}~\pageref{${2}}${3}
diff --git a/vim/snippets/vim.snippets b/vim/snippets/vim.snippets
deleted file mode 100644
index 64e7807..0000000
--- a/vim/snippets/vim.snippets
+++ /dev/null
@@ -1,32 +0,0 @@
-snippet header
- " File: ${1:`expand('%:t')`}
- " Author: ${2:`g:snips_author`}
- " Description: ${3}
- ${4:" Last Modified: `strftime("%B %d, %Y")`}
-snippet guard
- if exists('${1:did_`Filename()`}') || &cp${2: || version < 700}
- finish
- endif
- let $1 = 1${3}
-snippet f
- fun ${1:function_name}(${2})
- ${3:" code}
- endf
-snippet for
- for ${1:needle} in ${2:haystack}
- ${3:" code}
- endfor
-snippet wh
- while ${1:condition}
- ${2:" code}
- endw
-snippet if
- if ${1:condition}
- ${2:" code}
- endif
-snippet ife
- if ${1:condition}
- ${2}
- else
- ${3}
- endif
diff --git a/vim/snippets/zsh.snippets b/vim/snippets/zsh.snippets
deleted file mode 100644
index 7aee05b..0000000
--- a/vim/snippets/zsh.snippets
+++ /dev/null
@@ -1,58 +0,0 @@
-# #!/bin/zsh
-snippet #!
- #!/bin/zsh
-
-snippet if
- if ${1:condition}; then
- ${2:# statements}
- fi
-snippet ife
- if ${1:condition}; then
- ${2:# statements}
- else
- ${3:# statements}
- fi
-snippet elif
- elif ${1:condition} ; then
- ${2:# statements}
-snippet for
- for (( ${2:i} = 0; $2 < ${1:count}; $2++ )); do
- ${3:# statements}
- done
-snippet fore
- for ${1:item} in ${2:list}; do
- ${3:# statements}
- done
-snippet wh
- while ${1:condition}; do
- ${2:# statements}
- done
-snippet until
- until ${1:condition}; do
- ${2:# statements}
- done
-snippet repeat
- repeat ${1:integer}; do
- ${2:# statements}
- done
-snippet case
- case ${1:word} in
- ${2:pattern})
- ${3};;
- esac
-snippet select
- select ${1:answer} in ${2:choices}; do
- ${3:# statements}
- done
-snippet (
- ( ${1:#statements} )
-snippet {
- { ${1:#statements} }
-snippet [
- [[ ${1:test} ]]
-snippet always
- { ${1:try} } always { ${2:always} }
-snippet fun
- function ${1:name} (${2:args}) {
- ${3:# body}
- }
diff --git a/vim/syntax/git.vim b/vim/syntax/git.vim
deleted file mode 100644
index fd0644a..0000000
--- a/vim/syntax/git.vim
+++ /dev/null
@@ -1,67 +0,0 @@
-" Vim syntax file
-" Language: generic git output
-" Maintainer: Tim Pope <vimNOSPAM@tpope.info>
-" Last Change: 2008 Mar 21
-
-if exists("b:current_syntax")
- finish
-endif
-
-syn case match
-syn sync minlines=50
-
-syn include @gitDiff syntax/diff.vim
-
-syn region gitHead start=/\%^/ end=/^$/
-syn region gitHead start=/\%(^commit \x\{40\}\%(\s*(.*)\)\=$\)\@=/ end=/^$/
-
-" For git reflog and git show ...^{tree}, avoid sync issues
-syn match gitHead /^\d\{6\} \%(\w\{4} \)\=\x\{40\}\%( [0-3]\)\=\t.*/
-syn match gitHead /^\x\{40\} \x\{40}\t.*/
-
-syn region gitDiff start=/^\%(diff --git \)\@=/ end=/^\%(diff --git \|$\)\@=/ contains=@gitDiff fold
-syn region gitDiff start=/^\%(@@ -\)\@=/ end=/^\%(diff --git \|$\)\@=/ contains=@gitDiff
-
-syn match gitKeyword /^\%(object\|type\|tag\|commit\|tree\|parent\|encoding\)\>/ contained containedin=gitHead nextgroup=gitHash,gitType skipwhite
-syn match gitKeyword /^\%(tag\>\|ref:\)/ contained containedin=gitHead nextgroup=gitReference skipwhite
-syn match gitKeyword /^Merge:/ contained containedin=gitHead nextgroup=gitHashAbbrev skipwhite
-syn match gitMode /^\d\{6\}/ contained containedin=gitHead nextgroup=gitType,gitHash skipwhite
-syn match gitIdentityKeyword /^\%(author\|committer\|tagger\)\>/ contained containedin=gitHead nextgroup=gitIdentity skipwhite
-syn match gitIdentityHeader /^\%(Author\|Commit\|Tagger\):/ contained containedin=gitHead nextgroup=gitIdentity skipwhite
-syn match gitDateHeader /^\%(AuthorDate\|CommitDate\|Date\):/ contained containedin=gitHead nextgroup=gitDate skipwhite
-syn match gitIdentity /\S.\{-\} <[^>]*>/ contained nextgroup=gitDate skipwhite
-syn region gitEmail matchgroup=gitEmailDelimiter start=/</ end=/>/ keepend oneline contained containedin=gitIdentity
-
-syn match gitReflogHeader /^Reflog:/ contained containedin=gitHead nextgroup=gitReflogMiddle skipwhite
-syn match gitReflogHeader /^Reflog message:/ contained containedin=gitHead skipwhite
-syn match gitReflogMiddle /\S\+@{\d\+} (/he=e-2 nextgroup=gitIdentity
-
-syn match gitDate /\<\u\l\l \u\l\l \d\=\d \d\d:\d\d:\d\d \d\d\d\d [+-]\d\d\d\d/ contained
-syn match gitDate /-\=\d\+ [+-]\d\d\d\d\>/ contained
-syn match gitDate /\<\d\+ \l\+ ago\>/ contained
-syn match gitType /\<\%(tag\|commit\|tree\|blob\)\>/ contained nextgroup=gitHash skipwhite
-syn match gitStage /\<\d\t\@=/ contained
-syn match gitReference /\S\+\S\@!/ contained
-syn match gitHash /\<\x\{40\}\>/ contained nextgroup=gitIdentity,gitStage skipwhite
-syn match gitHash /^\<\x\{40\}\>/ containedin=gitHead contained nextgroup=gitHash skipwhite
-syn match gitHashAbbrev /\<\x\{4,39\}\.\.\./he=e-3 contained nextgroup=gitHashAbbrev skipwhite
-syn match gitHashAbbrev /\<\x\{40\}\>/ contained nextgroup=gitHashAbbrev skipwhite
-
-hi def link gitDateHeader gitIdentityHeader
-hi def link gitIdentityHeader gitIdentityKeyword
-hi def link gitIdentityKeyword Label
-hi def link gitReflogHeader gitKeyword
-hi def link gitKeyword Keyword
-hi def link gitIdentity String
-hi def link gitEmailDelimiter Delimiter
-hi def link gitEmail Special
-hi def link gitDate Number
-hi def link gitMode Number
-hi def link gitHashAbbrev gitHash
-hi def link gitHash Identifier
-hi def link gitReflogMiddle gitReference
-hi def link gitReference Function
-hi def link gitStage gitType
-hi def link gitType Type
-
-let b:current_syntax = "git"
diff --git a/vim/syntax/gitcommit.vim b/vim/syntax/gitcommit.vim
deleted file mode 100644
index 18e9397..0000000
--- a/vim/syntax/gitcommit.vim
+++ /dev/null
@@ -1,73 +0,0 @@
-" Vim syntax file
-" Language: git commit file
-" Maintainer: Tim Pope <vimNOSPAM@tpope.info>
-" Filenames: *.git/COMMIT_EDITMSG
-" Last Change: 2008 Apr 09
-
-if exists("b:current_syntax")
- finish
-endif
-
-syn case match
-syn sync minlines=50
-
-if has("spell")
- syn spell toplevel
-endif
-
-syn include @gitcommitDiff syntax/diff.vim
-syn region gitcommitDiff start=/\%(^diff --git \)\@=/ end=/^$\|^#\@=/ contains=@gitcommitDiff
-
-syn match gitcommitFirstLine "\%^[^#].*" nextgroup=gitcommitBlank skipnl
-syn match gitcommitSummary "^.\{0,50\}" contained containedin=gitcommitFirstLine nextgroup=gitcommitOverflow contains=@Spell
-syn match gitcommitOverflow ".*" contained contains=@Spell
-syn match gitcommitBlank "^[^#].*" contained contains=@Spell
-syn match gitcommitComment "^#.*"
-syn match gitcommitHead "^\%(# .*\n\)\+#$" contained transparent
-syn match gitcommitOnBranch "\%(^# \)\@<=On branch" contained containedin=gitcommitComment nextgroup=gitcommitBranch skipwhite
-syn match gitcommitOnBranch "\%(^# \)\@<=Your branch .\{-\} '" contained containedin=gitcommitComment nextgroup=gitcommitBranch skipwhite
-syn match gitcommitBranch "[^ \t']\+" contained
-syn match gitcommitNoBranch "\%(^# \)\@<=Not currently on any branch." contained containedin=gitcommitComment
-syn match gitcommitHeader "\%(^# \)\@<=.*:$" contained containedin=gitcommitComment
-syn region gitcommitAuthor matchgroup=gitCommitHeader start=/\%(^# \)\@<=Author:/ end=/$/ keepend oneline contained containedin=gitcommitComment transparent
-
-syn region gitcommitUntracked start=/^# Untracked files:/ end=/^#$\|^#\@!/ contains=gitcommitHeader,gitcommitHead,gitcommitUntrackedFile fold
-syn match gitcommitUntrackedFile "\t\@<=.*" contained
-
-syn region gitcommitDiscarded start=/^# Changed but not updated:/ end=/^#$\|^#\@!/ contains=gitcommitHeader,gitcommitHead,gitcommitDiscardedType fold
-syn region gitcommitSelected start=/^# Changes to be committed:/ end=/^#$\|^#\@!/ contains=gitcommitHeader,gitcommitHead,gitcommitSelectedType fold
-
-syn match gitcommitDiscardedType "\t\@<=[a-z][a-z ]*[a-z]: "he=e-2 contained containedin=gitcommitComment nextgroup=gitcommitDiscardedFile skipwhite
-syn match gitcommitSelectedType "\t\@<=[a-z][a-z ]*[a-z]: "he=e-2 contained containedin=gitcommitComment nextgroup=gitcommitSelectedFile skipwhite
-syn match gitcommitDiscardedFile ".\{-\}\%($\| -> \)\@=" contained nextgroup=gitcommitDiscardedArrow
-syn match gitcommitSelectedFile ".\{-\}\%($\| -> \)\@=" contained nextgroup=gitcommitSelectedArrow
-syn match gitcommitDiscardedArrow " -> " contained nextgroup=gitcommitDiscardedFile
-syn match gitcommitSelectedArrow " -> " contained nextgroup=gitcommitSelectedFile
-
-syn match gitcommitWarning "\%^[^#].*: needs merge$" nextgroup=gitcommitWarning skipnl
-syn match gitcommitWarning "^[^#].*: needs merge$" nextgroup=gitcommitWarning skipnl contained
-syn match gitcommitWarning "^\%(no changes added to commit\|nothing \%(added \)\=to commit\)\>.*\%$"
-
-hi def link gitcommitSummary Keyword
-hi def link gitcommitComment Comment
-hi def link gitcommitUntracked gitcommitComment
-hi def link gitcommitDiscarded gitcommitComment
-hi def link gitcommitSelected gitcommitComment
-hi def link gitcommitOnBranch Comment
-hi def link gitcommitBranch Special
-hi def link gitcommitNoBranch gitCommitBranch
-hi def link gitcommitDiscardedType gitcommitType
-hi def link gitcommitSelectedType gitcommitType
-hi def link gitcommitType Type
-hi def link gitcommitHeader PreProc
-hi def link gitcommitUntrackedFile gitcommitFile
-hi def link gitcommitDiscardedFile gitcommitFile
-hi def link gitcommitSelectedFile gitcommitFile
-hi def link gitcommitFile Constant
-hi def link gitcommitDiscardedArrow gitcommitArrow
-hi def link gitcommitSelectedArrow gitcommitArrow
-hi def link gitcommitArrow gitcommitComment
-"hi def link gitcommitOverflow Error
-hi def link gitcommitBlank Error
-
-let b:current_syntax = "gitcommit"
diff --git a/vim/syntax/perl.vim b/vim/syntax/perl.vim
deleted file mode 100644
index 840e33d..0000000
--- a/vim/syntax/perl.vim
+++ /dev/null
@@ -1,536 +0,0 @@
-" Vim syntax file
-" Language: Perl
-" Maintainer: Lukas Mai <l.mai@web.de>
-" Last Change: 2008-08-08
-"
-" Standard perl syntax file for vim by Nick Hibma <nick@van-laarhoven.org>
-" Modified by Lukas Mai
-"
-" Original version: Sonia Heimann <niania@netsurf.org>
-" Thanks to many people for their contribution.
-
-" The following parameters are available for tuning the
-" perl syntax highlighting, with defaults given:
-"
-" unlet perl_include_pod
-" unlet perl_no_scope_in_variables
-" unlet perl_no_extended_vars
-" unlet perl_string_as_statement
-" unlet perl_no_sync_on_sub
-" unlet perl_no_sync_on_global_var
-" let perl_sync_dist = 100
-" unlet perl_fold
-" unlet perl_fold_blocks
-" let perl_nofold_packages = 1
-" let perl_nofold_subs = 1
-
-if version < 600
- echoerr ">=vim-6.0 is required to run perl-mauke.vim"
- finish
-elseif exists("b:current_syntax")
- finish
-endif
-
-" POD starts with ^=<word> and ends with ^=cut
-
-if exists("perl_include_pod")
- " Include a while extra syntax file
- syn include @Pod syntax/pod.vim
- unlet b:current_syntax
- if exists("perl_fold")
- syn region perlPOD start="^=[a-z]" end="^=cut" contains=@Pod,@Spell,perlTodo keepend fold
- syn region perlPOD start="^=cut" end="^=cut" contains=perlTodo keepend fold
- else
- syn region perlPOD start="^=[a-z]" end="^=cut" contains=@Pod,@Spell,perlTodo keepend
- syn region perlPOD start="^=cut" end="^=cut" contains=perlTodo keepend
- endif
-else
- " Use only the bare minimum of rules
- if exists("perl_fold")
- syn region perlPOD start="^=[a-z]" end="^=cut" fold
- else
- syn region perlPOD start="^=[a-z]" end="^=cut"
- endif
-endif
-
-
-syn cluster perlTop contains=TOP
-syn region perlGenericBlock matchgroup=perlGenericBlock start="{" end="}" contained transparent
-
-
-" All keywords
-"
-syn match perlConditional "\<\%(if\|elsif\|unless\|given\|when\|default\)\>"
-syn match perlConditional "\<else\>" nextgroup=perlElseIfError skipwhite skipnl skipempty
-syn match perlRepeat "\<\%(while\|for\%(each\)\=\|do\|until\|continue\)\>"
-syn match perlOperator "\<\%(defined\|undef\|eq\|ne\|[gl][et]\|cmp\|not\|and\|or\|xor\|not\|bless\|ref\|do\)\>"
-syn match perlControl "\<\%(BEGIN\|CHECK\|INIT\|END\|UNITCHECK\)\>"
-
-syn match perlStatementStorage "\<\%(my\|our\|local\|state\)\>"
-syn match perlStatementControl "\<\%(return\|last\|next\|redo\|goto\|break\)\>"
-syn match perlStatementScalar "\<\%(chom\=p\|chr\|crypt\|r\=index\|lc\%(first\)\=\|length\|ord\|pack\|sprintf\|substr\|uc\%(first\)\=\)\>"
-syn match perlStatementRegexp "\<\%(pos\|quotemeta\|split\|study\)\>"
-syn match perlStatementNumeric "\<\%(abs\|atan2\|cos\|exp\|hex\|int\|log\|oct\|rand\|sin\|sqrt\|srand\)\>"
-syn match perlStatementList "\<\%(splice\|unshift\|shift\|push\|pop\|join\|reverse\|grep\|map\|sort\|unpack\)\>"
-syn match perlStatementHash "\<\%(delete\|each\|exists\|keys\|values\)\>"
-syn match perlStatementIOfunc "\<\%(syscall\|dbmopen\|dbmclose\)\>"
-syn match perlStatementFiledesc "\<\%(binmode\|close\%(dir\)\=\|eof\|fileno\|getc\|lstat\|printf\=\|read\%(dir\|line\|pipe\)\|rewinddir\|say\|select\|stat\|tell\%(dir\)\=\|write\)\>" nextgroup=perlFiledescStatementNocomma skipwhite
-syn match perlStatementFiledesc "\<\%(fcntl\|flock\|ioctl\|open\%(dir\)\=\|read\|seek\%(dir\)\=\|sys\%(open\|read\|seek\|write\)\|truncate\)\>" nextgroup=perlFiledescStatementComma skipwhite
-syn match perlStatementVector "\<vec\>"
-syn match perlStatementFiles "\<\%(ch\%(dir\|mod\|own\|root\)\|glob\|link\|mkdir\|readlink\|rename\|rmdir\|symlink\|umask\|unlink\|utime\)\>"
-syn match perlStatementFiles "-[rwxoRWXOezsfdlpSbctugkTBMAC]\>"
-syn match perlStatementFlow "\<\%(caller\|die\|dump\|eval\|exit\|wantarray\)\>"
-syn match perlStatementInclude "\<require\>"
-syn match perlStatementInclude "\<\%(use\|no\)\s\+\%(\%(attributes\|attrs\|autouse\|base\|big\%(int\|num\|rat\)\|blib\|bytes\|charnames\|constant\|diagnostics\|encoding\%(::warnings\)\=\|feature\|fields\|filetest\|if\|integer\|less\|lib\|locale\|mro\|open\|ops\|overload\|re\|sigtrap\|sort\|strict\|subs\|threads\%(::shared\)\=\|utf8\|vars\|version\|vmsish\|warnings\%(::register\)\=\)\>\)\="
-syn match perlStatementProc "\<\%(alarm\|exec\|fork\|get\%(pgrp\|ppid\|priority\)\|kill\|pipe\|set\%(pgrp\|priority\)\|sleep\|system\|times\|wait\%(pid\)\=\)\>"
-syn match perlStatementSocket "\<\%(acept\|bind\|connect\|get\%(peername\|sock\%(name\|opt\)\)\|listen\|recv\|send\|setsockopt\|shutdown\|socket\%(pair\)\=\)\>"
-syn match perlStatementIPC "\<\%(msg\%(ctl\|get\|rcv\|snd\)\|sem\%(ctl\|get\|op\)\|shm\%(ctl\|get\|read\|write\)\)\>"
-syn match perlStatementNetwork "\<\%(\%(end\|[gs]et\)\%(host\|net\|proto\|serv\)ent\|get\%(\%(host\|net\)by\%(addr\|name\)\|protoby\%(name\|number\)\|servby\%(name\|port\)\)\)\>"
-syn match perlStatementPword "\<\%(get\%(pw\%(uid\|nam\)\|gr\%(gid\|nam\)\|login\)\)\|\%(end\|[gs]et\)\%(pw\|gr\)ent\>"
-syn match perlStatementTime "\<\%(gmtime\|localtime\|time\)\>"
-
-syn match perlStatementMisc "\<\%(warn\|formline\|reset\|scalar\|prototype\|lock\|tied\=\|untie\)\>"
-
-syn keyword perlTodo TODO TBD FIXME XXX contained
-
-syn region perlStatementIndirObjWrap matchgroup=perlStatementIndirObj start="\<\%(map\|grep\|sort\|print\|system\|exec\)\>\s*{" end="}" contains=@perlTop,perlGenericBlock
-
-syn match perlLabel "^\s*\h\w*\s*::\@!\%(\<v\d\+\s*:\)\@<!"
-
-" Perl Identifiers.
-"
-" Should be cleaned up to better handle identifiers in particular situations
-" (in hash keys for example)
-"
-" Plain identifiers: $foo, @foo, $#foo, %foo, &foo and dereferences $$foo, @$foo, etc.
-" We do not process complex things such as @{${"foo"}}. Too complicated, and
-" too slow. And what is after the -> is *not* considered as part of the
-" variable - there again, too complicated and too slow.
-
-" Special variables first ($^A, ...) and ($|, $', ...)
-syn match perlVarPlain "$^[ACDEFHILMNOPRSTVWX]\="
-syn match perlVarPlain "$[\\\"\[\]'&`+*.,;=%~!?@#$<>(-]"
-syn match perlVarPlain "$\%(0\|[1-9]\d*\)"
-" Same as above, but avoids confusion in $::foo (equivalent to $main::foo)
-syn match perlVarPlain "$::\@!"
-" These variables are not recognized within matches.
-syn match perlVarNotInMatches "$[|)]"
-" This variable is not recognized within matches delimited by m//.
-syn match perlVarSlash "$/"
-
-" And plain identifiers
-syn match perlPackageRef "[$@#%*&]\%(\%(::\|'\)\=\I\i*\%(\%(::\|'\)\I\i*\)*\)\=\%(::\|'\)\I"ms=s+1,me=e-1 contained
-
-" To not highlight packages in variables as a scope reference - i.e. in
-" $pack::var, pack:: is a scope, just set "perl_no_scope_in_variables"
-" If you don't want complex things like @{${"foo"}} to be processed,
-" just set the variable "perl_no_extended_vars"...
-
-if !exists("perl_no_scope_in_variables")
- syn match perlVarPlain "\%([@$]\|\$#\)\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef nextgroup=perlVarMember,perlVarSimpleMember,perlMethod
- syn match perlVarPlain2 "%\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef
- syn match perlFunctionName "&\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef nextgroup=perlVarMember,perlVarSimpleMember,perlMethod
-else
- syn match perlVarPlain "\%([@$]\|\$#\)\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod
- syn match perlVarPlain2 "%\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)"
- syn match perlFunctionName "&\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod
-endif
-
-if !exists("perl_no_extended_vars")
- syn cluster perlExpr contains=perlStatementIndirObjWrap,perlStatementScalar,perlStatementRegexp,perlStatementNumeric,perlStatementList,perlStatementHash,perlStatementFiles,perlStatementTime,perlStatementMisc,perlVarPlain,perlVarPlain2,perlVarNotInMatches,perlVarSlash,perlVarBlock,perlVarBlock2,perlShellCommand,perlFloat,perlNumber,perlStringUnexpanded,perlString,perlQQ,perlArrow,perlGenericBlock
- syn region perlArrow matchgroup=perlArrow start="->\s*(" end=")" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod contained
- syn region perlArrow matchgroup=perlArrow start="->\s*\[" end="\]" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod contained
- syn region perlArrow matchgroup=perlArrow start="->\s*{" end="}" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod contained
- syn match perlArrow "->\s*{\s*\I\i*\s*}" contains=perlVarSimpleMemberName nextgroup=perlVarMember,perlVarSimpleMember,perlMethod contained
- syn region perlArrow matchgroup=perlArrow start="->\s*\$*\I\i*\s*(" end=")" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod contained
- syn region perlVarBlock matchgroup=perlVarPlain start="\%($#\|[$@]\)\$*{" skip="\\}" end="}" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod
- syn region perlVarBlock2 matchgroup=perlVarPlain start="[%&*]\$*{" skip="\\}" end="}" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod
- syn match perlVarPlain2 "[%&*]\$*{\I\i*}" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod
- syn match perlVarPlain "\%(\$#\|[@$]\)\$*{\I\i*}" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod
- syn region perlVarMember matchgroup=perlVarPlain start="\%(->\)\={" skip="\\}" end="}" contained contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod
- syn match perlVarSimpleMember "\%(->\)\={\I\i*}" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod contains=perlVarSimpleMemberName contained
- syn match perlVarSimpleMemberName "\I\i*" contained
- syn region perlVarMember matchgroup=perlVarPlain start="\%(->\)\=\[" skip="\\]" end="]" contained contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod
- syn match perlMethod "->\$*\I\i*" contained nextgroup=perlVarSimpleMember,perlVarMember,perlMethod
-endif
-
-" File Descriptors
-syn match perlFiledescRead "<\h\w*>"
-
-syn match perlFiledescStatementComma "(\=\s*\u\w*\s*,"me=e-1 transparent contained contains=perlFiledescStatement
-syn match perlFiledescStatementNocomma "(\=\s*\u\w*\s*[^, \t]"me=e-1 transparent contained contains=perlFiledescStatement
-
-syn match perlFiledescStatement "\u\w*" contained
-
-" Special characters in strings and matches
-syn match perlSpecialString "\\\%(\o\{1,3}\|x\%({\x\+}\|\x\{1,2}\)\|c.\|[^cx]\)" contained extend
-syn match perlSpecialStringU2 "\\." extend contained transparent contains=NONE
-syn match perlSpecialStringU "\\\\" contained
-syn match perlSpecialMatch "\\[1-9]" contained extend
-syn match perlSpecialMatch "\\g\%(\d\+\|{\%(-\=\d\+\|\h\w*\)}\)" contained
-syn match perlSpecialMatch "\\k\%(<\h\w*>\|'\h\w*'\)" contained
-syn match perlSpecialMatch "{\d\+\%(,\%(\d\+\)\=\)\=}" contained
-syn match perlSpecialMatch "\[[]-]\=[^\[\]]*[]-]\=\]" contained
-syn match perlSpecialMatch "[+*()?.]" contained
-syn match perlSpecialMatch "(?[#:=!]" contained
-syn match perlSpecialMatch "(?[impsx]*\%(-[imsx]\+\)\=)" contained
-syn match perlSpecialMatch "(?\%([-+]\=\d\+\|R\))" contained
-syn match perlSpecialMatch "(?\%(&\|P[>=]\)\h\w*)" contained
-syn match perlSpecialMatch "(\*\%(\%(PRUNE\|SKIP\|THEN\)\%(:[^)]*\)\=\|\%(MARK\|\):[^)]*\|COMMIT\|F\%(AIL\)\=\|ACCEPT\))" contained
-
-" Possible errors
-"
-" Highlight lines with only whitespace (only in blank delimited here documents) as errors
-syn match perlNotEmptyLine "^\s\+$" contained
-" Highlight '} else if (...) {', it should be '} else { if (...) { ' or
-" '} elsif (...) {'.
-syn match perlElseIfError "[^[:space:]{]\+" contained
-
-" Variable interpolation
-"
-" These items are interpolated inside "" strings and similar constructs.
-syn cluster perlInterpDQ contains=perlSpecialString,perlVarPlain,perlVarNotInMatches,perlVarSlash,perlVarBlock
-" These items are interpolated inside '' strings and similar constructs.
-syn cluster perlInterpSQ contains=perlSpecialStringU,perlSpecialStringU2
-" These items are interpolated inside m// matches and s/// substitutions.
-syn cluster perlInterpSlash contains=perlSpecialString,perlSpecialMatch,perlVarPlain,perlVarBlock
-" These items are interpolated inside m## matches and s### substitutions.
-syn cluster perlInterpMatch contains=@perlInterpSlash,perlVarSlash
-
-" Shell commands
-syn region perlShellCommand matchgroup=perlMatchStartEnd start="`" end="`" contains=@perlInterpDQ keepend
-
-" Constants
-"
-" Numbers
-syn match perlNumber "\<\%(0\%(x\x[[:xdigit:]_]*\|b[01][01_]*\|\o[0-7_]*\|\)\|[1-9][[:digit:]_]*\)\>"
-syn match perlFloat "\<\d[[:digit:]_]*[eE][\-+]\=\d\+"
-syn match perlFloat "\<\d[[:digit:]_]*\.[[:digit:]_]*\%([eE][\-+]\=\d\+\)\="
-syn match perlFloat "\.[[:digit:]_]\+\%([eE][\-+]\=\d\+\)\="
-
-syn match perlString "\<\%(v\d\+\%(\.\d\+\)*\|\d\+\%(\.\d\+\)\{2,}\)\>" contains=perlVStringV
-syn match perlVStringV "\<v" contained
-
-
-syn region perlParensSQ start=+(+ end=+)+ extend contained transparent contains=perlParensSQ,@perlInterpSQ keepend
-syn region perlBracketsSQ start=+\[+ end=+\]+ extend contained transparent contains=perlBracketsSQ,@perlInterpSQ keepend
-syn region perlBracesSQ start=+{+ end=+}+ extend contained transparent contains=perlBracesSQ,@perlInterpSQ keepend
-syn region perlAnglesSQ start=+<+ end=+>+ extend contained transparent contains=perlAnglesSQ,@perlInterpSQ keepend
-
-syn region perlParensDQ start=+(+ end=+)+ extend contained transparent contains=perlParensDQ,@perlInterpDQ keepend
-syn region perlBracketsDQ start=+\[+ end=+\]+ extend contained transparent contains=perlBracketsDQ,@perlInterpDQ keepend
-syn region perlBracesDQ start=+{+ end=+}+ extend contained transparent contains=perlBracesDQ,@perlInterpDQ keepend
-syn region perlAnglesDQ start=+<+ end=+>+ extend contained transparent contains=perlAnglesDQ,@perlInterpDQ keepend
-
-
-" Simple version of searches and matches
-syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\>\s*\z([^[:space:]'([{<#]\)+ end=+\z1[cgimopsx]*+ contains=@perlInterpMatch keepend
-syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m#+ end=+#[cgimopsx]*+ contains=@perlInterpMatch keepend
-syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*'+ end=+'[cgimopsx]*+ contains=@perlInterpSQ keepend
-syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*/+ end=+/[cgimopsx]*+ contains=@perlInterpSlash keepend
-syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*(+ end=+)[cgimopsx]*+ contains=@perlInterpMatch,perlParensDQ keepend
-
-" A special case for m{}, m<> and m[] which allows for comments and extra whitespace in the pattern
-syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*{+ end=+}[cgimopsx]*+ contains=@perlInterpMatch,perlComment,perlBracesDQ keepend
-syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*<+ end=+>[cgimopsx]*+ contains=@perlInterpMatch,perlAnglesDQ keepend
-syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*\[+ end=+\][cgimopsx]*+ contains=@perlInterpMatch,perlComment,perlBracketsDQ keepend
-
-" Below some hacks to recognise the // variant. This is virtually impossible to catch in all
-" cases as the / is used in so many other ways, but these should be the most obvious ones.
-syn region perlMatch matchgroup=perlMatchStartEnd start="\%([$@%&*]\@<!\%(\<split\|\<while\|\<if\|\<unless\|\.\.\|[-+*!~(\[{=]\)\s*\)\@<=/" start=+^/+ start=+\s\@<=/[^[:space:][:digit:]$@%=]\@=\%(/\_s*\%([([{$@%&*[:digit:]"'`]\|\_s\w\|[[:upper:]_abd-fhjklnqrt-wyz]\)\)\@!+ skip=+\\/+ end=+/[cgimopsx]*+ contains=@perlInterpSlash
-
-
-" Substitutions
-" perlMatch is the first part, perlSubstitution* is the substitution part
-syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\>\s*\z([^[:space:]'([{<#]\)+ end=+\z1+me=e-1 contains=@perlInterpMatch nextgroup=perlSubstitutionGQQ keepend
-syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\s*'+ end=+'+me=e-1 contains=@perlInterpSQ nextgroup=perlSubstitutionSQ keepend
-syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\s*/+ end=+/+me=e-1 contains=@perlInterpSlash nextgroup=perlSubstitutionGQQ keepend
-syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s#+ end=+#+me=e-1 contains=@perlInterpMatch nextgroup=perlSubstitutionGQQ keepend
-syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\s*(+ end=+)+ contains=@perlInterpMatch,perlParensDQ nextgroup=perlSubstitutionGQQ skipwhite skipempty skipnl keepend
-syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\s*<+ end=+>+ contains=@perlInterpMatch,perlAnglesDQ nextgroup=perlSubstitutionGQQ skipwhite skipempty skipnl keepend
-syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\s*\[+ end=+\]+ contains=@perlInterpMatch,perlBracketsDQ nextgroup=perlSubstitutionGQQ skipwhite skipempty skipnl keepend
-syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\s*{+ end=+}+ contains=@perlInterpMatch,perlBracesDQ nextgroup=perlSubstitutionGQQ skipwhite skipempty skipnl keepend
-syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+\z([^[:space:]'([{<]\)+ end=+\z1[ecgimopsx]*+ keepend contained contains=@perlInterpDQ
-syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+(+ end=+)[ecgimopsx]*+ contained contains=@perlInterpDQ,perlParensDQ keepend
-syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+\[+ end=+\][ecgimopsx]*+ contained contains=@perlInterpDQ,perlBracketsDQ keepend
-syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+{+ end=+}[ecgimopsx]*+ contained contains=@perlInterpDQ,perlBracesDQ keepend
-syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+<+ end=+>[ecgimopsx]*+ contained contains=@perlInterpDQ,perlAnglesDQ keepend
-syn region perlSubstitutionSQ matchgroup=perlMatchStartEnd start=+'+ end=+'[ecgimopsx]*+ contained contains=@perlInterpSQ keepend
-
-" Translations
-" perlMatch is the first part, perlTranslation* is the second, translator part.
-syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!\%(tr\|y\)\>\s*\z([^[:space:]([{<#]\)+ end=+\z1+me=e-1 contains=@perlInterpSQ nextgroup=perlTranslationGQ
-syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!\%(tr\|y\)#+ end=+#+me=e-1 contains=@perlInterpSQ nextgroup=perlTranslationGQ
-syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!\%(tr\|y\)\s*\[+ end=+\]+ contains=@perlInterpSQ,perlBracketsSQ nextgroup=perlTranslationGQ skipwhite skipempty skipnl
-syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!\%(tr\|y\)\s*(+ end=+)+ contains=@perlInterpSQ,perlParensSQ nextgroup=perlTranslationGQ skipwhite skipempty skipnl
-syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!\%(tr\|y\)\s*<+ end=+>+ contains=@perlInterpSQ,perlAnglesSQ nextgroup=perlTranslationGQ skipwhite skipempty skipnl
-syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!\%(tr\|y\)\s*{+ end=+}+ contains=@perlInterpSQ,perlBracesSQ nextgroup=perlTranslationGQ skipwhite skipempty skipnl
-syn region perlTranslationGQ matchgroup=perlMatchStartEnd start=+\z([^[:space:]([{<]\)+ end=+\z1[cds]*+ contained
-syn region perlTranslationGQ matchgroup=perlMatchStartEnd start=+(+ end=+)[cds]*+ contains=perlParensSQ contained
-syn region perlTranslationGQ matchgroup=perlMatchStartEnd start=+\[+ end=+\][cds]*+ contains=perlBracketsSQ contained
-syn region perlTranslationGQ matchgroup=perlMatchStartEnd start=+{+ end=+}[cds]*+ contains=perlBracesSQ contained
-syn region perlTranslationGQ matchgroup=perlMatchStartEnd start=+<+ end=+>[cds]*+ contains=perlAnglesSQ contained
-
-
-" Strings and q, qq, qw and qr expressions
-
-syn region perlStringUnexpanded matchgroup=perlStringStartEnd start="'" end="'" contains=@perlInterpSQ keepend
-syn region perlString matchgroup=perlStringStartEnd start=+"+ end=+"+ contains=@perlInterpDQ keepend
-syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q\>\s*\z([^[:space:]#([{<]\)+ end=+\z1+ contains=@perlInterpSQ keepend
-syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q#+ end=+#+ contains=@perlInterpSQ keepend
-syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q\s*(+ end=+)+ contains=@perlInterpSQ,perlParensSQ keepend
-syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q\s*\[+ end=+\]+ contains=@perlInterpSQ,perlBracketsSQ keepend
-syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q\s*{+ end=+}+ contains=@perlInterpSQ,perlBracesSQ keepend
-syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q\s*<+ end=+>+ contains=@perlInterpSQ,perlAnglesSQ keepend
-
-syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q[qx]\>\s*\z([^[:space:]#([{<]\)+ end=+\z1+ contains=@perlInterpDQ keepend
-syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q[qx]#+ end=+#+ contains=@perlInterpDQ keepend
-syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q[qx]\s*(+ end=+)+ contains=@perlInterpDQ,perlParensDQ keepend
-syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q[qx]\s*\[+ end=+\]+ contains=@perlInterpDQ,perlBracketsDQ keepend
-syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q[qx]\s*{+ end=+}+ contains=@perlInterpDQ,perlBracesDQ keepend
-syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q[qx]\s*<+ end=+>+ contains=@perlInterpDQ,perlAnglesDQ keepend
-
-syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qw\s*\z([^[:space:]#([{<]\)+ end=+\z1+ contains=@perlInterpSQ keepend
-syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qw#+ end=+#+ contains=@perlInterpSQ keepend
-syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qw\s*(+ end=+)+ contains=@perlInterpSQ,perlParensSQ keepend
-syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qw\s*\[+ end=+\]+ contains=@perlInterpSQ,perlBracketsSQ keepend
-syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qw\s*{+ end=+}+ contains=@perlInterpSQ,perlBracesSQ keepend
-syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qw\s*<+ end=+>+ contains=@perlInterpSQ,perlAnglesSQ keepend
-
-syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\>\s*\z([^[:space:]#([{<'/]\)+ end=+\z1[imosx]*+ contains=@perlInterpMatch keepend
-syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*/+ end=+/[imosx]*+ contains=@perlInterpSlash keepend
-syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr#+ end=+#[imosx]*+ contains=@perlInterpMatch keepend
-syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*'+ end=+'[imosx]*+ contains=@perlInterpSQ keepend
-syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*(+ end=+)[imosx]*+ contains=@perlInterpMatch,perlParensDQ keepend
-
-" A special case for qr{}, qr<> and qr[] which allows for comments and extra whitespace in the pattern
-syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*{+ end=+}[imosx]*+ contains=@perlInterpMatch,perlBracesDQ,perlComment keepend
-syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*<+ end=+>[imosx]*+ contains=@perlInterpMatch,perlAnglesDQ,perlComment keepend
-syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*\[+ end=+\][imosx]*+ contains=@perlInterpMatch,perlBracketsDQ,perlComment keepend
-
-" Constructs such as print <<EOF [...] EOF, 'here' documents
-"
-" XXX Any statements after the identifier are in perlString colour (i.e.
-" 'if $a' in 'print <<EOF if $a'). This is almost impossible to get right it
-" seems due to the 'auto-extending nature' of regions.
-if exists("perl_fold")
- syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\z(\I\i*\).*+ end=+^\z1$+ contains=@perlInterpDQ fold
- syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*"\z([^\\"]*\%(\\.[^\\"]*\)*\)"+ end=+^\z1$+ contains=@perlInterpDQ fold
- syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*'\z([^\\']*\%(\\.[^\\']*\)*\)'+ end=+^\z1$+ contains=@perlInterpSQ fold
- syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*""+ end=+^$+ contains=@perlInterpDQ,perlNotEmptyLine fold
- syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*''+ end=+^$+ contains=@perlInterpSQ,perlNotEmptyLine fold
- syn region perlAutoload matchgroup=perlStringStartEnd start=+<<\s*\(['"]\=\)\z(END_\%(SUB\|OF_FUNC\|OF_AUTOLOAD\)\)\1+ end=+^\z1$+ contains=ALL fold
-else
- syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\z(\I\i*\)+ end=+^\z1$+ contains=@perlInterpDQ
- syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*"\z([^\\"]*\%(\\.[^\\"]*\)*\)"+ end=+^\z1$+ contains=@perlInterpDQ
- syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*'\z([^\\']*\%(\\.[^\\']*\)*\)'+ end=+^\z1$+ contains=@perlInterpSQ
- syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*""+ end=+^$+ contains=@perlInterpDQ,perlNotEmptyLine
- syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*''+ end=+^$+ contains=@perlInterpSQ,perlNotEmptyLine
- syn region perlAutoload matchgroup=perlStringStartEnd start=+<<\s*\(['"]\=\)\z(END_\%(SUB\|OF_FUNC\|OF_AUTOLOAD\)\)\1+ end=+^\z1$+ contains=ALL
-endif
-
-
-" Class declarations
-"
-syn match perlPackageDecl "\<package\s\+\%(\h\|::\)\%(\w\|::\)*" contains=perlStatementPackage
-syn keyword perlStatementPackage package contained
-
-" Functions
-"
-syn match perlSubError "[^[:space:];{#]" contained
-if v:version == 701 && !has('patch221') " XXX I hope that's the right one
- syn match perlSubAttributes ":" contained
-else
- syn match perlSubAttributesCont "\h\w*\_s*\%(:\_s*\)\=" nextgroup=@perlSubAttrMaybe contained
- syn region perlSubAttributesCont matchgroup=perlSubAttributesCont start="\h\w*(" end=")\_s*\%(:\_s*\)\=" nextgroup=@perlSubAttrMaybe contained contains=@perlInterpSQ,perlParensSQ
- syn cluster perlSubAttrMaybe contains=perlSubAttributesCont,perlSubError
- syn match perlSubAttributes "" contained nextgroup=perlSubError
- syn match perlSubAttributes ":\_s*" contained nextgroup=@perlSubAttrMaybe
-endif
-syn match perlSubPrototypeError "(\%(\_s*\%(\%(\\\%([$@%&*]\|\[[$@%&*]\+\]\)\|[$&*]\|[@%]\%(\_s*)\)\@=\|;\%(\_s*[)$@%&*\\]\)\@=\|_\%(\_s*[);]\)\@=\)\_s*\)*\)\@>\zs\_[^)]\+" contained
-syn match perlSubPrototype +(\_[^)]*)\_s*\|+ nextgroup=perlSubAttributes contained contains=perlSubPrototypeError
-syn match perlSubName +\%(\h\|::\|'\w\)\%(\w\|::\|'\w\)*\_s*\|+ contained nextgroup=perlSubPrototype
-
-syn match perlFunction +\<sub\>\_s*+ nextgroup=perlSubName
-
-if !exists("perl_no_scope_in_variables")
- syn match perlFunctionPRef "\h\w*::" contained
- syn match perlFunctionName "\h\w*[^:]" contained
-else
- syn match perlFunctionName "\h[[:alnum:]_:]*" contained
-endif
-
-" The => operator forces a bareword to the left of it to be interpreted as
-" a string
-syn match perlString "\<\I\i*\%(\s*=>\)\@="
-
-" All other # are comments, except ^#!
-syn match perlComment "#.*" contains=perlTodo
-syn match perlSharpBang "^#!.*"
-
-" Formats
-syn region perlFormat matchgroup=perlStatementIOFunc start="^\s*\<format\s\+\k\+\s*=\s*$"rs=s+6 end="^\s*\.\s*$" contains=perlFormatName,perlFormatField,perlVarPlain,perlVarPlain2
-syn match perlFormatName "format\s\+\k\+\s*="lc=7,me=e-1 contained
-syn match perlFormatField "[@^][|<>~]\+\%(\.\.\.\)\=" contained
-syn match perlFormatField "[@^]#[#.]*" contained
-syn match perlFormatField "@\*" contained
-syn match perlFormatField "@[^A-Za-z_|<>~#*]"me=e-1 contained
-syn match perlFormatField "@$" contained
-
-" __END__ and __DATA__ clauses
-if exists("perl_fold")
- syntax region perlDATA start="^__\%(DATA\|END\)__$" skip="." end="." contains=perlPOD,@perlDATA fold
-else
- syntax region perlDATA start="^__\%(DATA\|END\)__$" skip="." end="." contains=perlPOD,@perlDATA
-endif
-
-
-"
-" Folding
-
-if exists("perl_fold")
- if !exists("perl_nofold_packages")
- syn region perlPackageFold start="^package \S\+;\s*\%(#.*\)\=$" end="^1;\=\s*\%(#.*\)\=$" end="\n\+package"me=s-1 transparent fold keepend
- endif
- if !exists("perl_nofold_subs")
- syn region perlSubFold start="^\z(\s*\)\<sub\>.*[^};]$" end="^\z1}\s*\%(#.*\)\=$" transparent fold keepend
- syn region perlSubFold start="^\z(\s*\)\<\%(BEGIN\|END\|CHECK\|INIT\|UNITCHECK\)\>.*[^};]$" end="^\z1}\s*$" transparent fold keepend
- endif
-
- if exists("perl_fold_blocks")
- syn region perlBlockFold start="^\z(\s*\)\%(if\|elsif\|unless\|for\|while\|until\|given\)\s*(.*)\%(\s*{\)\=\s*\%(#.*\)\=$" start="^\z(\s*\)foreach\s*\%(\%(my\|our\)\=\s*\S\+\s*\)\=(.*)\%(\s*{\)\=\s*\%(#.*\)\=$" end="^\z1}\s*;\=\%(#.*\)\=$" transparent fold keepend
- syn region perlBlockFold start="^\z(\s*\)\%(do\|else\)\%(\s*{\)\=\s*\%(#.*\)\=$" end="^\z1}\s*while" end="^\z1}\s*;\=\%(#.*\)\=$" transparent fold keepend
- endif
-
- setlocal foldmethod=syntax
- syn sync fromstart
-else
- " fromstart above seems to set minlines even if perl_fold is not set.
- syn sync minlines=0
-endif
-
-
-command -nargs=+ HiLink hi def link <args>
-
-" The default highlighting.
-HiLink perlSharpBang PreProc
-HiLink perlControl PreProc
-HiLink perlInclude Include
-HiLink perlSpecial Special
-HiLink perlString String
-HiLink perlCharacter Character
-HiLink perlNumber Number
-HiLink perlFloat Float
-HiLink perlType Type
-HiLink perlIdentifier Identifier
-HiLink perlLabel Label
-HiLink perlStatement Statement
-HiLink perlConditional Conditional
-HiLink perlRepeat Repeat
-HiLink perlOperator Operator
-HiLink perlFunction Keyword
-HiLink perlSubName Function
-HiLink perlSubPrototype Type
-HiLink perlSubAttributes PreProc
-HiLink perlSubAttributesCont perlSubAttributes
-HiLink perlComment Comment
-HiLink perlTodo Todo
-if exists("perl_string_as_statement")
- HiLink perlStringStartEnd perlStatement
-else
- HiLink perlStringStartEnd perlString
-endif
-HiLink perlVStringV perlStringStartEnd
-HiLink perlList perlStatement
-HiLink perlMisc perlStatement
-HiLink perlVarPlain perlIdentifier
-HiLink perlVarPlain2 perlIdentifier
-HiLink perlArrow perlIdentifier
-HiLink perlFiledescRead perlIdentifier
-HiLink perlFiledescStatement perlIdentifier
-HiLink perlVarSimpleMember perlIdentifier
-HiLink perlVarSimpleMemberName perlString
-HiLink perlVarNotInMatches perlIdentifier
-HiLink perlVarSlash perlIdentifier
-HiLink perlQQ perlString
-HiLink perlHereDoc perlString
-HiLink perlStringUnexpanded perlString
-HiLink perlSubstitutionSQ perlString
-HiLink perlSubstitutionGQQ perlString
-HiLink perlTranslationGQ perlString
-HiLink perlMatch perlString
-HiLink perlMatchStartEnd perlStatement
-HiLink perlFormatName perlIdentifier
-HiLink perlFormatField perlString
-HiLink perlPackageDecl perlType
-HiLink perlStorageClass perlType
-HiLink perlPackageRef perlType
-HiLink perlStatementPackage perlStatement
-HiLink perlStatementStorage perlStatement
-HiLink perlStatementControl perlStatement
-HiLink perlStatementScalar perlStatement
-HiLink perlStatementRegexp perlStatement
-HiLink perlStatementNumeric perlStatement
-HiLink perlStatementList perlStatement
-HiLink perlStatementHash perlStatement
-HiLink perlStatementIOfunc perlStatement
-HiLink perlStatementFiledesc perlStatement
-HiLink perlStatementVector perlStatement
-HiLink perlStatementFiles perlStatement
-HiLink perlStatementFlow perlStatement
-HiLink perlStatementInclude perlStatement
-HiLink perlStatementProc perlStatement
-HiLink perlStatementSocket perlStatement
-HiLink perlStatementIPC perlStatement
-HiLink perlStatementNetwork perlStatement
-HiLink perlStatementPword perlStatement
-HiLink perlStatementTime perlStatement
-HiLink perlStatementMisc perlStatement
-HiLink perlStatementIndirObj perlStatement
-HiLink perlFunctionName perlIdentifier
-HiLink perlMethod perlIdentifier
-HiLink perlFunctionPRef perlType
-HiLink perlPOD perlComment
-HiLink perlShellCommand perlString
-HiLink perlSpecialAscii perlSpecial
-HiLink perlSpecialDollar perlSpecial
-HiLink perlSpecialString perlSpecial
-HiLink perlSpecialStringU perlSpecial
-HiLink perlSpecialMatch perlSpecial
-HiLink perlDATA perlComment
-
-" Possible errors
-HiLink perlNotEmptyLine Error
-HiLink perlElseIfError Error
-HiLink perlSubPrototypeError Error
-HiLink perlSubError Error
-
-delcommand HiLink
-
-" Syncing to speed up processing
-"
-if !exists("perl_no_sync_on_sub")
- syn sync match perlSync grouphere NONE "^\s*\<package\s"
- syn sync match perlSync grouphere NONE "^\s*\<sub\>"
- syn sync match perlSync grouphere NONE "^}"
-endif
-
-if !exists("perl_no_sync_on_global_var")
- syn sync match perlSync grouphere NONE "^$\I[[:alnum:]_:]+\s*=\s*{"
- syn sync match perlSync grouphere NONE "^[@%]\I[[:alnum:]_:]+\s*=\s*("
-endif
-
-if exists("perl_sync_dist")
- execute "syn sync maxlines=" . perl_sync_dist
-else
- syn sync maxlines=100
-endif
-
-syn sync match perlSyncPOD grouphere perlPOD "^=pod"
-syn sync match perlSyncPOD grouphere perlPOD "^=head"
-syn sync match perlSyncPOD grouphere perlPOD "^=item"
-syn sync match perlSyncPOD grouphere NONE "^=cut"
-
-let b:current_syntax = "perl"
-
-" vim: ts=8
diff --git a/vim/syntax/snippet.vim b/vim/syntax/snippet.vim
deleted file mode 100644
index 5e919e7..0000000
--- a/vim/syntax/snippet.vim
+++ /dev/null
@@ -1,19 +0,0 @@
-" Syntax highlighting for snippet files (used for snipMate.vim)
-" Hopefully this should make snippets a bit nicer to write!
-syn match snipComment '^#.*'
-syn match placeHolder '\${\d\+\(:.\{-}\)\=}' contains=snipCommand
-syn match tabStop '\$\d\+'
-syn match snipCommand '`.\{-}`'
-syn match snippet '^snippet.*' transparent contains=multiSnipText,snipKeyword
-syn match multiSnipText '\S\+ \zs.*' contained
-syn match snipKeyword '^snippet'me=s+8 contained
-syn match snipError "^[^#s\t].*$"
-
-hi link snipComment Comment
-hi link multiSnipText String
-hi link snipKeyword Keyword
-hi link snipComment Comment
-hi link placeHolder Special
-hi link tabStop Special
-hi link snipCommand String
-hi link snipError Error
diff --git a/vim/syntax/tt2.vim b/vim/syntax/tt2.vim
deleted file mode 100755
index 09f5f7c..0000000
--- a/vim/syntax/tt2.vim
+++ /dev/null
@@ -1,213 +0,0 @@
-" Vim syntax file
-" Language: TT2 ( Perl Module Template-Toolkit 2.x )
-" References: Template-Toolkit 2
-" http://search.cpan.org/~abw/Template-Toolkit/
-" http://template-toolkit.org/
-" C:\> perldoc Template
-" C:\> perldoc Template::Manual::Directives
-" Last Change: 16 May 2007
-" Filenames: *.tt2
-" Maintainar: Moriki, Atsushi <4woods+vim@gmail.com>
-" Version: 0.1.3
-" Summary: Syntax Highlight for Template-Toolkit 2.x
-" Description: Syntax Highlight for Template-Toolkit 2.x
-" Contain Perl code in PERL/RAWPERL directive. (runtime sytax/perl.vim)
-" No fold.
-" HTML syntax for including TT2 syntax. ( tt2html.vim / unfinished )
-" Can define START_TAG/END_TAG for your style.
-"
-" Instration:
-" put tt2.vim and tt2html.vim in to your syntax diretory.
-"
-" add below in your filetype.vim.
-" au BufNewFile,BufRead *.tt2 setf tt2
-" or
-" au BufNewFile,BufRead *.tt2
-" \ if ( getline(1) . getline(2) . getline(3) =~ '<\chtml' |
-" \ && getline(1) . getline(2) . getline(3) !~ '<[%?]' ) |
-" \ || getline(1) =~ '<!DOCTYPE HTML' |
-" \ setf tt2html |
-" \ else |
-" \ setf tt2 |
-" \ endif
-"
-" define START_TAG, END_TAG
-" "ASP"
-" :let b:tt2_syn_tags = '<% %>'
-" "PHP"
-" :let b:tt2_syn_tags = '<? ?>'
-" "TT2 and HTML"
-" :let b:tt2_syn_tags = '\[% %] <!-- -->'
-"
-" Changes:
-" 0.1.3
-" Changed fileformat from 'dos' to 'unix'
-" Deleted 'echo' that print obstructive message
-" 0.1.2
-" Added block comment syntax
-" e.g. [%# COMMENT
-" COMMENT TOO %]
-" [%# IT'S SAFE %] HERE IS OUTSIDE OF TT2 DIRECTIVE
-" [% # WRONG!! %] HERE STILL BE COMMENT
-" 0.1.1
-" Release
-" 0.1.0
-" Internal
-"
-" License: follow Vim :help uganda
-"
-
-if !exists("b:tt2_syn_tags")
- let b:tt2_syn_tags = '\[% %]'
- "let b:tt2_syn_tags = '\[% %] \[\* \*]'
-endif
-
-let b:tt2_syn_inc_perl = 1
-
-if exists("b:current_syntax")
- finish
-endif
-
-syn case match
-
-syn cluster tt2_top_cluster contains=tt2_perlcode,tt2_tag_region
-
-" TT2 TAG Region
-if exists("b:tt2_syn_tags")
-
- let s:str = b:tt2_syn_tags . ' '
- let s:str = substitute(s:str,'^ \+','','g')
- let s:str = substitute(s:str,' \+',' ','g')
-
- while stridx(s:str,' ') > 0
-
- let s:st = strpart(s:str,0,stridx(s:str,' '))
- let s:str = substitute(s:str,'[^ ]* ','',"")
-
- let s:ed = strpart(s:str,0,stridx(s:str,' '))
- let s:str = substitute(s:str,'[^ ]* ','',"")
-
- exec 'syn region tt2_tag_region '.
- \ 'matchgroup=tt2_tag '.
- \ 'start=+\(' . s:st .'\)[-]\=+ '.
- \ 'end=+[-]\=\(' . s:ed . '\)+ '.
- \ 'contains=@tt2_statement_cluster keepend extend'
-
- exec 'syn region tt2_commentblock_region '.
- \ 'matchgroup=tt2_tag '.
- \ 'start=+\(' . s:st .'\)[-]\=\(#\)\@=+ '.
- \ 'end=+[-]\=\(' . s:ed . '\)+ '.
- \ 'keepend extend'
-
- "Include Perl syntax when 'PERL' 'RAWPERL' block
- if exists("b:tt2_syn_inc_perl")
- syn include @Perl $VIMRUNTIME/syntax/perl.vim
- exec 'syn region tt2_perlcode '.
- \ 'start=+\(\(RAW\)\=PERL\s*[-]\=' . s:ed . '\(\n\)\=\)\@<=+ ' .
- \ 'end=+' . s:st . '[-]\=\s*END+me=s-1 contains=@Perl keepend'
- endif
-
- "echo 'TAGS ' . s:st . ' ' . s:ed
- unlet s:st
- unlet s:ed
- endwhile
-
-else
-
- syn region tt2_tag_region
- \ matchgroup=tt2_tag
- \ start=+\(\[%\)[-]\=+
- \ end=+[-]\=%\]+
- \ contains=@tt2_statement_cluster keepend extend
-
- syn region tt2_commentblock_region
- \ matchgroup=tt2_tag
- \ start=+\(\[%\)[-]\=#+
- \ end=+[-]\=%\]+
- \ keepend extend
-
- "Include Perl syntax when 'PERL' 'RAWPERL' block
- if exists("b:tt2_syn_inc_perl")
- syn include @Perl $VIMRUNTIME/syntax/perl.vim
- syn region tt2_perlcode
- \ start=+\(\(RAW\)\=PERL\s*[-]\=%]\(\n\)\=\)\@<=+
- \ end=+\[%[-]\=\s*END+me=s-1
- \ contains=@Perl keepend
- endif
-endif
-
-" Directive
-syn keyword tt2_directive contained
- \ GET CALL SET DEFAULT DEBUG
- \ LAST NEXT BREAK STOP BLOCK
- \ IF IN UNLESS ELSIF FOR FOREACH WHILE SWITCH CASE
- \ USE PLUGIN MACRO META
- \ TRY FINAL RETURN LAST
- \ CLEAR TO STEP AND OR NOT MOD DIV
- \ ELSE PERL RAWPERL END
-syn match tt2_directive +|+ contained
-syn keyword tt2_directive contained nextgroup=tt2_string_q,tt2_string_qq,tt2_blockname skipwhite skipempty
- \ INSERT INCLUDE PROCESS WRAPPER FILTER
- \ THROW CATCH
-syn keyword tt2_directive contained nextgroup=tt2_def_tag skipwhite skipempty
- \ TAGS
-
-syn match tt2_def_tag "\S\+\s\+\S\+\|\<\w\+\>" contained
-
-syn match tt2_variable +\I\w*+ contained
-syn match tt2_operator "[+*/%:?-]" contained
-syn match tt2_operator "\<\(mod\|div\|or\|and\|not\)\>" contained
-syn match tt2_operator "[!=<>]=\=\|&&\|||" contained
-syn match tt2_operator "\(\s\)\@<=_\(\s\)\@=" contained
-syn match tt2_operator "=>\|," contained
-syn match tt2_deref "\([[:alnum:]_)\]}]\s*\)\@<=\." contained
-syn match tt2_comment +#.*$+ contained extend
-syn match tt2_func +\<\I\w*\(\s*(\)\@=+ contained nextgroup=tt2_bracket_r skipempty skipwhite
-"
-syn region tt2_bracket_r start=+(+ end=+)+ contained contains=@tt2_statement_cluster keepend extend
-syn region tt2_bracket_b start=+\[+ end=+]+ contained contains=@tt2_statement_cluster keepend extend
-syn region tt2_bracket_b start=+{+ end=+}+ contained contains=@tt2_statement_cluster keepend extend
-
-syn region tt2_string_qq start=+"+ end=+"+ skip=+\\"+ contained contains=tt2_ivariable keepend extend
-syn region tt2_string_q start=+'+ end=+'+ skip=+\\'+ contained keepend extend
-
-syn match tt2_ivariable +\$\I\w*\>\(\.\I\w*\>\)*+ contained
-syn match tt2_ivariable +\${\I\w*\>\(\.\I\w*\>\)*}+ contained
-
-syn match tt2_number "\d\+" contained
-syn match tt2_number "\d\+\.\d\+" contained
-syn match tt2_number "0x\x\+" contained
-syn match tt2_number "0\o\+" contained
-
-syn match tt2_blockname "\f\+" contained nextgroup=tt2_blockname_joint skipwhite skipempty
-syn match tt2_blockname "$\w\+" contained contains=tt2_ivariable nextgroup=tt2_blockname_joint skipwhite skipempty
-syn region tt2_blockname start=+"+ end=+"+ skip=+\\"+ contained contains=tt2_ivariable nextgroup=tt2_blockname_joint keepend skipwhite skipempty
-syn region tt2_blockname start=+'+ end=+'+ skip=+\\'+ contained nextgroup=tt2_blockname_joint keepend skipwhite skipempty
-syn match tt2_blockname_joint "+" contained nextgroup=tt2_blockname skipwhite skipempty
-
-syn cluster tt2_statement_cluster contains=tt2_directive,tt2_variable,tt2_operator,tt2_string_q,tt2_string_qq,tt2_deref,tt2_comment,tt2_func,tt2_bracket_b,tt2_bracket_r,tt2_number
-
-"Sincronizing
-syn sync minlines=50
-
-hi def link tt2_tag Type
-hi def link tt2_tag_region Type
-hi def link tt2_commentblock_region Comment
-hi def link tt2_directive Statement
-hi def link tt2_variable Identifier
-hi def link tt2_ivariable Identifier
-hi def link tt2_operator Statement
-hi def link tt2_string_qq String
-hi def link tt2_string_q String
-hi def link tt2_blockname String
-hi def link tt2_comment Comment
-hi def link tt2_func Function
-hi def link tt2_number Number
-
-if exists("b:tt2_syn_tags")
- unlet b:tt2_syn_tags
-endif
-
-let b:current_syntax = "tt2"
-
-" vim:ts=4:sw=4
diff --git a/vim/syntax/tt2html.vim b/vim/syntax/tt2html.vim
deleted file mode 100755
index d516cd9..0000000
--- a/vim/syntax/tt2html.vim
+++ /dev/null
@@ -1,12 +0,0 @@
-" Vim syntax file
-" Language: TT2 ( Inner HTML )
-" Last Change: 16 May 2007
-" Maintainar: Atsushi Moriki <4woods+vim@gmail.com>
-
-runtime! syntax/html.vim
-unlet b:current_syntax
-
-so <sfile>:p:h/tt2.vim
-unlet b:current_syntax
-syn cluster htmlPreProc add=@tt2_top_cluster
-
diff --git a/vimrc b/vimrc
index 2d0bc24..f641528 100644
--- a/vimrc
+++ b/vimrc
@@ -517,6 +517,13 @@ nmap <silent><Leader>s :syntax sync fromstart<CR>
" }}}
" }}}
" Plugin settings {{{
+" pathogen {{{
+runtime bundle/pathogen/autoload/pathogen.vim
+call pathogen#infect()
+" }}}
+" matchit {{{
+runtime macros/matchit.vim
+" }}}
" tComment {{{
map ;x gcc
vmap ;x gc