Commit graph

3 commits

Author SHA1 Message Date
abeldekat
f2f2aea672
feat(snippets): mini.snippets standalone and blink.resubscribe (#5507)
## Description


When using blink.cmp and mini.snippets, the same problem regarding
outdated completion items as solved in
[nvim-cmp](https://github.com/hrsh7th/nvim-cmp/pull/2126) can arise.

[This](https://github.com/Saghen/blink.cmp/pull/1035) PR has been
included into main.
When the PR is included into the next stable release, this PR can be
merged.
Current blink release: 0.11.0


## Checklist

- [x] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.

Co-authored-by: abeldekat <abel@nomail.com>
2025-02-16 09:06:35 +01:00
abeldekat
4a81a370d7
feat(snippets): mini.snippets is out of beta (#5505)
## Description

mini.snippets is out of beta, so I adjusted the description for the
extra accordingly


## Checklist

- [x] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.

---------

Co-authored-by: abeldekat <abel@nomail.com>
2025-01-31 17:11:26 +01:00
abeldekat
8b4e6ff70d
feat(snippets): an extra for mini.snippets (#5274)
## Description

Mini.snippets, a plugin to manage and expand snippets, is currently in
[beta](https://github.com/echasnovski/mini.nvim/issues/1428).

I think the plugin is a very interesting alternative to `luasnip`.

The following `lazydoc` will be added:

```lua
if lazyvim_docs then
  -- Set to `false` to prevent "non-lsp snippets"" from appearing inside completion windows
  -- Motivation: Less clutter in completion windows and a more direct usage of snippits
  vim.g.lazyvim_mini_snippets_in_completion = true

  -- Using default mini.snippets, completion suggestions might appear directly after inserting a snippet
  -- This extra prevents that from happening.
  -- Motivation: A better display of the current snippet.
  -- Also, those completions do not appear when using luasnip or native snippets
  --
  -- Set to `false` to enable completion suggestions directly after inserting a snippet
  vim.g.lazyvim_mini_snippets_override_expand_insert = true

  -- NOTE: Please also read:
  -- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-snippets.md#expand
  -- :h MiniSnippets-session

  -- Example override for your own config:
  --[[
  return {
    {
      "echasnovski/mini.snippets",
      opts = function(_, opts)
        -- By default, for opts.snippets, the extra for mini.snippets only adds gen_loader.from_lang()
        -- This provides a sensible quickstart, integrating with friendly-snippets
        -- and your own language-specific snippets
        --
        -- In order to change opts.snippets, replace the entire table inside your own opts

        local snippets, config_path = require("mini.snippets"), vim.fn.stdpath("config")

        opts.snippets = { -- override opts.snippets provided by extra...
          -- Load custom file with global snippets first (order matters)
          snippets.gen_loader.from_file(config_path .. "/snippets/global.json"),

          -- Load snippets based on current language by reading files from
          -- "snippets/" subdirectories from 'runtimepath' directories.
          snippets.gen_loader.from_lang(), -- this is the default in the extra...
        }
      end,
    },
  }
--]]
end

```

It's possible to use the code from this PR directly in your own
configuration:

1. Copy the code to lua/extras/coding/mini_snippets.lua in your config
folder
2. Restart nvim and enable the "user" extra for `mini.snippets`
3. Restart nvim
 
## Checklist

- [x] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.

---------

Co-authored-by: abeldekat <abel@nomail.com>
2025-01-23 12:03:36 +01:00