Remove some cmp plugins that were messing with noice

This commit is contained in:
Evie Litherland-Smith 2023-06-05 15:56:25 +01:00
parent 2f202b7c80
commit 98e5633959
6 changed files with 43 additions and 59 deletions

View file

@ -2,11 +2,11 @@ local on_attach = function(client, bufnr)
-- Mappings. -- Mappings.
-- See `:help vim.lsp.*` for documentation on any of the below functions -- See `:help vim.lsp.*` for documentation on any of the below functions
local bufopts = { noremap = true, silent = true, buffer = bufnr } local bufopts = { noremap = true, silent = true, buffer = bufnr }
vim.keymap.set("n", "gd", vim.lsp.buf.definition, bufopts) vim.keymap.set("n", "gd", "<cmd>TroubleToggle lsp_definitions<cr>")
vim.keymap.set("n", "gr", vim.lsp.buf.references, bufopts) vim.keymap.set("n", "gr", "<cmd>TroubleToggle lsp_references<cr>")
vim.keymap.set("n", "gi", vim.lsp.buf.implementation, bufopts) vim.keymap.set("n", "gi", vim.lsp.buf.implementation, bufopts)
vim.keymap.set("n", "K", vim.lsp.buf.hover, bufopts) vim.keymap.set("n", "K", vim.lsp.buf.hover, bufopts)
vim.keymap.set("n", "<leader>D", vim.lsp.buf.type_definition, bufopts) vim.keymap.set("n", "<leader>D", "<cmd>TroubleToggle lsp_type_definitions<cr>")
vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, bufopts) vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, bufopts)
vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, bufopts) vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, bufopts)
vim.keymap.set( vim.keymap.set(
@ -89,6 +89,6 @@ return {
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
cond = not vim.g.vscode, cond = not vim.g.vscode,
event = { "BufReadPre", "BufNewFile" }, event = { "BufReadPre", "BufNewFile" },
dependencies = { "cmp-nvim-lsp", "folke/neodev.nvim", "jose-elias-alvarez/null-ls.nvim" }, dependencies = { "cmp-nvim-lsp", "folke/trouble.nvim", "folke/neodev.nvim", "jose-elias-alvarez/null-ls.nvim" },
config = config, config = config,
} }

View file

@ -4,7 +4,8 @@ return {
dependencies = { "nvim-tree/nvim-web-devicons", "folke/noice.nvim", "folke/tokyonight.nvim" }, dependencies = { "nvim-tree/nvim-web-devicons", "folke/noice.nvim", "folke/tokyonight.nvim" },
event = { "BufReadPre", "BufNewFile" }, event = { "BufReadPre", "BufNewFile" },
config = true, config = true,
opts = { opts = function()
return {
options = { options = {
theme = "tokyonight", theme = "tokyonight",
component_separators = "|", component_separators = "|",
@ -14,7 +15,14 @@ return {
sections = { sections = {
lualine_a = { { "mode", separator = { left = "" }, right_padding = 2 } }, lualine_a = { { "mode", separator = { left = "" }, right_padding = 2 } },
lualine_b = { "filename", { "branch", icon = "󰊢" }, "diff" }, lualine_b = { "filename", { "branch", icon = "󰊢" }, "diff" },
lualine_c = { "diagnostics" }, lualine_c = {
"diagnostics",
{
require("noice").api.status.mode.get,
cond = require("noice").api.status.mode.has,
color = { fg = "#ff9e64" },
},
},
lualine_x = { "filetype", "fileformat", "encoding" }, lualine_x = { "filetype", "fileformat", "encoding" },
lualine_y = { "progress" }, lualine_y = { "progress" },
lualine_z = { "selectioncount", { "location", separator = { right = "" }, left_padding = 2 } }, lualine_z = { "selectioncount", { "location", separator = { right = "" }, left_padding = 2 } },
@ -22,5 +30,6 @@ return {
tabline = {}, tabline = {},
winbar = {}, winbar = {},
extensions = { "aerial", "fzf", "lazy", "neo-tree", "toggleterm", "trouble" }, extensions = { "aerial", "fzf", "lazy", "neo-tree", "toggleterm", "trouble" },
}, }
end,
} }

View file

@ -5,20 +5,18 @@ return {
dependencies = { dependencies = {
"MunifTanjim/nui.nvim", "MunifTanjim/nui.nvim",
"rcarriga/nvim-notify", "rcarriga/nvim-notify",
"stevearc/dressing.nvim",
}, },
config = true, config = true,
opts = { opts = {
presets = {
bottom_search = true,
command_palette = true,
long_message_to_split = true,
inc_rename = false,
lsp_doc_border = true,
},
lsp = { lsp = {
progress = {
enabled = true,
format = {
"({data.progress.percentage}%) ",
-- { "{spinner} ", hl_group = "NoiceLspProgressSpinner" },
{ "{data.progress.title} ", hl_group = "NoiceLspProgressTitle" },
{ "{data.progress.client} ", hl_group = "NoiceLspProgressClient" },
},
},
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
override = { override = {
["vim.lsp.util.convert_input_to_markdown_lines"] = true, ["vim.lsp.util.convert_input_to_markdown_lines"] = true,
["vim.lsp.util.stylize_markdown"] = true, ["vim.lsp.util.stylize_markdown"] = true,
@ -32,13 +30,5 @@ return {
win_options = { winblend = 0 }, win_options = { winblend = 0 },
}, },
}, },
-- you can enable a preset for easier configuration
presets = {
bottom_search = false, -- use a classic bottom cmdline for search
command_palette = true, -- position the cmdline and popupmenu together
long_message_to_split = false, -- long messages will be sent to a splitnoice
inc_rename = true, -- enables an input dialog for inc-rename.nvim
lsp_doc_border = true, -- add a border to hover docs and signature help
},
}, },
} }

View file

@ -6,6 +6,6 @@ return {
opts = { opts = {
background_colour = "#000000", background_colour = "#000000",
fps = 60, fps = 60,
render = "default", -- "minimal", "simple" render = "compact",
}, },
} }

View file

@ -41,11 +41,6 @@ local config = function()
-- Set configuration for specific filetype. -- Set configuration for specific filetype.
cmp.setup.filetype("norg", { sources = { { name = "neorg" } } }) cmp.setup.filetype("norg", { sources = { { name = "neorg" } } })
cmp.setup.cmdline({ "/", "?" }, { mapping = cmp.mapping.preset.cmdline(), sources = { { name = "buffer" } } })
cmp.setup.cmdline(
":",
{ mapping = cmp.mapping.preset.cmdline(), sources = { { name = "path" }, { name = "cmdline" } } }
)
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
end end
@ -56,9 +51,6 @@ return {
event = { "InsertEnter", "CmdlineEnter" }, event = { "InsertEnter", "CmdlineEnter" },
dependencies = { dependencies = {
"hrsh7th/cmp-nvim-lsp", "hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"hrsh7th/cmp-cmdline",
"windwp/nvim-autopairs", "windwp/nvim-autopairs",
"saadparwaiz1/cmp_luasnip", "saadparwaiz1/cmp_luasnip",
"L3MON4D3/LuaSnip", "L3MON4D3/LuaSnip",

View file

@ -3,19 +3,12 @@ return {
cond = not vim.g.vscode, cond = not vim.g.vscode,
dependencies = "nvim-tree/nvim-web-devicons", dependencies = "nvim-tree/nvim-web-devicons",
cmd = "TroubleToggle", cmd = "TroubleToggle",
init = function() init = function() vim.keymap.set("n", "<leader>xx", "<cmd>TroubleToggle<cr>") end,
vim.keymap.set("n", "<leader>xx", "<cmd>TroubleToggle<cr>")
vim.keymap.set("n", "<leader>xw", "<cmd>TroubleToggle workspace_diagnostics<cr>")
vim.keymap.set("n", "<leader>xd", "<cmd>TroubleToggle document_diagnostics<cr>")
vim.keymap.set("n", "<leader>xq", "<cmd>TroubleToggle quickfix<cr>")
vim.keymap.set("n", "<leader>xl", "<cmd>TroubleToggle loclist<cr>")
vim.keymap.set("n", "gR", "<cmd>TroubleToggle lsp_references<cr>")
end,
config = true, config = true,
opts = { opts = {
mode = "workspace_diagnostics", mode = "workspace_diagnostics",
auto_open = false, auto_open = false,
auto_close = false, auto_close = true,
auto_preview = true, auto_preview = true,
auto_jump = { "lsp_definitions" }, auto_jump = { "lsp_definitions" },
use_diagnostic_signs = true, use_diagnostic_signs = true,