Files
nvim/lua/plugins/blink.lua

80 lines
3.1 KiB
Lua
Raw Normal View History

2025-04-12 23:49:02 +01:00
-- Autocompletion
return {
'saghen/blink.cmp',
event = 'VimEnter',
version = '1.*',
dependencies = {
2025-12-08 00:52:01 +00:00
-- 'L3MON4D3/LuaSnip',
2025-04-12 23:49:02 +01:00
'folke/lazydev.nvim',
},
--- @module 'blink.cmp'
--- @type blink.cmp.Config
opts = {
keymap = {
-- 'default' (recommended) for mappings similar to built-in completions
-- <c-y> to accept ([y]es) the completion.
-- This will auto-import if your LSP supports it.
-- This will expand snippets if the LSP sent a snippet.
-- 'super-tab' for tab to accept
-- 'enter' for enter to accept
-- 'none' for no mappings
--
-- For an understanding of why the 'default' preset is recommended,
-- you will need to read `:help ins-completion`
--
-- No, but seriously. Please read `:help ins-completion`, it is really good!
--
-- All presets have the following mappings:
-- <tab>/<s-tab>: move to right/left of your snippet expansion
-- <c-space>: Open menu or open docs if already open
-- <c-n>/<c-p> or <up>/<down>: Select next/previous item
-- <c-e>: Hide menu
-- <c-k>: Toggle signature help
--
-- See :h blink-cmp-config-keymap for defining your own keymap
2025-04-13 22:53:08 +01:00
preset = 'enter',
2025-12-08 16:33:11 +00:00
['<C-K>'] = false,
2025-04-12 23:49:02 +01:00
-- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see:
-- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
},
appearance = {
-- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
-- Adjusts spacing to ensure icons are aligned
2025-04-13 22:53:08 +01:00
nerd_font_variant = 'normal',
2025-04-12 23:49:02 +01:00
},
completion = {
-- By default, you may press `<c-space>` to show the documentation.
-- Optionally, set `auto_show = true` to show the documentation after a delay.
2025-04-29 17:22:28 +01:00
documentation = { auto_show = true, auto_show_delay_ms = 200 },
2025-04-12 23:49:02 +01:00
},
sources = {
2025-10-19 10:01:51 +01:00
default = { 'lsp', 'path', 'snippets', 'lazydev' },
2025-04-12 23:49:02 +01:00
providers = {
lazydev = { module = 'lazydev.integrations.blink', score_offset = 100 },
2025-04-13 22:53:08 +01:00
-- avante = { module = 'blink-cmp-avante', name = 'Avante', opts = {} },
},
per_filetype = {
codecompanion = { 'codecompanion' },
2025-04-12 23:49:02 +01:00
},
},
2025-12-08 00:52:01 +00:00
-- snippets = { preset = 'luasnip' },
2025-04-12 23:49:02 +01:00
-- Blink.cmp includes an optional, recommended rust fuzzy matcher,
-- which automatically downloads a prebuilt binary when enabled.
--
-- By default, we use the Lua implementation instead, but you may enable
-- the rust implementation via `'prefer_rust_with_warning'`
--
-- See :h blink-cmp-config-fuzzy for more information
fuzzy = { implementation = 'lua' },
-- Shows a signature help window while you type arguments for a function
signature = { enabled = true },
},
}