feat: cleanup

nixos
Moritz Böhme 2024-04-21 11:21:46 +02:00
parent b09d30959b
commit 54e55f4b6d
Signed by: moritz
GPG Key ID: 970C6E89EB0547A9
4 changed files with 7 additions and 173 deletions

View File

@ -7,65 +7,18 @@ with builtins;
plugin = oil-nvim; plugin = oil-nvim;
lazy = false; lazy = false;
opts = { }; opts = { };
dependencies = [ dependencies = [{ plugin = nvim-web-devicons; }];
{ plugin = which-key-nvim; } }
{ plugin = nvim-web-devicons; } {
]; plugin = lualine-nvim;
opts = { };
dependencies = [{ plugin = nvim-web-devicons; }];
} }
{ {
plugin = mini-nvim; plugin = mini-nvim;
lazy = false; lazy = false;
conf = readFile ./lua/mini-nvim.lua; conf = readFile ./lua/mini-nvim.lua;
} }
{
plugin = trouble-nvim;
cmd = [ "TodoTelescope" ];
keys = [
{
key = "<leader>cD";
cmd = "<cmd>TroubleToggle document_diagnostics<cr>";
desc = "Document Diagnostics (Trouble)";
}
{
key = "<leader>cW";
cmd = "<cmd>TroubleToggle workspace_diagnostics<cr>";
desc = "Workspace Diagnostics (Trouble)";
}
{ key = "<leader>cl"; cmd = "<cmd>TroubleToggle loclist<cr>"; desc = "Location List (Trouble)"; }
{ key = "<leader>cq"; cmd = "<cmd>TroubleToggle quickfix<cr>"; desc = "Quickfix List (Trouble)"; }
{ key = "<leader>ft"; cmd = "<cmd>TodoTelescope<cr>"; desc = "Todo"; }
{
key = "[q";
func = /* lua */ ''
function()
if require("trouble").is_open() then
require("trouble").previous({ skip_groups = true, jump = true })
else
vim.cmd.cprev()
end
end
'';
desc = "Previous trouble/quickfix item";
}
{
key = "]q";
func = /* lua */ ''
function()
if require("trouble").is_open() then
require("trouble").next({ skip_groups = true, jump = true })
else
vim.cmd.cnext()
end
end
'';
desc = "Next trouble/quickfix item";
}
];
opts = { };
dependencies = [
{ plugin = nvim-web-devicons; }
];
}
{ {
plugin = nvim-cmp; plugin = nvim-cmp;
keys = [ keys = [
@ -106,6 +59,7 @@ with builtins;
conf = readFile ./lua/nvim-lspconfig.lua; conf = readFile ./lua/nvim-lspconfig.lua;
dependencies = [ dependencies = [
{ {
# TODO: add all required tools to neovim or silence warnings
plugin = pkgs.vimPlugins.null-ls-nvim.overrideAttrs (_: { plugin = pkgs.vimPlugins.null-ls-nvim.overrideAttrs (_: {
version = lib.my.mkVersionInput inputs.none-ls-nvim; version = lib.my.mkVersionInput inputs.none-ls-nvim;
src = inputs.none-ls-nvim; src = inputs.none-ls-nvim;
@ -118,17 +72,6 @@ with builtins;
} }
{ plugin = which-key-nvim; } { plugin = which-key-nvim; }
{ plugin = lsp_lines-nvim; } { plugin = lsp_lines-nvim; }
{
plugin = nvim-ufo;
conf = readFile ./lua/nvim-ufo.lua;
dependencies = [
{ plugin = promise-async; }
];
}
{
plugin = neodev-nvim;
conf = readFile ./lua/neodev-nvim.lua;
}
{ {
plugin = inc-rename-nvim; plugin = inc-rename-nvim;
opts = { opts = {
@ -236,39 +179,6 @@ with builtins;
event = [ "BufReadPost" "BufNewFile" ]; event = [ "BufReadPost" "BufNewFile" ];
opts = { }; opts = { };
} }
{
plugin = zen-mode-nvim;
keys = [
{ key = "<leader>tz"; cmd = "<cmd>ZenMode<cr>"; desc = "Zen mode"; }
];
conf = /* lua */ ''
require("zen-mode").setup({
plugins = {
tmux = {
enabled = true,
},
},
})
'';
dependencies = [
{
plugin = twilight-nvim;
conf = /* lua */ ''
require("twilight").setup({
context = 20,
expand = { -- for treesitter, we we always try to expand to the top-most ancestor with these types
"function",
"function_definition",
"if_statement",
"method",
"method_definition",
"table",
},
})
'';
}
];
}
{ {
plugin = conform-nvim; plugin = conform-nvim;
keys = [ keys = [

View File

@ -1,47 +1 @@
require("mini.align").setup() require("mini.align").setup()
require("mini.move").setup()
require("mini.statusline").setup({
content = {
active = function()
local mode, mode_hl = MiniStatusline.section_mode({ trunc_width = 120 })
local git = MiniStatusline.section_git({ trunc_width = 75 })
local diagnostics = MiniStatusline.section_diagnostics({ trunc_width = 75 })
local filename = MiniStatusline.section_filename({ trunc_width = 140 })
local fileinfo = MiniStatusline.section_fileinfo({ trunc_width = 120 })
local location = MiniStatusline.section_location({ trunc_width = 75 })
local mode_hl_inverse = mode_hl .. "Inverse"
-- Usage of `MiniStatusline.combine_groups()` ensures highlighting and
-- correct padding with spaces between groups (accounts for 'missing'
-- sections, etc.)
return MiniStatusline.combine_groups({
{ hl = mode_hl_inverse, strings = {} },
"",
{ hl = mode_hl, strings = { mode } },
{ hl = "MiniStatuslineDevinfo", strings = { git, diagnostics } },
"%<", -- Mark general truncate point
{ hl = "MiniStatuslineFilename", strings = { filename } },
"%=", -- End left alignment
{ hl = "MiniStatuslineFileinfo", strings = { fileinfo } },
{ hl = mode_hl, strings = { location } },
{ hl = mode_hl_inverse, strings = {} },
"",
})
end,
},
})
local MiniStatuslineModes = {
"MiniStatuslineModeInsert",
"MiniStatuslineModeNormal",
"MiniStatuslineModeReplace",
"MiniStatuslineModeVisual",
"MiniStatuslineModeCommand",
"MiniStatuslineModeOther",
}
for _, mode_hl in ipairs(MiniStatuslineModes) do
local hl_table = vim.api.nvim_get_hl(0, { name = mode_hl })
local fg = hl_table.fg
hl_table.fg = hl_table.bg
hl_table.bg = fg
vim.api.nvim_set_hl(0, mode_hl .. "Inverse", hl_table)
end

View File

@ -65,15 +65,5 @@ with builtins;
]; ];
} }
) )
{
plugin = nvim-treesitter-textsubjects;
event = [ "BufReadPost" "BufNewFile" ];
conf = readFile ./lua/nvim-treesitter-textsubjects.lua;
}
{
plugin = nvim-treesitter-context;
event = [ "BufReadPost" "BufNewFile" ];
opts = { };
}
]; ];
} }

View File

@ -20,26 +20,6 @@ with builtins;
dependencies = [{ plugin = plenary-nvim; }]; dependencies = [{ plugin = plenary-nvim; }];
opts = { }; opts = { };
} }
{
plugin = pkgs.vimPlugins.statuscol-nvim.overrideAttrs (_: {
version = lib.my.mkVersionInput inputs.statuscol-nvim;
src = inputs.statuscol-nvim;
});
event = [ "VeryLazy" ];
conf = readFile ./lua/statuscol-nvim.lua;
}
{
plugin = pkgs.vimUtils.buildVimPlugin {
pname = "smartcolumn-nvim";
version = lib.my.mkVersionInput inputs.smartcolumn-nvim;
src = inputs.smartcolumn-nvim;
};
event = [ "BufReadPost" "BufNewFile" ];
opts = {
colorcolumn = "120";
disabled_filetypes = [ "help" "text" "markdown" "dashboard" ];
};
}
{ {
plugin = dressing-nvim; plugin = dressing-nvim;
event = [ "VeryLazy" ]; event = [ "VeryLazy" ];