Commit
This commit is contained in:
@@ -1,7 +1,37 @@
|
||||
require("lz.n").load({
|
||||
{
|
||||
"typst-preview.nvim",
|
||||
ft = "typst",
|
||||
after = function()
|
||||
-- Setup typst-preview
|
||||
require("typst-preview").setup({
|
||||
-- Optionally configure things here
|
||||
dependencies_bin = {
|
||||
-- For example, use tinymist as the LSP if that's what you are running
|
||||
},
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>tp", "<cmd>TypstPreviewToggle<cr>", { desc = "[T]ypst [P]review Toggle" })
|
||||
end,
|
||||
},
|
||||
{
|
||||
"lazydev.nvim",
|
||||
cmd = "LazyDev",
|
||||
ft = "lua",
|
||||
after = function()
|
||||
require("lazydev").setup({
|
||||
library = {
|
||||
{ words = { "nixCats", "settings" }, path = "nix-info" },
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-lspconfig",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
before = function()
|
||||
require("lz.n").trigger_load("lazydev.nvim")
|
||||
end,
|
||||
after = function()
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
group = vim.api.nvim_create_augroup("kickstart-lsp-attach", { clear = true }),
|
||||
@@ -15,18 +45,19 @@ require("lz.n").load({
|
||||
vim.keymap.set(mode, keys, func, { buffer = bufnr, desc = "LSP: " .. desc })
|
||||
end
|
||||
|
||||
-- Mappings (Standard LSP functions from lsp-defaults) [cite: 20-23]
|
||||
map("grn", vim.lsp.buf.rename, "[R]e[n]ame")
|
||||
map("gra", vim.lsp.buf.code_action, "[G]oto Code [A]ction", { "n", "x" })
|
||||
map("grD", vim.lsp.buf.declaration, "[G]oto [D]eclaration")
|
||||
-- Standard LSP functions
|
||||
map("<leader>rn", vim.lsp.buf.rename, "[R]e[n]ame")
|
||||
map("<leader>ca", vim.lsp.buf.code_action, "[C]ode [A]ction", { "n", "x" })
|
||||
map("gD", vim.lsp.buf.declaration, "[G]oto [D]eclaration")
|
||||
map("K", vim.lsp.buf.hover, "Hover Documentation")
|
||||
|
||||
-- Telescope Mappings
|
||||
map("grr", require("telescope.builtin").lsp_references, "[G]oto [R]eferences")
|
||||
map("gri", require("telescope.builtin").lsp_implementations, "[G]oto [I]mplementation")
|
||||
map("grd", require("telescope.builtin").lsp_definitions, "[G]oto [D]efinition")
|
||||
map("gO", require("telescope.builtin").lsp_document_symbols, "Open Document Symbols")
|
||||
map("gW", require("telescope.builtin").lsp_dynamic_workspace_symbols, "Open Workspace Symbols")
|
||||
map("grt", require("telescope.builtin").lsp_type_definitions, "[G]oto [T]ype Definition")
|
||||
map("gd", require("telescope.builtin").lsp_definitions, "[G]oto [D]efinition")
|
||||
map("gr", require("telescope.builtin").lsp_references, "[G]oto [R]eferences")
|
||||
map("gI", require("telescope.builtin").lsp_implementations, "[G]oto [I]mplementation")
|
||||
map("<leader>D", require("telescope.builtin").lsp_type_definitions, "Type [D]efinition")
|
||||
map("<leader>ds", require("telescope.builtin").lsp_document_symbols, "[D]ocument [S]ymbols")
|
||||
map("<leader>ws", require("telescope.builtin").lsp_dynamic_workspace_symbols, "[W]orkspace [S]ymbols")
|
||||
|
||||
-- Highlight references (Document Highlight)
|
||||
if client and client:supports_method("textDocument/documentHighlight", bufnr) then
|
||||
@@ -130,24 +161,6 @@ require("lz.n").load({
|
||||
vim.lsp.enable("rust_analyzer")
|
||||
|
||||
-- Python
|
||||
-- vim.lsp.config("basedpyright", {
|
||||
-- settings = {
|
||||
-- basedpyright = {
|
||||
-- analysis = {
|
||||
-- autoSearchPaths = true,
|
||||
-- useLibraryCodeForTypes = true,
|
||||
-- diagnosticMode = "openFilesOnly",
|
||||
-- typeCheckingMode = "recommended",
|
||||
-- inlayHints = {
|
||||
-- variableTypes = true,
|
||||
-- callArgumentNames = true,
|
||||
-- functionReturnTypes = true,
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- })
|
||||
-- vim.lsp.enable("basedpyright")
|
||||
vim.lsp.enable("ty")
|
||||
vim.lsp.enable("ruff")
|
||||
|
||||
@@ -163,4 +176,17 @@ require("lz.n").load({
|
||||
vim.lsp.enable("tinymist")
|
||||
end,
|
||||
},
|
||||
{
|
||||
"trouble.nvim",
|
||||
cmd = "Trouble",
|
||||
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)" },
|
||||
},
|
||||
after = function()
|
||||
require("trouble").setup({
|
||||
focus = true,
|
||||
})
|
||||
end,
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user