27Oct/053
Vim and TextMate
Yesterday while cleaning my hard drive, I found the 20MinutesWiki video that presents TurboGears I downloaded some days ago and watched it. It’s quite impressive but what I seen besides technical stuff was the editor Kevin Dangoor (the presenter) was using : TextMate. It had some completion features that seemed quite nice. So, as a vim user, I decided to look if someone already wrote such a plugin and finally found it!
As an example, you can add this to your ~/.vim/ftplugin/c.vim (you need to change delimiter to ‘?’) :
Iabbr inc #include "?file?.h"^M??
There are some issues though, the most important being it breaks the indentation (well, you can still use Ctrl-F).
No related posts.
Related posts brought to you by Yet Another Related Posts Plugin.
December 16th, 2005 - 21:32
Hi, just wondering if you got this to work. I’ve tried to get it to work, but the docs aren’t very friendly.
Any help would be great!
Kevin
December 19th, 2005 - 15:20
Well, tell me what you’ve done and I’ll tell you what you’ve missed / done wrong.
IIRC, I just put the script in ~/.vim/plugin, create a ~/.vim/ftplugin/c.vim with appropriate Iabbr lines and set those variables :
let g:snip_start_tag = “?”
let g:snip_end_tag = “?”
let g:snip_elem_delim = “:”
December 30th, 2005 - 21:28
Well, I put the script in ~/.vim/plugin, and then in my .vimrc file put:
Iabbr inc #include “?file?.h”^M??
Then started a blank file and got an error:
[kold@kold ~]$ vi kdotest.txt
Error detected while processing /home/kold/.vimrc:
line 24:
E492: Not an editor command: Iabbr inc #include “?file?.h”^M??
I guess I’m unclear on how the entire thing works.
I understand this to work as a “tag completor”, meaning that if I type and hit TAB then it will put and move the cursor back 4 spaces so that I can fill in the tag.
I found something similar here:
http://www.fngtps.com/2005/12/textmate-addi-c-tions
I think what I need to do can be accomplished by defining a lot of imap definitions.
Feel free to contact me directly at kevinold@gmail.com