Something went wrong. Try again.
A very fast neovim config :D
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141local M = { { "folke/trouble.nvim", config = true, dependencies = { "nvim-tree/nvim-web-devicons" }, keys = { { "<leader>xx", "<cmd>Trouble diagnostics toggle<cr>", desc = "Diagnostics (Trouble)", }, { "<leader>xX", "<cmd>Trouble diagnostics toggle filter.buf=0<cr>", desc = "Buffer Diagnostics (Trouble)", }, { "<leader>cs", "<cmd>Trouble symbols toggle<cr>", desc = "Symbols (Trouble)", }, { "<leader>cl", "<cmd>Trouble lsp toggle win.position=right<cr>", desc = "LSP Definitions / references / ... (Trouble)", }, { "<leader>xL", "<cmd>Trouble loclist toggle<cr>", desc = "Location List (Trouble)", }, { "<leader>xQ", "<cmd>Trouble qflist toggle<cr>", desc = "Quickfix List (Trouble)", }, }, opts = { auto_close = true, focus = true, }, }, { "j-hui/fidget.nvim", event = "BufReadPost", opts = { notification = { override_vim_notify = true, }, }, }, { "williamboman/mason.nvim", cmd = "Mason", build = ":MasonUpdate", opts = { ui = { border = "rounded", icons = { package_installed = "✓", package_pending = "➜", package_uninstalled = "✗", }, }, }, }, { "williamboman/mason-lspconfig.nvim", dependencies = { "mason.nvim" }, opts = { ensure_installed = { "lua_ls", "tinymist", }, }, }, { "neovim/nvim-lspconfig", event = "BufReadPre", dependencies = { "mason.nvim", "mason-lspconfig.nvim", }, config = function() vim.diagnostic.config({ float = { focusable = true, style = "minimal", border = "rounded", source = "always", header = "", prefix = "", severity_sort = true, }, virtual_text = { spacing = 4, prefix = "" }, signs = true, underline = true, update_in_insert = true, severity_sort = true, })
local capabilities = require("blink.cmp").get_lsp_capabilities() vim.lsp.config("*", { capabilities = capabilities, })
-- Use LspAttach autocommand for keybindings vim.api.nvim_create_autocmd("LspAttach", { group = vim.api.nvim_create_augroup("UserLspConfig", { clear = true }), callback = function(ev) local bufnr = ev.buf local function map(modes, keys, command, desc) vim.keymap.set(modes, keys, command, { noremap = true, silent = true, buffer = bufnr, desc = desc, }) end
map("n", "gr", "<cmd>Telescope lsp_references<CR>", "LSP References") map("n", "gd", "<cmd>Telescope lsp_definitions<CR>", "LSP Definitions") map("n", "gD", vim.lsp.buf.declaration, "LSP Declarations") map("n", "gi", "<cmd>Telescope lsp_implementations<CR>", "LSP Implementations") map("n", "<leader>D", "<cmd>Telescope diagnostics bufnr=0<CR>", "LSP Diagnostics") map("n", "<leader>d", vim.diagnostic.open_float, "Inline Diagnostics") map("n", "[d", vim.diagnostic.goto_prev, "Previous Diagnostic") map("n", "]d", vim.diagnostic.goto_next, "Next Diagnostic") map("n", "K", vim.lsp.buf.hover, "Symbol Info") map({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, "Code Actions") map("n", "<leader>rn", vim.lsp.buf.rename, "Smart Rename") map("i", "<C-h>", vim.lsp.buf.signature_help, "Lsp signature help") map("n", "<leader>fm", vim.lsp.buf.format, "Format Document") end, }) end, },}
return M