update: kitty, nvim and bashrc
This commit is contained in:
parent
a879e32d65
commit
c5570614f5
63 changed files with 7768 additions and 3669 deletions
|
|
@ -1,30 +1,42 @@
|
|||
local on_attach = require("configs.lsp.e-lspconfig").on_attach
|
||||
local on_init = require("configs.lsp.e-lspconfig").on_init
|
||||
local capabilities = require("configs.lsp.e-lspconfig").capabilities
|
||||
vim.lsp.config('*', {
|
||||
capabilities = require('cmp_nvim_lsp').default_capabilities(),
|
||||
on_init = function(client)
|
||||
if client:supports_method('textDocument/semanticTokens') then
|
||||
client.server_capabilities.semanticTokensProvider = nil
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
callback = function(args)
|
||||
local map = vim.keymap.set
|
||||
local function opts(desc)
|
||||
return { buffer = args.buf, desc = "LSP " .. desc }
|
||||
end
|
||||
|
||||
map("n", "gD", vim.lsp.buf.declaration, opts "Go to declaration")
|
||||
map("n", "gd", vim.lsp.buf.definition, opts "Go to definition")
|
||||
map("n", "<leader>wa", vim.lsp.buf.add_workspace_folder, opts "Add workspace folder")
|
||||
map("n", "<leader>wr", vim.lsp.buf.remove_workspace_folder, opts "Remove workspace folder")
|
||||
map("n", "<leader>wl", function()
|
||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||
end, opts "List workspace folders")
|
||||
map("n", "<leader>D", vim.lsp.buf.type_definition, opts "Go to type definition")
|
||||
end,
|
||||
})
|
||||
|
||||
-- C/C++
|
||||
vim.lsp.config('clangd', {
|
||||
on_attach = on_attach,
|
||||
on_init = on_init,
|
||||
capabilities = capabilities,
|
||||
cmd = {
|
||||
"clangd-22",
|
||||
"clangd",
|
||||
"--clang-tidy",
|
||||
},
|
||||
filetypes = { "c", "cpp", "h", "hpp", "objc", "objcpp" },
|
||||
root_markers = { '.git' },
|
||||
})
|
||||
vim.lsp.enable('clangd')
|
||||
|
||||
-- Go (gopls) lsp server
|
||||
-- Go
|
||||
vim.lsp.config('gopls', {
|
||||
on_attach = on_attach,
|
||||
on_init = on_init,
|
||||
capabilities = capabilities,
|
||||
cmd = { 'gopls' },
|
||||
filetypes = { 'go', 'gomod', 'gowork', 'gotmpl' },
|
||||
root_markers = { 'go.mod', '.git' },
|
||||
single_file_support = true,
|
||||
settings = {
|
||||
gopls = {
|
||||
completeUnimported = true,
|
||||
|
|
@ -37,32 +49,18 @@ vim.lsp.config('gopls', {
|
|||
},
|
||||
},
|
||||
})
|
||||
vim.lsp.enable('gopls')
|
||||
|
||||
-- PhP
|
||||
-- PHP
|
||||
vim.lsp.config('phpactor', {
|
||||
on_attach = on_attach,
|
||||
on_init = on_init,
|
||||
capabilities = capabilities,
|
||||
cmd = { 'phpactor', 'language-server' },
|
||||
filetypes = { 'php' },
|
||||
root_markers = { 'composer.json', '.git' },
|
||||
init_options = {
|
||||
["language_server_phpstan.enabled"] = false,
|
||||
["language_server_psalm.enabled"] = false,
|
||||
["language_server_mago.enabled"] = false,
|
||||
}
|
||||
})
|
||||
vim.lsp.enable('phpactor')
|
||||
|
||||
-- Lua
|
||||
vim.lsp.config('lua_ls', {
|
||||
on_attach = on_attach,
|
||||
on_init = on_init,
|
||||
capabilities = capabilities,
|
||||
cmd = { 'lua-language-server' },
|
||||
filetypes = { 'lua' },
|
||||
root_markers = { '.luarc.json', '.luarc.jsonc', '.git' },
|
||||
single_file_support = true,
|
||||
settings = {
|
||||
Lua = {
|
||||
telemetry = { enable = false },
|
||||
|
|
@ -78,34 +76,7 @@ vim.lsp.config('lua_ls', {
|
|||
},
|
||||
}
|
||||
})
|
||||
vim.lsp.enable('lua_ls')
|
||||
|
||||
-- Bash
|
||||
vim.lsp.config('bashls', {
|
||||
on_attach = on_attach,
|
||||
on_init = on_init,
|
||||
capabilities = capabilities,
|
||||
cmd = { 'bash-language-server', 'start' },
|
||||
filetypes = { 'sh', 'bash' },
|
||||
root_markers = { '.git' },
|
||||
single_file_support = true,
|
||||
})
|
||||
vim.lsp.enable('bashls')
|
||||
|
||||
-- Meson
|
||||
vim.lsp.config('meson_ls', {
|
||||
on_attach = on_attach,
|
||||
on_init = on_init,
|
||||
capabilities = capabilities,
|
||||
cmd = { 'mesonlsp' },
|
||||
filetypes = { 'meson' },
|
||||
root_markers = { 'meson.build', '.git' },
|
||||
single_file_support = true,
|
||||
settings = {}
|
||||
})
|
||||
vim.lsp.enable('meson_ls')
|
||||
|
||||
-- For all
|
||||
vim.diagnostic.config({
|
||||
virtual_text = false,
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue