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 = "",
|
||||
|
@ -146,10 +146,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")
|
||||
@ -177,6 +173,15 @@ return {
|
||||
vim.api.nvim_set_keymap("i", "<C-g>", "<cmd>lua vim.lsp.buf.signature_help()<CR>", opts)
|
||||
|
||||
vim.api.nvim_set_keymap("n", "gt", "<cmd>lua vim.lsp.buf.type_definition()<CR>", opts)
|
||||
|
||||
vim.api.nvim_command("augroup LSP")
|
||||
vim.api.nvim_command("autocmd!")
|
||||
if client.server_capabilities.documentFormattingProvider then
|
||||
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()")
|
||||
end
|
||||
vim.api.nvim_command("augroup END")
|
||||
end
|
||||
|
||||
if use_google() then
|
||||
|
Reference in New Issue
Block a user