简体   繁体   English

vim-snipmate和supertab在一起

[英]vim-snipmate and supertab together

i just tried to install snipmate. 我只是试图安装snipmate。 supertab is already working. supertab已经在工作了。

it doesnt work. 它不起作用。 when i press tab even after a snippet keyword the completion is triggered. 即使在片段关键字后按Tab键也会触发完成。 i tried to remap the key (to cm) but even then completion is triggered instaed of snipmate. 我试图重新映射密钥(到cm),但即使这样,也会触发完成的snipmate。 (before the remap cm didnt do a thing). (在重映射cm之前没做任何事情)。

i did this mapping in vimrc. 我在vimrc中做了这个映射。 the doc tells me to do it in after/plugin/snipmate.vim but this script isnt loaded (according to :scriptnames). doc告诉我在after / plugin / snipmate.vim中执行此操作,但此脚本未加载(根据:scriptnames)。

any idea? 任何的想法?

snipmate plugin hasn't been updated for a long long time. snipmate插件已经很久没有更新了。 thats why i started a friendly fork and i'm merging and coordinating further development of this (at least for me) essential plugin. 这就是为什么我开始友好的分叉,我正在合并和协调这个(至少对我来说)必要的插件的进一步发展。

more here: https://github.com/garbas/vim-snipmate/blob/master/README.md 更多信息: https//github.com/garbas/vim-snipmate/blob/master/README.md

I had a very similar problem running an old version of snipmate from vim.org 我有一个非常类似的问题,从vim.org运行旧版本的snipmate

The guy who writes it doesn't always update the vim.org page, but he does work on it fairly regularly on github. 编写它的人并不总是更新vim.org页面,但他确实在github上定期工作。

Grab the latest copy from the download link here and see if that helps you. 此处的下载链接中获取最新副本,看看是否对您有所帮助。

What did you remap to <Cm> ? 您重新映射到<Cm>什么? <Tab> or your plugins function calls? <Tab>或你的插件函数调用? Did you try SnipMate without SuperTab? 你没有SuperTab尝试过SnipMate吗?

Both plugins have their main functions hardwired to <Tab> which makes their use a bit unpredictable. 两个插件的主要功能都硬连接到<Tab> ,这使得它们的使用有点不可预测。 I've tried it but I didn't like it. 我试过了,但我不喜欢它。

Instead, maybe you can keep SnipMate (if it works on its own) and remap omnicompletion shortcuts to something easier. 相反,也许你可以保留SnipMate(如果它自己工作)并将omnicompletion快捷方式重新映射到更容易的东西。 I have these in my .vimrc: 我在.vimrc中有这些:

" change the mapleader from \ to ,
let mapleader=","

" omnicompletion : words
inoremap <leader>, <C-x><C-o>

" omnicompletion : filenames
inoremap <leader>: <C-x><C-f>

" omnicompletion : lines
inoremap <leader>= <C-x><C-l>

Also autocomplpop.vim works very well. autocomplpop.vim也很好用。

Use SuperTab 2.0 version. 使用SuperTab 2.0版本。

Do not use the latest version 2.1, it doesn't work with each other. 不要使用最新版本2.1,它不能互相使用。

I managed to remap SnippMate's TAB key to a different key, in my case cj, and it worked OK: 我设法将SnippMate的TAB键重新映射到另一个键,在我的情况下是cj,它运行正常:

ino <silent> <c-j><c-r>=TriggerSnippet()<cr>
snor <silent> <c-j> <esc>i<right><c-r>=TriggerSnippet()<cr>

I did the change in after/plugin/snipmate.vim . after/plugin/snipmate.vim做了更改。 In my case, :scriptnames listed the file as loaded. 在我的例子中, :scriptnames将文件列为已加载。

将它添加到.vimrc,当您使用Tab时,然后显示片段列表。

au BufRead,BufNewFile *.py set expandtab au BufRead,BufNewFile *.sh set expandtab au BufRead,BufNewFile *.go set expandtab

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

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