garymjr / nvim-snippets

Snippet support using native neovim snippets
MIT License
215 stars 13 forks source link

feat: add preview highlighting and ghost text support #2

Closed willothy closed 7 months ago

willothy commented 7 months ago

There are a few changes in this PR (let me know if you want me to split them up), all related to improving the cmp source.

  1. Use the body for insertText instead of prefix, to allow showing a preview as ghost text instead of just showing the prefix.
  2. Use the InsertTextFormat.snippet to invoke cmp's snippet expansion instead of using vim.snippet directly (users will have configured cmp to expand via vim.snippet).
  3. Adds markdown code block surrounding the preview body to allow treesitter highlighting of code previews (can be disabled via an option)
garymjr commented 7 months ago

This looks great, thanks!