Vim-snipMate doesn't expand insted removes the

2019-08-04 13:34发布

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条回答
唯我独甜
2楼-- · 2019-08-04 13:37

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())
查看更多
登录 后发表回答