简体   繁体   English

Vim-snipMate不扩展insted删除触发器

[英]Vim-snipMate doesn't expand insted removes the trigger

I was using snimpmate with vim-snippets plugin, and all fine. 我在用vim-snippets插件使用snimpmate,一切都很好。 Until i tried to remove the vim-snippets and use my custom and only snippets 'ruby.snippets' on '.vim/snippets'. 直到我尝试删除vim代码段并在'.vim / snippets'上使用我的自定义和仅代码段'ruby.snippets'。 i think the snippets are being loaded just when fire TAB or whatever trigger it just removes the text... and leave blank space. 我认为摘要是在启动TAB或任何触发器时才加载的,它们只是删除了文字...并留有空白。

def hello

 if |TAB|

end

results in 结果是

def hello

end

is the same problem here 这里是同样的问题

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: 这是一个函数(来自我的SnippetCompleteSnipMate插件 ),可让您访问当前定义的片段:

To be able to access its snippets, snipMate must be patched. 为了能够访问其摘要,必须对snipMate进行修补。 Open ~/.vim/plugin/snipMate.vim and insert the following function at the bottom: 打开~/.vim/plugin/snipMate.vim并在底部插入以下函数:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM