Massive Updates
This commit is contained in:
1 parent
007c2f8edb
commit
5f37d6c0ec
109 files changed
+7670
-3972
No files matched your search
@@ -1,23 +1,5 @@
|
||||
local nvim_0_10 = vim.fn.has("nvim-0.10")
|
||||
|
||||
local function toggle_diag_virtext()
|
||||
local virtual_text = { -- Default virtual_text opts from Lazy.Nvim
|
||||
spacing = 4,
|
||||
source = "if_many",
|
||||
prefix = "●",
|
||||
}
|
||||
local config = vim.diagnostic.config()
|
||||
if type(config.virtual_text) == "table" then
|
||||
config.virtual_text = false
|
||||
vim.diagnostic.config(config)
|
||||
vim.notify("Disable diagnostics virtualtext", 5, { title = "Diagnostics" })
|
||||
else
|
||||
config.virtual_text = virtual_text
|
||||
vim.diagnostic.config(config)
|
||||
vim.notify("Enabled diagnostics virtualtext", 5, { title = "Diagnostics" })
|
||||
end
|
||||
end
|
||||
|
||||
return {
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
@@ -26,19 +8,19 @@ return {
|
||||
|
||||
keys[#keys + 1] = { "<leader>cl", false }
|
||||
keys[#keys + 1] = { "<leader>cil", "<cmd>LspInfo<cr>", desc = "Lsp" }
|
||||
keys[#keys + 1] = { "<leader>uv", toggle_diag_virtext, desc = "Toggle Diagnostic VirtualText" }
|
||||
|
||||
keys[#keys + 1] = {
|
||||
"<leader>cll",
|
||||
"<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<cr>",
|
||||
desc = "List Folders",
|
||||
}
|
||||
|
||||
keys[#keys + 1] = { "<leader>clh", vim.lsp.codelens.run, desc = "Run Code Lens" }
|
||||
keys[#keys + 1] = { "<leader>cld", vim.lsp.codelens.refresh, desc = "Refresh Code Lens" }
|
||||
keys[#keys + 1] = { "<leader>clr", "<cmd>LspRestart<cr>", desc = "Restart Lsp" }
|
||||
keys[#keys + 1] = { "<leader>cls", "<cmd>LspStart<cr>", desc = "Start Lsp" }
|
||||
keys[#keys + 1] = { "<leader>clS", "<cmd>LspStop<cr>", desc = "Stop Lsp" }
|
||||
|
||||
-- stylua: ignore
|
||||
keys[#keys + 1] = { "<leader>cll", "<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<cr>", desc = "List Workspace" }
|
||||
|
||||
-- stylua: ignore
|
||||
keys[#keys + 1] = { "<leader>clr", "<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>", desc = "Remove workspace" }
|
||||
keys[#keys + 1] = { "<leader>cla", "<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>", desc = "Add workspace" }
|
||||
|
||||
keys[#keys + 1] = { "<leader>clh", vim.lsp.codelens.run, desc = "Run Code Lens" }
|
||||
keys[#keys + 1] = { "<leader>cld", vim.lsp.codelens.refresh, desc = "Refresh Code Lens" }
|
||||
end,
|
||||
opts = {
|
||||
-- options for vim.diagnostic.config()
|
||||
@@ -70,81 +52,19 @@ return {
|
||||
enabled = nvim_0_10,
|
||||
},
|
||||
servers = {
|
||||
-- typos_lsp = {
|
||||
-- settings = {
|
||||
-- diagnosticSeverity = "Warning", TODO: Look at this
|
||||
-- },
|
||||
-- },
|
||||
lua_ls = {
|
||||
settings = {
|
||||
Lua = {
|
||||
hint = {
|
||||
enable = true,
|
||||
setType = true,
|
||||
enable = nvim_0_10,
|
||||
setType = nvim_0_10,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
tsserver = {
|
||||
init_options = {
|
||||
preferences = {
|
||||
disableSuggestions = true,
|
||||
},
|
||||
},
|
||||
settings = {
|
||||
typescript = {
|
||||
format = {
|
||||
indentSize = vim.o.shiftwidth,
|
||||
convertTabsToSpaces = vim.o.expandtab,
|
||||
tabSize = vim.o.tabstop,
|
||||
},
|
||||
inlayHints = {
|
||||
includeInlayParameterNameHints = "all",
|
||||
includeInlayParameterNameHintsWhenArgumentMatchesName = true,
|
||||
includeInlayFunctionParameterTypeHints = true,
|
||||
includeInlayVariableTypeHints = true,
|
||||
includeInlayVariableTypeHintsWhenTypeMatchesName = true,
|
||||
includeInlayPropertyDeclarationTypeHints = true,
|
||||
includeInlayFunctionLikeReturnTypeHints = true,
|
||||
includeInlayEnumMemberValueHints = true,
|
||||
},
|
||||
},
|
||||
javascript = {
|
||||
format = {
|
||||
indentSize = vim.o.shiftwidth,
|
||||
convertTabsToSpaces = vim.o.expandtab,
|
||||
tabSize = vim.o.tabstop,
|
||||
},
|
||||
inlayHints = {
|
||||
includeInlayParameterNameHints = "all",
|
||||
includeInlayParameterNameHintsWhenArgumentMatchesName = true,
|
||||
includeInlayFunctionParameterTypeHints = true,
|
||||
includeInlayVariableTypeHints = true,
|
||||
includeInlayVariableTypeHintsWhenTypeMatchesName = true,
|
||||
includeInlayPropertyDeclarationTypeHints = true,
|
||||
includeInlayFunctionLikeReturnTypeHints = true,
|
||||
includeInlayEnumMemberValueHints = true,
|
||||
},
|
||||
},
|
||||
completions = {
|
||||
completeFunctionCalls = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"simrat39/rust-tools.nvim",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
opts.tools = {
|
||||
inlay_hints = {
|
||||
auto = not nvim_0_10,
|
||||
},
|
||||
}
|
||||
end,
|
||||
},
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
opts = {
|
||||
|
||||
Reference in new issue
Block a user