Vim-snipMate不扩展insted删除触发器 [英] Vim-snipMate doesn't expand insted removes the trigger

查看:92
本文介绍了Vim-snipMate不扩展insted删除触发器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用带有vim-snippets插件的snimpmate,一切都很好。直到我尝试删除vim代码段并使用我的自定义代码段和 .vim / snippets上的唯一代码段 ruby​​.snippets。我认为代码片段正好在启动TAB或任何触发器时才被加载,从而删除了文本...并留有空白。

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

结果

def hello

end

此处

推荐答案

您提供的信息很少,可以帮助您进行故障排除。这是一个函数(可以从我的 SnippetCompleteSnipMate插件中访问)定义的代码段:

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:

要访问其代码段,必须对snipMate进行修补。打开〜/ .vim / plugin / snipMate.vim 并在底部插入以下功能:

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())

这篇关于Vim-snipMate不扩展insted删除触发器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆