garbas / vim-snipmate

snipMate.vim aims to be a concise vim script that implements some of TextMate's snippets features in Vim.
www.vim.org/scripts/script.php?script_id=2540
2.01k stars 181 forks source link

Immediate errors after installation #287

Closed adouglas1-godaddy closed 10 months ago

adouglas1-godaddy commented 2 years ago

Installed with Vundle exactly as per the readme:

add the following to your vimrc then run :PluginInstall

  Plugin 'MarcWeber/vim-addon-mw-utils'
  Plugin 'tomtom/tlib_vim'
  Plugin 'garbas/vim-snipmate'

  " Optional:
  Plugin 'honza/vim-snippets'

Installation succeeds, then running vim says:

The legacy SnipMate parser is deprecated. Please see :h SnipMate-deprecate.
Error detected while processing /home/adouglas/.vim/after/plugin/snipMate.vim:
line   28:
E121: Undefined variable: snippets_dir
E116: Invalid arguments for function empty(snippets_dir)
E15: Invalid expression: empty(snippets_dir)
line   32:
E121: Undefined variable: snippets_dir
E116: Invalid arguments for function GetSnippets
Press ENTER or type command to continue

Then the same errors again when opening a file:

Error detected while processing FileType Auto commands for "*":
E121: Undefined variable: snippets_dir
E116: Invalid arguments for function GetSnippets
coffeebe4code commented 1 year ago

I get the same issue, this project seems dead. I am going to try to port ultisnips to nodejs and coc.

I really don't want to add python to vim.

msdos commented 1 year ago

The deprecate error is easy to solve. Follow the docs: add let g:snipMate.snippet_version = 0 to your .vimrc.

I will agree the snippets_dir is confusing. But solvable: as https://github.com/garbas/vim-snipmate/issues/198#issuecomment-84461219 says, try to just add let g:snipMate.snippet_dirs = split(&rtp, ',') and see if it works.

This project indeed seems "dead" but I use it in a daily basis since I really like the snippets syntax.

ajzafar commented 1 year ago

@adouglas1-godaddy On the one hand, msdos is possibly correct that setting snippet_version might fix all your problems (though I'm of course going to advocate for setting it to 1 not 0). There is more information on the versions in the FAQ on the repo's README.

On the other hand, the errors you're experiencing...aren't possible with this repository? In particular, snippets_dir does not exist anywhere in the code. There are a few instances of snippet_dirs, but that code is incapable of producing the errors you're experiencing.

Can you please ensure that you are using this repository's SnipMate? We can continue troubleshooting once we know you're using the correct repository.

ajzafar commented 10 months ago

I think the snippet_version issue was the source of problems here, as well as a potential incorrect version of SnipMate. If that's not the case, please reopen and we'll figure it out.