Neovim Config
1return { -- Autocompletion
2 "saghen/blink.cmp",
3 cond = function()
4 if os.getenv("WICKED_VIM_MODE") == "OBSIDIAN" then
5 return false
6 end
7 if os.getenv("WICKED_VIM_MODE") == nil then
8 return true
9 end
10 end,
11 event = "VimEnter",
12 version = "1.*",
13 dependencies = {
14 -- Snippet Engine
15 {
16 "L3MON4D3/LuaSnip",
17 version = "2.*",
18 build = (function()
19 -- Build Step is needed for regex support in snippets.
20 -- This step is not supported in many windows environments.
21 -- Remove the below condition to re-enable on windows.
22 if vim.fn.has("win32") == 1 or vim.fn.executable("make") == 0 then
23 return
24 end
25 return "make install_jsregexp"
26 end)(),
27 dependencies = {
28 -- `friendly-snippets` contains a variety of premade snippets.
29 -- See the README about individual language/framework/plugin snippets:
30 -- https://github.com/rafamadriz/friendly-snippets
31 -- {
32 -- 'rafamadriz/friendly-snippets',
33 -- config = function()
34 -- require('luasnip.loaders.from_vscode').lazy_load()
35 -- end,
36 -- },
37 },
38 opts = {},
39 },
40 "folke/lazydev.nvim",
41 },
42 --- @module 'blink.cmp'
43 --- @type blink.cmp.Config
44 opts = {
45 keymap = {
46 -- 'default' (recommended) for mappings similar to built-in completions
47 -- <c-y> to accept ([y]es) the completion.
48 -- This will auto-import if your LSP supports it.
49 -- This will expand snippets if the LSP sent a snippet.
50 -- 'super-tab' for tab to accept
51 -- 'enter' for enter to accept
52 -- 'none' for no mappings
53 --
54 -- For an understanding of why the 'default' preset is recommended,
55 -- you will need to read `:help ins-completion`
56 --
57 -- No, but seriously. Please read `:help ins-completion`, it is really good!
58 --
59 -- All presets have the following mappings:
60 -- <tab>/<s-tab>: move to right/left of your snippet expansion
61 -- <c-space>: Open menu or open docs if already open
62 -- <c-n>/<c-p> or <up>/<down>: Select next/previous item
63 -- <c-e>: Hide menu
64 -- <c-k>: Toggle signature help
65 --
66 -- See :h blink-cmp-config-keymap for defining your own keymap
67 preset = "default",
68
69 -- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see:
70 -- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
71 },
72
73 appearance = {
74 -- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
75 -- Adjusts spacing to ensure icons are aligned
76 nerd_font_variant = "mono",
77 },
78
79 completion = {
80 -- By default, you may press `<c-space>` to show the documentation.
81 -- Optionally, set `auto_show = true` to show the documentation after a delay.
82 documentation = { auto_show = false, auto_show_delay_ms = 500 },
83 },
84
85 sources = {
86 default = { "lsp", "path", "snippets", "lazydev" },
87 providers = {
88 lazydev = { module = "lazydev.integrations.blink", score_offset = 100 },
89 },
90 },
91
92 snippets = { preset = "luasnip" },
93
94 -- Blink.cmp includes an optional, recommended rust fuzzy matcher,
95 -- which automatically downloads a prebuilt binary when enabled.
96 --
97 -- By default, we use the Lua implementation instead, but you may enable
98 -- the rust implementation via `'prefer_rust_with_warning'`
99 --
100 -- See :h blink-cmp-config-fuzzy for more information
101 fuzzy = { implementation = "lua" },
102
103 -- Shows a signature help window while you type arguments for a function
104 signature = { enabled = true },
105 },
106}