ultisnips
ultisnips copied to clipboard
Duplicated snippets when using symlink.
I am syncing my dot files to two computers and have my ".vim" symlinked to a file in a git repo called "dotfiles".
Ultisnip seems to be detecting duplicate and asking me to choose everytime.
" Ultisnips settings
let g:UltiSnipsSnippetDirectories=["UltiSnips", "custom-snippets"]
I was about to write the same.
Just a small addition: The setting let g:UltiSnipsSnippetDirectories = ["..."]
seems to be completely ignored.
@Artem-Schander no, it is not ignored, but the way snippets are searched for and edited is complex (unfortunately for good reasons) and not super intuitive. It is well documented in the help I think, but it is a bit to read.
To just fix this annoyance, you probably want to use g:UltiSnipsSnippetStorageDirectoryForUltiSnipsEdit, documented here https://github.com/SirVer/ultisnips/blob/issue/1343/fix/doc/UltiSnips.txt#L186.
Hi @SirVer,
I think I'm to dumb. It does not work and to be honest It does not seem like it is a solution at all. I've tried to set the following without any change:
let g:UltiSnipsSnippetStorageDirectoryForUltiSnipsEdit = "~/.config/nvim/plugged/vim-snippets/snippets"
let g:UltiSnipsSnippetStorageDirectoryForUltiSnipsEdit = "/home/va-artem/.dotfiles/config/nvim/plugged/vim-snippets/snippets/php.snippets"
Assuming it would work as I understand the docs. Wouldn't it only load the files from a single directory?
Hi @SirVer,
Thanks for the workaround. Unfortunately, it did not work and Ultisnip still detected duplicates...
I do not understand what is going on in both your cases then. Could you provide a minimal repro case so I can either fully appreciate the issue or debug what is going on? Please provide a fully reproducible example, ideally using the approach explained in https://github.com/SirVer/ultisnips/blob/master/CONTRIBUTING.md#reproducing-bugs or if not possible with a minimal vimrc
and snippets files, symlinks and involved directory structure and an exact sequence of key strokes that trigger the bug.
I'll try to find some time and create an example over the weekend
@Artem-Schander friendly ping. I will not be able to help without a repro case.
@SirVer It's still on my agenda. I'm trying my best to find some time
@SirVer thanks for your patience. Here is the repo as minimal as i could get it while still having this issue.
Without the plugins vim-vdebug/vdebug
and sheerun/vim-polyglot
this issue does not occur.
I hope this helps to narrow it down
@Artem-Schander Thanks for providing this repro case! That this is an interplay with other plugins bumps this down in priority for me, since that will be much harder to track down and impact much less users. I hope I get around to it to dig in soonish still.
@ameeruljunaidi are you using any of the mentioned plugins as well?
@SirVer Allright. It's not a big deal for me anyway. Take your time and let me know if I can help somehow.
Thank you @SirVer, I had the same issue and removing sheerun/vim-polyglot
solved the issue! Thank you for your help :)
vim-polyglot does some symlink resolution while modifying the runtimepath so it can put vim-polyglot at the beginning of the runtime path. I'm not sure if the symlink resolution is necessary but essentially it means the runtimepath is modified and so Ultisnips finds both instances of your snippets.
https://github.com/sheerun/vim-polyglot/blob/master/autoload/polyglot/init.vim#L3581-L3586