stuf
This commit is contained in:
@ -46,8 +46,8 @@ return {
|
||||
|
||||
local conditionalSources = cmp.config.sources({
|
||||
{ name = "nvim_lsp", priority = 6 },
|
||||
{ name = "nvim_lsp_signature_help", priority = 7 },
|
||||
{ name = "luasnip", priority = 8 },
|
||||
{ name = "nvim_lsp_signature_help", priority = 6 },
|
||||
{ name = "luasnip", priority = 7 },
|
||||
{ name = "calc" },
|
||||
{ name = "crates" },
|
||||
{ name = "nvim_lua" },
|
||||
@ -69,7 +69,7 @@ return {
|
||||
if use_google() then
|
||||
require("cmp_nvim_ciderlsp").setup()
|
||||
table.insert(conditionalSources, { name = "analysislsp" })
|
||||
table.insert(conditionalSources, { name = "nvim_ciderlsp", priority = 9 })
|
||||
table.insert(conditionalSources, { name = "nvim_ciderlsp", priority = 8 })
|
||||
else
|
||||
table.insert(conditionalSources, { name = "cmp_tabnine" })
|
||||
end
|
||||
@ -140,7 +140,7 @@ return {
|
||||
|
||||
sorting = {
|
||||
comparators = {
|
||||
cmp.config.compare.priority,
|
||||
-- cmp.config.compare.priority,
|
||||
cmp.config.compare.offset,
|
||||
cmp.config.compare.exact,
|
||||
cmp.config.compare.score,
|
||||
@ -160,6 +160,8 @@ return {
|
||||
|
||||
formatting = {
|
||||
format = lspkind.cmp_format({
|
||||
with_text = true,
|
||||
|
||||
-- mode = "symbol_text",
|
||||
-- before = function(entry, vim_item)
|
||||
-- if entry.source.name == "nvim_ciderlsp" then
|
||||
@ -172,7 +174,7 @@ return {
|
||||
-- end
|
||||
-- return vim_item
|
||||
-- end,
|
||||
maxwidth = 40, -- half max width
|
||||
maxwidth = 50, -- half max width
|
||||
menu = {
|
||||
nvim_ciderlsp = "",
|
||||
buffer = "",
|
||||
|
@ -9,20 +9,20 @@ return {
|
||||
"rcarriga/nvim-notify",
|
||||
},
|
||||
keys = {
|
||||
{"<leader>rn", "<cmd>lua vim.lsp.buf.rename()<CR>"},
|
||||
{"<leader>ca", "<cmd>lua vim.lsp.buf.code_action()<CR>"},
|
||||
{"L", "<cmd>lua vim.lsp.buf.hover()<CR>"},
|
||||
{"g0", "<cmd>lua vim.lsp.buf.document_symbol()<CR>"},
|
||||
{"gW", "<cmd>lua vim.lsp.buf.workspace_symbol()<CR>"},
|
||||
{"gd", "<cmd>lua vim.lsp.buf.definition()<CR>"},
|
||||
{"gD", "<cmd>tab split | lua vim.lsp.buf.definition()<CR>"},
|
||||
{"gi", "<cmd>lua vim.lsp.buf.implementation()<CR>"},
|
||||
{"gI", "<cmd>lua vim.lsp.buf.implementation()<CR>"},
|
||||
{"gR", "<cmd>lua vim.lsp.buf.references()<CR>"},
|
||||
{"<C-g>", "<cmd>lua vim.lsp.buf.signature_help()<CR>"},
|
||||
{"gt", "<cmd>lua vim.lsp.buf.type_definition()<CR>"},
|
||||
{ "<C-g>", "<cmd>lua vim.lsp.buf.signature_help()<CR>", mode = "i"},
|
||||
{"<leader>ca", "<cmd>lua vim.lsp.buf.code_action()<CR>", mode = "v"},
|
||||
{ "<leader>rn", "<cmd>lua vim.lsp.buf.rename()<CR>" },
|
||||
{ "<leader>ca", "<cmd>lua vim.lsp.buf.code_action()<CR>" },
|
||||
{ "L", "<cmd>lua vim.lsp.buf.hover()<CR>" },
|
||||
{ "g0", "<cmd>lua vim.lsp.buf.document_symbol()<CR>" },
|
||||
{ "gW", "<cmd>lua vim.lsp.buf.workspace_symbol()<CR>" },
|
||||
{ "gd", "<cmd>lua vim.lsp.buf.definition()<CR>" },
|
||||
{ "gD", "<cmd>tab split | lua vim.lsp.buf.definition()<CR>" },
|
||||
{ "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>" },
|
||||
{ "gI", "<cmd>lua vim.lsp.buf.implementation()<CR>" },
|
||||
{ "gR", "<cmd>lua vim.lsp.buf.references()<CR>" },
|
||||
{ "<C-g>", "<cmd>lua vim.lsp.buf.signature_help()<CR>" },
|
||||
{ "gt", "<cmd>lua vim.lsp.buf.type_definition()<CR>" },
|
||||
{ "<C-g>", "<cmd>lua vim.lsp.buf.signature_help()<CR>", mode = "i" },
|
||||
{ "<leader>ca", "<cmd>lua vim.lsp.buf.code_action()<CR>", mode = "v" },
|
||||
},
|
||||
config = function()
|
||||
local use_google = require("utils").use_google
|
||||
@ -162,10 +162,6 @@ return {
|
||||
local my_on_attach = function(client, bufnr)
|
||||
require("lualine").refresh()
|
||||
|
||||
vim.api.nvim_command("autocmd CursorHold <buffer> lua vim.lsp.buf.document_highlight()")
|
||||
vim.api.nvim_command("autocmd CursorHoldI <buffer> lua vim.lsp.buf.document_highlight()")
|
||||
vim.api.nvim_command("autocmd CursorMoved <buffer> lua vim.lsp.util.buf_clear_references()")
|
||||
|
||||
vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc")
|
||||
if vim.lsp.formatexpr then -- Neovim v0.6.0+ only.
|
||||
vim.api.nvim_buf_set_option(bufnr, "formatexpr", "v:lua.vim.lsp.formatexpr")
|
||||
|
Reference in New Issue
Block a user