Vim-snipMate doesn't expand insted removes the trigger

社会主义新天地 提交于 2019-12-11 10:56:49

问题


I was using snimpmate with vim-snippets plugin, and all fine. Until i tried to remove the vim-snippets and use my custom and only snippets 'ruby.snippets' on '.vim/snippets'. i think the snippets are being loaded just when fire TAB or whatever trigger it just removes the text... and leave blank space.

def hello

 if |TAB|

end

results in

def hello

end

is the same problem here


回答1:


You provide very little information to help you with troubleshooting. Here's one function (from my SnippetCompleteSnipMate plugin) that lets you access the currently defined snippets:

To be able to access its snippets, snipMate must be patched. Open ~/.vim/plugin/snipMate.vim and insert the following function at the bottom:

fun! GetSnipsInCurrentScope()
    let snips = {}
    for scope in [bufnr('%')] + split(&ft, '\.') + ['_']
        call extend(snips, get(s:snippets, scope, {}), 'keep')
        call extend(snips, get(s:multi_snips, scope, {}), 'keep')
    endfor
    return snips
endf

You can now check which snippets are defined for the current buffer via

:echo keys(GetSnipsInCurrentScope())


来源:https://stackoverflow.com/questions/23210272/vim-snipmate-doesnt-expand-insted-removes-the-trigger

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!