add lsp, update neo-tree config and add bufferline
This commit is contained in:
parent
aa3c28cd64
commit
8a113cfce8
6 changed files with 270 additions and 7 deletions
|
|
@ -12,6 +12,14 @@
|
|||
./plugins/editor/neo-tree.nix
|
||||
./plugins/editor/treesitter.nix
|
||||
|
||||
# UI plugins
|
||||
./plugins/ui/bufferline.nix
|
||||
|
||||
# LSP
|
||||
./plugins/lsp/lsp.nix
|
||||
./plugins/lsp/conform.nix
|
||||
./plugins/lsp/none-ls.nix
|
||||
|
||||
# Git
|
||||
./plugins/git/lazygit.nix
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
{ pkgs, ... }: {
|
||||
|
||||
{
|
||||
plugins.neo-tree = {
|
||||
enable = true;
|
||||
sources = [ "filesystem" "buffers" "git_status" "document_symbols" ];
|
||||
addBlankLineAtTop = true;
|
||||
sources = ["filesystem" "buffers" "git_status" "document_symbols"];
|
||||
addBlankLineAtTop = false;
|
||||
|
||||
filesystem = {
|
||||
bindToCwd = false;
|
||||
|
|
@ -17,5 +16,4 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
23
config/plugins/lsp/conform.nix
Normal file
23
config/plugins/lsp/conform.nix
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
plugins.conform-nvim = {
|
||||
enable = true;
|
||||
formatOnSave = {
|
||||
lspFallback = true;
|
||||
timeoutMs = 500;
|
||||
};
|
||||
notifyOnError = true;
|
||||
formattersByFt = {
|
||||
liquidsoap = ["liquidsoap-prettier"];
|
||||
html = [["prettierd" "prettier"]];
|
||||
css = [["prettierd" "prettier"]];
|
||||
javascript = [["prettierd" "prettier"]];
|
||||
typescript = [["prettierd" "prettier"]];
|
||||
python = ["black"];
|
||||
lua = ["stylua"];
|
||||
nix = ["alejandra"];
|
||||
markdown = [["prettierd" "prettier"]];
|
||||
yaml = ["yamllint" "yamlfmt"];
|
||||
terraform = ["terraform-fmt"];
|
||||
};
|
||||
};
|
||||
}
|
||||
94
config/plugins/lsp/lsp.nix
Normal file
94
config/plugins/lsp/lsp.nix
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
{
|
||||
plugins = {
|
||||
lsp-format = {enable = true;};
|
||||
lsp = {
|
||||
enable = true;
|
||||
servers = {
|
||||
html = {enable = true;};
|
||||
lua-ls = {enable = true;};
|
||||
nil_ls = {enable = true;};
|
||||
marksman = {enable = true;};
|
||||
pyright = {enable = true;};
|
||||
gopls = {enable = true;};
|
||||
terraformls = {enable = true;};
|
||||
tsserver = {enable = true;};
|
||||
ansiblels = {enable = true;};
|
||||
yamlls = {enable = true;};
|
||||
};
|
||||
keymaps = {
|
||||
silent = true;
|
||||
lspBuf = {
|
||||
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";
|
||||
};
|
||||
};
|
||||
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
|
||||
}
|
||||
'';
|
||||
}
|
||||
50
config/plugins/lsp/none-ls.nix
Normal file
50
config/plugins/lsp/none-ls.nix
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
{
|
||||
plugins.none-ls = {
|
||||
enable = true;
|
||||
enableLspFormat = true;
|
||||
updateInInsert = false;
|
||||
sources = {
|
||||
code_actions = {
|
||||
gitsigns.enable = true;
|
||||
statix.enable = true;
|
||||
};
|
||||
diagnostics = {
|
||||
statix.enable = true;
|
||||
yamllint.enable = true;
|
||||
};
|
||||
formatting = {
|
||||
alejandra.enable = true;
|
||||
black = {
|
||||
enable = true;
|
||||
withArgs = ''
|
||||
{
|
||||
extra_args = { "--fast" },
|
||||
}
|
||||
'';
|
||||
};
|
||||
prettier = {
|
||||
enable = true;
|
||||
disableTsServerFormatter = true;
|
||||
withArgs = ''
|
||||
{
|
||||
extra_args = { "--no-semi", "--single-quote" },
|
||||
}
|
||||
'';
|
||||
};
|
||||
stylua.enable = true;
|
||||
yamlfmt.enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
keymaps = [
|
||||
{
|
||||
mode = ["n" "v"];
|
||||
key = "<leader>cf";
|
||||
action = "<cmd>lua vim.lsp.buf.format()<cr>";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Format";
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
90
config/plugins/ui/bufferline.nix
Normal file
90
config/plugins/ui/bufferline.nix
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
{ config, ... }: {
|
||||
|
||||
plugins = {
|
||||
bufferline = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
keymaps = [
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>]b";
|
||||
action = "<cmd>BufferLineCycleNext<cr>";
|
||||
options = {
|
||||
desc = "Cycle to next buffer";
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>[b";
|
||||
action = "<cmd>BufferLineCyclePrev<cr>";
|
||||
options = {
|
||||
desc = "Cycle to previous buffer";
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "<S-l>";
|
||||
action = "<cmd>BufferLineCycleNext<cr>";
|
||||
options = {
|
||||
desc = "Cycle to next buffer";
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "<S-h>";
|
||||
action = "<cmd>BufferLineCyclePrev<cr>";
|
||||
options = {
|
||||
desc = "Cycle to previous buffer";
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>bd";
|
||||
action = "<cmd>bdelete<cr>";
|
||||
options = {
|
||||
desc = "Delete buffer";
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>bl";
|
||||
action = "<cmd>BufferLineCloseLeft<cr>";
|
||||
options = {
|
||||
desc = "Delete buffers to the left";
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>bo";
|
||||
action = "<cmd>BufferLineCloseOthers<cr>";
|
||||
options = {
|
||||
desc = "Delete other buffers";
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>bp";
|
||||
action = "<cmd>BufferLineTogglePin<cr>";
|
||||
options = {
|
||||
desc = "Toggle pin";
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>bP";
|
||||
action = "<Cmd>BufferLineGroupClose ungrouped<CR>";
|
||||
options = {
|
||||
desc = "Delete non-pinned buffers";
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue