1
0
mirror of https://github.com/amix/vimrc synced 2025-06-16 01:25:00 +08:00

Updated plugins. Fixed some issues related to empty space and peaksea. Using Source Code Pro as default font

This commit is contained in:
amix
2013-12-28 18:23:13 +00:00
parent 86f4456be1
commit 08a64d943d
35 changed files with 553 additions and 90 deletions

View File

@ -706,12 +706,25 @@ fun! s:ChooseSnippet(snippets)
return funcref#Call(a:snippets[keys(a:snippets)[idx]])
endf
fun! snipMate#ShowAvailableSnips()
let col = col('.')
let word = matchstr(getline('.'), '\S\+\%'.col.'c')
fun! snipMate#WordBelowCursor()
return matchstr(getline('.'), '\S\+\%' . col('.') . 'c')
endf
let snippets = map(snipMate#GetSnippetsForWordBelowCursor(word, '*', 0),'v:val[0]')
let matches = filter(snippets, "v:val =~# '\\V\\^" . escape(word, '\') . "'")
fun! snipMate#GetSnippetsForWordBelowCursorForComplete(word)
let snippets = map(snipMate#GetSnippetsForWordBelowCursor(a:word, '*', 0), 'v:val[0]')
return filter(snippets, "v:val =~# '\\V\\^" . escape(a:word, '\') . "'")
endf
fun! snipMate#CanBeTriggered()
let word = snipMate#WordBelowCursor()
let matches = snipMate#GetSnippetsForWordBelowCursorForComplete(word)
return len(matches) > 0
endf
fun! snipMate#ShowAvailableSnips()
let col = col('.')
let word = snipMate#WordBelowCursor()
let matches = snipMate#GetSnippetsForWordBelowCursorForComplete(word)
" Pretty hacky, but really can't have the tab swallowed!
if len(matches) == 0