init
This commit is contained in:
commit
1e2ca5a6fc
71 changed files with 3330 additions and 0 deletions
133
config/plugins/lsp/lsp.nix
Normal file
133
config/plugins/lsp/lsp.nix
Normal file
|
|
@ -0,0 +1,133 @@
|
|||
{
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
./lspkind.nix
|
||||
./conform-nvim.nix # fix lsp formatter issues
|
||||
|
||||
./servers/clangd.nix
|
||||
./servers/eslint.nix
|
||||
./servers/pyright.nix
|
||||
./servers/ruff.nix
|
||||
./servers/lua_ls.nix
|
||||
./servers/bashls.nix
|
||||
# ./servers/nil_ls.nix # replaced by nixd
|
||||
./servers/nixd.nix
|
||||
./servers/rust_analyzer.nix
|
||||
./servers/ts_ls.nix
|
||||
./servers/texlab/texlab.nix
|
||||
];
|
||||
plugins = {
|
||||
# # https://github.com/lukas-reineke/lsp-format.nvim/
|
||||
# # auto format on save
|
||||
# lsp-format = {
|
||||
# enable = false; # Enable it if you want lsp-format integration for none-ls
|
||||
# };
|
||||
# # formatter and diagnose
|
||||
# none-ls = {
|
||||
# enable = true;
|
||||
# # don't enable use lsp-format plugin
|
||||
# enableLspFormat = false;
|
||||
# sources = {
|
||||
# formatting = {
|
||||
# alejandra.enable = true;
|
||||
# stylua.enable = true;
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
lsp = {
|
||||
enable = true;
|
||||
capabilities = "offsetEncoding = 'utf-16'";
|
||||
keymaps = {
|
||||
silent = true;
|
||||
lspBuf = {
|
||||
# use require("conform").format() instead
|
||||
# "<space>lf" = {
|
||||
# action = "format";
|
||||
# desc = "Lsp format";
|
||||
# };
|
||||
gd = {
|
||||
action = "definition";
|
||||
desc = "Goto Definition";
|
||||
};
|
||||
gr = {
|
||||
action = "references";
|
||||
desc = "Goto References";
|
||||
};
|
||||
gD = {
|
||||
action = "declaration";
|
||||
desc = "Goto Declaration";
|
||||
};
|
||||
gI = {
|
||||
action = "implementation";
|
||||
desc = "Goto Implementation";
|
||||
};
|
||||
gT = {
|
||||
action = "type_definition";
|
||||
desc = "Type Definition";
|
||||
};
|
||||
K = {
|
||||
action = "hover";
|
||||
desc = "Hover";
|
||||
};
|
||||
"<leader>cw" = {
|
||||
action = "workspace_symbol";
|
||||
desc = "Workspace Symbol";
|
||||
};
|
||||
"<leader>cr" = {
|
||||
action = "rename";
|
||||
desc = "Rename";
|
||||
};
|
||||
"<leader>ca" = {
|
||||
action = "code_action";
|
||||
desc = "Code Action";
|
||||
};
|
||||
# "<C-k>" = {
|
||||
"<C-S-k>" = {
|
||||
action = "signature_help";
|
||||
desc = "Signature Help";
|
||||
};
|
||||
};
|
||||
diagnostic = {
|
||||
"<leader>cd" = {
|
||||
action = "open_float";
|
||||
desc = "Line Diagnostics";
|
||||
};
|
||||
"[d" = {
|
||||
action = "goto_next";
|
||||
desc = "Next Diagnostic";
|
||||
};
|
||||
"]d" = {
|
||||
action = "goto_prev";
|
||||
desc = "Previous Diagnostic";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
extraConfigLua = ''
|
||||
local _border = "rounded"
|
||||
|
||||
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(
|
||||
vim.lsp.handlers.hover, {
|
||||
border = _border
|
||||
}
|
||||
)
|
||||
|
||||
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(
|
||||
vim.lsp.handlers.signature_help, {
|
||||
border = _border
|
||||
}
|
||||
)
|
||||
|
||||
vim.diagnostic.config{
|
||||
float={border=_border}
|
||||
};
|
||||
|
||||
require('lspconfig.ui.windows').default_options = {
|
||||
border = _border
|
||||
}
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue