feat(nvim): improve creates.nvim
setup
All checks were successful
Check Formatting of Files / Check-Formatting (push) Successful in 1m2s
All checks were successful
Check Formatting of Files / Check-Formatting (push) Successful in 1m2s
This commit is contained in:
parent
187e87757b
commit
3f0637772f
@ -62,12 +62,6 @@ return {
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
},
|
||||
},
|
||||
{
|
||||
"saecki/crates.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
ft = "toml",
|
||||
config = true,
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
local cmp = require("cmp")
|
||||
@ -187,7 +181,7 @@ return {
|
||||
orgmode = { symbol = " ", name = "Org", hl_group = "Orgmode" },
|
||||
emoji = { symbol = " ", name = "Emoji", hl_group = "Emoji" },
|
||||
zsh = { symbol = " ", name = "Zsh", hl_group = "Zsh" },
|
||||
crates = { symbol = " ", name = "Crates", hl_group = "Crates" },
|
||||
["crates.nvim"] = { symbol = " ", name = "Crates", hl_group = "Crates" },
|
||||
cmdline_history = { symbol = " ", name = "Cmd History", hl_group = "CmdHistory" },
|
||||
rg = { symbol = " ", name = "Ripgrep", hl_group = "Ripgrep" },
|
||||
fuzzy_buffer = { symbol = " ", name = "Buffer", hl_group = "Buffer" },
|
||||
@ -205,6 +199,7 @@ return {
|
||||
|
||||
local selection
|
||||
local lsp_name
|
||||
-- vim.notify(vim.inspect(entry.source))
|
||||
if entry.source.name == "nvim_lsp" then
|
||||
lsp_name = entry.source.source.client.name
|
||||
selection = selections[lsp_name]
|
||||
@ -438,7 +433,6 @@ return {
|
||||
"plsql",
|
||||
{ sources = standard_sources({ { name = "vim-dadbod-completion", priority = 20 } }) }
|
||||
)
|
||||
cmp.setup.filetype("toml", { sources = standard_sources({ { name = "crates" } }) })
|
||||
cmp.setup.filetype("org", { sources = standard_sources({ { name = "orgmode", priority = 20 } }) })
|
||||
|
||||
-- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore).
|
||||
|
23
users/price/dots/.config/nvim/lua/plugins/configs/crates.lua
Normal file
23
users/price/dots/.config/nvim/lua/plugins/configs/crates.lua
Normal file
@ -0,0 +1,23 @@
|
||||
return {
|
||||
{
|
||||
"saecki/crates.nvim",
|
||||
event = { "BufRead Cargo.toml" },
|
||||
config = function()
|
||||
require("crates").setup({
|
||||
lsp = {
|
||||
enabled = true,
|
||||
actions = true,
|
||||
completion = true,
|
||||
hover = true,
|
||||
},
|
||||
completion = {
|
||||
crates = {
|
||||
enabled = true,
|
||||
max_results = 8,
|
||||
min_chars = 2,
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
Loading…
Reference in New Issue
Block a user