Update nvim lsp and plugins
This commit is contained in:
parent
104665a90a
commit
61aa9ba7ce
6 changed files with 29 additions and 35 deletions
6
dotfiles/.config/nvim/after/lsp/ty.lua
Normal file
6
dotfiles/.config/nvim/after/lsp/ty.lua
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
-- ~/.config/nvim/after/lsp/ty.lua
|
||||||
|
return {
|
||||||
|
cmd = { "ty", "server" },
|
||||||
|
filetypes = { "python" },
|
||||||
|
root_dir = vim.fs.root(0, { ".git/", "pyproject.toml" }),
|
||||||
|
}
|
|
@ -19,6 +19,10 @@ vim.keymap.set("n", "<leader>aa", require("actions-preview").code_actions)
|
||||||
-- Outline!!
|
-- Outline!!
|
||||||
vim.keymap.set("n", "<leader>o", "<cmd>Outline<CR>")
|
vim.keymap.set("n", "<leader>o", "<cmd>Outline<CR>")
|
||||||
|
|
||||||
|
|
||||||
-- Close all buffers
|
-- Close all buffers
|
||||||
vim.keymap.set("n", '<C-S-x>', "<cmd>bufdo bd<CR>")
|
vim.keymap.set("n", '<C-S-x>', "<cmd>bufdo bd<CR>")
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<M-r>", "<cmd>lua vim.lsp.buf.rename()()<CR>")
|
||||||
|
vim.keymap.set("n", "<leader>wl", "<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>")
|
||||||
|
vim.keymap.set("n", "<leader>wa", "<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>")
|
||||||
|
vim.keymap.set("n", "<leader>wr", "<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>")
|
||||||
|
|
|
@ -1,15 +1,6 @@
|
||||||
local autoformat_files = '*.py,*.rs,*.tf'
|
local autoformat_files = '*.py,*.rs,*.tf'
|
||||||
|
|
||||||
local common_on_attach = function(client, bufnr)
|
local common_on_attach = function(client, bufnr)
|
||||||
-- Mappings.
|
|
||||||
vim.keymap.set("n", "K", "<Cmd>lua vim.lsp.buf.hover()<CR>")
|
|
||||||
vim.keymap.set("n", "<C-k>", "<cmd>lua vim.lsp.buf.signature_help()<CR>")
|
|
||||||
vim.keymap.set("n", "<M-k>", "<cmd>lua vim.lsp.buf.type_definition()<CR>")
|
|
||||||
vim.keymap.set("n", "<M-r>", "<cmd>lua vim.lsp.buf.rename()()<CR>")
|
|
||||||
vim.keymap.set("n", "<leader>wl", "<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>")
|
|
||||||
vim.keymap.set("n", "<leader>wa", "<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>")
|
|
||||||
vim.keymap.set("n", "<leader>wr", "<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>")
|
|
||||||
|
|
||||||
-- Autoformat on save.
|
-- Autoformat on save.
|
||||||
if client.supports_method("textDocument/formatting") then
|
if client.supports_method("textDocument/formatting") then
|
||||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||||
|
@ -19,6 +10,7 @@ local common_on_attach = function(client, bufnr)
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Use vim's default coloring.
|
-- Use vim's default coloring.
|
||||||
client.server_capabilities.semanticTokensProvider = nil
|
client.server_capabilities.semanticTokensProvider = nil
|
||||||
for _, group in ipairs(vim.fn.getcompletion("@lsp", "highlight")) do
|
for _, group in ipairs(vim.fn.getcompletion("@lsp", "highlight")) do
|
||||||
|
@ -63,9 +55,7 @@ vim.g.rustaceanvim = function()
|
||||||
procMacro = {
|
procMacro = {
|
||||||
enable = true
|
enable = true
|
||||||
},
|
},
|
||||||
checkOnSave = {
|
checkOnSave = true,
|
||||||
command = "clippy",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
-- DAP configuration.
|
-- DAP configuration.
|
||||||
|
@ -75,33 +65,22 @@ vim.g.rustaceanvim = function()
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
local nvim_lsp = require('lspconfig')
|
|
||||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||||
|
|
||||||
|
vim.lsp.enable('ty')
|
||||||
|
|
||||||
-- LSPs
|
-- LSPs
|
||||||
local servers = {
|
local servers = {
|
||||||
"clangd",
|
"clangd",
|
||||||
"lua_ls",
|
"lua_ls",
|
||||||
"ocamllsp",
|
"ocamllsp",
|
||||||
"pyright",
|
|
||||||
"rnix",
|
"rnix",
|
||||||
"terraformls",
|
"terraformls",
|
||||||
"vimls",
|
"vimls",
|
||||||
}
|
}
|
||||||
for _, lsp in ipairs(servers) do
|
for _, lsp in ipairs(servers) do
|
||||||
nvim_lsp[lsp].setup { capabilities = capabilities, on_attach = common_on_attach }
|
vim.lsp.config(lsp, {
|
||||||
end
|
capabilities = capabilities,
|
||||||
|
on_attach = common_on_attach,
|
||||||
nvim_lsp.ruff.setup({
|
|
||||||
on_attach = function (client)
|
|
||||||
common_on_attach(client)
|
|
||||||
client.server_capabilities.renameProvider = false
|
|
||||||
client.server_capabilities.hoverProvider = false
|
|
||||||
end,
|
|
||||||
init_options = {
|
|
||||||
settings = {
|
|
||||||
-- Any extra CLI arguments for `ruff` go here.
|
|
||||||
args = {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
end
|
||||||
|
|
|
@ -16,7 +16,7 @@ require("catppuccin").setup({
|
||||||
TelescopeNormal = { bg = "#fafafa" },
|
TelescopeNormal = { bg = "#fafafa" },
|
||||||
TelescopePromptNormal = { bg = colors.surface1 },
|
TelescopePromptNormal = { bg = colors.surface1 },
|
||||||
TelescopePromptBorder = { bg = colors.surface1, fg = colors.surface1 },
|
TelescopePromptBorder = { bg = colors.surface1, fg = colors.surface1 },
|
||||||
CursorLine = { bg = colors.text },
|
CursorLine = { bg = colors.surface2 },
|
||||||
NvimTreeWinSeparator = { fg = colors.text },
|
NvimTreeWinSeparator = { fg = colors.text },
|
||||||
NvimTreeGitNew = { fg = colors.green },
|
NvimTreeGitNew = { fg = colors.green },
|
||||||
NvimTreeGitDirty = { fg = colors.yellow },
|
NvimTreeGitDirty = { fg = colors.yellow },
|
||||||
|
@ -100,6 +100,9 @@ require("catppuccin").setup({
|
||||||
|
|
||||||
DiagnosticUnnecessary = { link = "" },
|
DiagnosticUnnecessary = { link = "" },
|
||||||
|
|
||||||
|
Pmenu = { fg = colors.text },
|
||||||
|
PmenuSel = { bg = colors.overlay0 },
|
||||||
|
|
||||||
--["@conceal.checked"] = { fg = colors.teal },
|
--["@conceal.checked"] = { fg = colors.teal },
|
||||||
--["@none"] = { link = "Normal" },
|
--["@none"] = { link = "Normal" },
|
||||||
--["@field"] = { fg = colors.blue },
|
--["@field"] = { fg = colors.blue },
|
||||||
|
|
|
@ -24,9 +24,11 @@ neogit.setup {
|
||||||
graph_style = "ascii",
|
graph_style = "ascii",
|
||||||
-- Used to generate URL's for branch popup action "pull request".
|
-- Used to generate URL's for branch popup action "pull request".
|
||||||
git_services = {
|
git_services = {
|
||||||
["github.com"] = "https://github.com/${owner}/${repository}/compare/${branch_name}?expand=1",
|
["github.com"] = {
|
||||||
["bitbucket.org"] = "https://bitbucket.org/${owner}/${repository}/pull-requests/new?source=${branch_name}&t=1",
|
pull_request = "https://github.com/${owner}/${repository}/compare/${branch_name}?expand=1",
|
||||||
["gitlab.com"] = "https://gitlab.com/${owner}/${repository}/merge_requests/new?merge_request[source_branch]=${branch_name}",
|
commit = "https://github.com/${owner}/${repository}/commit/${oid}",
|
||||||
|
tree = "https://${host}/${owner}/${repository}/tree/${branch_name}",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
-- Allows a different telescope sorter. Defaults to 'fuzzy_with_index_bias'. The example below will use the native fzf
|
-- Allows a different telescope sorter. Defaults to 'fuzzy_with_index_bias'. The example below will use the native fzf
|
||||||
-- sorter instead. By default, this function returns `nil`.
|
-- sorter instead. By default, this function returns `nil`.
|
||||||
|
|
|
@ -53,7 +53,7 @@ require('oil').setup({
|
||||||
-- Skip the confirmation popup for simple operations
|
-- Skip the confirmation popup for simple operations
|
||||||
skip_confirm_for_simple_edits = false,
|
skip_confirm_for_simple_edits = false,
|
||||||
-- Change this to customize the command used when deleting to trash
|
-- Change this to customize the command used when deleting to trash
|
||||||
trash_command = "trash-put",
|
-- trash_command = "trash-put",
|
||||||
-- Selecting a new/moved/renamed file or directory will prompt you to save changes first
|
-- Selecting a new/moved/renamed file or directory will prompt you to save changes first
|
||||||
prompt_save_on_select_new_entry = true,
|
prompt_save_on_select_new_entry = true,
|
||||||
-- Keymaps in oil buffer. Can be any value that `vim.keymap.set` accepts OR a table of keymap
|
-- Keymaps in oil buffer. Can be any value that `vim.keymap.set` accepts OR a table of keymap
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue