Environment
- Ubuntu 14.04
- Vim 7
- Tmux
I'm just trying to create some snippets for UltiSnips and writing bib files.
What I want
To create custom snippets that will make writing bib files (that I can't download) a bit more straightforward from Vim.
What I've tried
I have opened a .bib file, and then run :UltiSnipsEdit
from within Vim. I created a new snip named online
and copied the following into it:
@online{$1,
author = {},
title = {},
year = ,
url = {},
urldate = {}
}
The snippet looks like this:
snippet online "Cite from website"
@online{$1,
author = {},
title = {},
year = ,
url = {},
urldate = {}
}
endsnippet
Then when I reopen [1] my .bib
file and type online
I don't get any prompt for this.
If I type @online{onli
I will get the prompt appear that I created. However when I try to select this prompt using my assigned key command [2] nothing actually happens.
Some steps that don't work for me :
Open new file with
vim h.bib
:UltiSnipsEdit
Create the following snip :
snippet mouse "Description" something something snippet endsnippet
Return to
h.bib
(thats still open from the split)- Enter insert mode
- Type
mous
expecting prompt - no prompt - Type
@x{mou
-> prompt appears - Tab to the prompt (mouse) and then enter the command for completion
(
<leader>df
or,df
) - this doesn't do anything.
What's going wrong
The first error (that nothing appears) seems to be related to bib files being in comment mode by default. I'm not sure whether UltiSnips can work inside comments?
I'm not sure why it's not autocompleting when the prompt does appear though.
Perhaps a vim function or something would be more appropriate, I've never written one.
Edit
I've tried using this outside of tmux (default terminal) and muting YouCompleteme, neither of which have helped.
Thanks
Footnotes
[1] I know this isn't meant to be needed, I just thought I'd try it anyway.
[2] the key that I have assigned for UltiSnips is
let g:UltiSnipsExpandTrigger="<Leader>df"
as YouCompleteMe is using the <tab>