chrisgrieser / nvim-scissors

Automagical editing and creation of snippets.
MIT License
377 stars 4 forks source link

[Bug]: error afer key enter in add new snippet #18

Closed mohamad-supangat closed 4 months ago

mohamad-supangat commented 4 months ago

Bug Description

after key enter to save new snippet i got a error, but snippet file updated in snippet folder

Relevant Screenshot

Screenshot 2024-06-12 092137

To Reproduce

  1. Select some text in virtual mode
  2. using keymap <leader>sa to create snippet
  3. insert prefix or title
  4. key esc back to normal mode and key enter to save

neovim version

NVIM v0.10.0
Build type: Release

Make sure you have done the following

chrisgrieser commented 4 months ago

thanks, fixed.

btw, that error did only occur when you did not use LuaSnip or nvim-snippets. What snippet engine are you using? Cause I am actually not aware of any other

mohamad-supangat commented 4 months ago

thanks, fixed.

btw, that error did only occur when you did not use LuaSnip or nvim-snippets. What snippet engine are you using? Cause I am actually not aware of any other

Tanks for fix this, i use https://github.com/hrsh7th/vim-vsnip

btw who is better vim-vsnip or luasnip for vscode snippet support ?

chrisgrieser commented 4 months ago

Ah, I didn't know about vsnip, interesting.

Generally, luasnip or nvim-snippets are preferrable, since both have reload functiosn, meaning you do not have to restart vim after editing/adding a snippet with scissors.

luasnip is the more complicated, but also more customizable plugin, while nvim-snippets is the simpler plugin. Lazyvim (the nvim distro) uses nvim-snippets.

chrisgrieser commented 4 months ago

btw, if you wanna keep on using vsnip, I just added support for hot-reloading with it in https://github.com/chrisgrieser/nvim-scissors/commit/dc039a7cc3eca12eaea617b1a8cf6d12a2ae14fb

mohamad-supangat commented 4 months ago

Thanks fot this awesome plugin @chrisgrieser