summaryrefslogtreecommitdiff
path: root/lua/config/plugins/completion.lua
diff options
context:
space:
mode:
authorLibravatar Mora Unie Youer <[email protected]>2025-05-09 12:44:46 +0300
committerLibravatar Mora Unie Youer <[email protected]>2025-05-09 12:44:46 +0300
commitffef1e3eaa46e1433e5105710af4b40deb5bf35e (patch)
tree99b5822113df1e0c0f7053ca9578055a5447625d /lua/config/plugins/completion.lua
parentfeat: map `<leader>w` to `<C-w>` (diff)
downloadneovim-configuration-ffef1e3eaa46e1433e5105710af4b40deb5bf35e.tar.gz
neovim-configuration-ffef1e3eaa46e1433e5105710af4b40deb5bf35e.tar.bz2
neovim-configuration-ffef1e3eaa46e1433e5105710af4b40deb5bf35e.tar.lz
neovim-configuration-ffef1e3eaa46e1433e5105710af4b40deb5bf35e.tar.xz
neovim-configuration-ffef1e3eaa46e1433e5105710af4b40deb5bf35e.tar.zst
neovim-configuration-ffef1e3eaa46e1433e5105710af4b40deb5bf35e.zip
feat: use `lazydev.nvim` for better NeoVim lua suggestions
Diffstat (limited to '')
-rw-r--r--lua/config/plugins/completion.lua37
1 files changed, 36 insertions, 1 deletions
diff --git a/lua/config/plugins/completion.lua b/lua/config/plugins/completion.lua
index 7a02809..84b17dd 100644
--- a/lua/config/plugins/completion.lua
+++ b/lua/config/plugins/completion.lua
@@ -1,5 +1,31 @@
return {
{
+ "lazydev.nvim",
+ ft = "lua",
+ after = function(_)
+ -- NOTE: this is required to fix strange filtering in `lazydev.nvim`
+ --- @diagnostic disable-next-line: duplicate-set-field
+ require("lazydev.lsp").supports = function(client)
+ local client_names = {
+ -- Default client names from `lazydev.nvim`
+ "lua_ls",
+ "emmylua-analyzer-rust",
+ -- NOTE: I have `lua-language-server` name which was not in list
+ "lua-language-server",
+ }
+
+ return client and vim.tbl_contains(client_names, client.name)
+ end
+
+ require("lazydev").setup({
+ library = {
+ { path = "${3rd}/luv/library", words = { "vim%.uv" } },
+ { path = "snacks.nvim", words = { "Snacks" } },
+ },
+ })
+ end,
+ },
+ {
"blink.cmp",
event = "DeferredUIEnter",
after = function(_)
@@ -18,7 +44,16 @@ return {
ghost_text = { enabled = true },
},
- sources = { default = { "lsp", "path", "snippets", "buffer" } },
+ sources = {
+ default = { "lazydev", "lsp", "path", "snippets", "buffer" },
+ providers = {
+ lazydev = {
+ name = "LazyDev",
+ module = "lazydev.integrations.blink",
+ score_offset = 100,
+ },
+ },
+ },
fuzzy = {
sorts = { "exact", "score", "sort_text" },