mirror of
https://github.com/amix/vimrc
synced 2025-06-16 09:35:01 +08:00
Updated plugins
This commit is contained in:
@ -15,6 +15,7 @@ additional contributions from:
|
||||
* [bpugh](https://github.com/bpugh)
|
||||
* [bruno-](https://github.com/bruno-)
|
||||
* [darkwise](https://github.com/darkwise)
|
||||
* [dreviejo](https://github.com/dreviejo)
|
||||
* [fish-face](https://github.com/fish-face)
|
||||
* [henrik](https://github.com/henrik)
|
||||
* [holizz](https://github.com/holizz)
|
||||
|
@ -223,6 +223,9 @@ fun! snipMate#ReadSnippetsFile(file) abort
|
||||
if line[:6] == 'snippet'
|
||||
let inSnip = 1
|
||||
let bang = (line[7] == '!')
|
||||
if bang
|
||||
let bang += line[8] == '!'
|
||||
endif
|
||||
let trigger = strpart(line, 8 + bang)
|
||||
let name = ''
|
||||
let space = stridx(trigger, ' ') + 1
|
||||
@ -336,7 +339,10 @@ endfunction
|
||||
|
||||
function! snipMate#SetByPath(dict, trigger, path, snippet, bang, snipversion) abort
|
||||
let d = a:dict
|
||||
if !has_key(d, a:trigger) || a:bang
|
||||
if a:bang == 2
|
||||
unlet! d[a:trigger]
|
||||
return
|
||||
elseif !has_key(d, a:trigger) || a:bang == 1
|
||||
let d[a:trigger] = {}
|
||||
endif
|
||||
let d[a:trigger][a:path] = [a:snippet, a:snipversion]
|
||||
@ -434,14 +440,13 @@ endf
|
||||
|
||||
" used by both: completion and insert snippet
|
||||
fun! snipMate#GetSnippetsForWordBelowCursor(word, exact) abort
|
||||
" Setup lookups: '1.2.3' becomes [1.2.3] + [3, 2.3]
|
||||
let parts = split(a:word, '\W\zs')
|
||||
" Since '\W\zs' results in splitting *after* a non-keyword character, the
|
||||
" first \W stays connected to whatever's before it, so split it off
|
||||
if !empty(parts) && parts[0] =~ '\W$'
|
||||
let parts = [ parts[0][:-2], strpart(parts[0], len(parts[0]) - 1) ]
|
||||
\ + parts[1:]
|
||||
endif
|
||||
" Split non-word characters into their own piece
|
||||
" so 'foo.bar..baz' becomes ['foo', '.', 'bar', '.', '.', 'baz']
|
||||
" First split just after a \W and then split each resultant string just
|
||||
" before a \W
|
||||
let parts = filter(tlib#list#Flatten(
|
||||
\ map(split(a:word, '\W\zs'), 'split(v:val, "\\ze\\W")')),
|
||||
\ '!empty(v:val)')
|
||||
" Only look at the last few possibilities. Too many can be slow.
|
||||
if len(parts) > 5
|
||||
let parts = parts[-5:]
|
||||
|
@ -87,7 +87,7 @@ function! snipmate#legacy#build_stops(snip, lnum, col, indent) abort
|
||||
|
||||
let stops[i] = {}
|
||||
let stops[i].line = a:lnum + s:count(beforeTabStop, "\n")
|
||||
let stops[i].col = a:indent + len(matchstr(withoutOthers, '\_^.*\ze'.s:sigil .'{'.i.'\D'))
|
||||
let stops[i].col = a:indent + len(matchstr(withoutOthers, '[^\n]\{-}\ze'.s:sigil .'{'.i.'\D'))
|
||||
let stops[i].placeholder = 0
|
||||
let stops[i].mirrors = []
|
||||
if stops[i].line == a:lnum
|
||||
|
@ -158,7 +158,8 @@ g:snipMate.override
|
||||
file they were in. When this option is enabled
|
||||
(set to 1), the snippet originating in the
|
||||
last loaded file is kept, similar to how Vim
|
||||
maps and other settings work.
|
||||
maps and other settings work. Note: Load order
|
||||
is determined by 'runtimepath'.
|
||||
|
||||
g:snipMate['no_match_completion_feedkeys_chars']
|
||||
A string inserted when no match for a trigger
|
||||
@ -252,6 +253,9 @@ overridden on a per-snippet basis by defining the snippet with a bang (!): >
|
||||
expanded text
|
||||
more expanded text
|
||||
|
||||
Two bangs will remove the trigger entirely from SnipMate's lookup. In this
|
||||
case any snippet text is unused.
|
||||
|
||||
Note: Hard tabs in the expansion text are required. When the snippet is
|
||||
expanded in the text and 'expandtab' is set, each tab will be replaced with
|
||||
spaces based on 'softtabstop' if nonzero or 'shiftwidth' otherwise.
|
||||
@ -301,18 +305,19 @@ and so on. After expansion, SnipMate will jump to the first tab stop. From
|
||||
then on, the <Plug>snipMateNextOrTrigger map will jump to the next higher
|
||||
numbered tabs top.
|
||||
|
||||
However, SnipMate will always stop at the zero tab stop $0. Once it jumps to
|
||||
In the case of an ambiguity, for example if a stop occurs just before
|
||||
a literal number, braces may be placed around the stop number to resolve it:
|
||||
${3}79 is the third tab stop followed by the string "79".
|
||||
|
||||
NOTE: In the version 0 snippet parser, the braces are mandatory.
|
||||
|
||||
*SnipMate-zero-tabstop*
|
||||
SnipMate will always stop at the special zero tab stop $0. Once it jumps to
|
||||
the zero tab stop, snippet expansion is finished. If the zero tab stop is not
|
||||
present in a definition, it will be put at the end.
|
||||
|
||||
In the case of an ambiguity, for example if a stop occurs just before a literal
|
||||
number, braces may be placed around the stop number to resolve it: ${3}79 is
|
||||
the third tab stop followed by the string "79".
|
||||
|
||||
Note: In the version 0 snippet parser, the braces are mandatory.
|
||||
|
||||
For example, to place the cursor first on the id of a <div> tag, then on
|
||||
its class, and finally end editing its contents: >
|
||||
For example, to place the cursor first on the id of a <div> tag, then on its
|
||||
class, and finally end editing its contents: >
|
||||
|
||||
snippet div
|
||||
<div id="$1" class="$2">
|
||||
|
Reference in New Issue
Block a user