2024-05-07 22:49:00 -04:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
nvim-theme-src,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
inherit (lib) fileContents optionals;
|
2024-08-31 19:16:06 -04:00
|
|
|
inherit (config.vars) neovimIde;
|
2024-05-07 22:49:00 -04:00
|
|
|
in {
|
|
|
|
programs = {
|
|
|
|
neovim = {
|
2024-08-31 19:16:06 -04:00
|
|
|
extraPackages = builtins.attrValues {
|
|
|
|
inherit (pkgs) bat;
|
|
|
|
};
|
2024-05-07 22:49:00 -04:00
|
|
|
|
|
|
|
plugins =
|
|
|
|
[
|
|
|
|
{
|
2024-08-31 19:16:06 -04:00
|
|
|
plugin = pkgs.vimPlugins.dracula-nvim.overrideAttrs {
|
2024-05-07 22:49:00 -04:00
|
|
|
src = nvim-theme-src;
|
|
|
|
};
|
|
|
|
type = "lua";
|
|
|
|
config =
|
2024-06-09 22:49:30 -04:00
|
|
|
# lua
|
2024-05-07 22:49:00 -04:00
|
|
|
''
|
|
|
|
-- set dot icon in place of trailing whitespaces
|
2024-05-08 20:26:57 -04:00
|
|
|
vim.opt.listchars = {
|
|
|
|
tab = '→ ',
|
|
|
|
trail = '•',
|
|
|
|
extends = '⟩',
|
|
|
|
precedes = '⟨',
|
|
|
|
nbsp = '␣',
|
|
|
|
};
|
|
|
|
vim.opt.list = true;
|
2024-05-07 22:49:00 -04:00
|
|
|
|
|
|
|
-- Add visual indicator for trailing whitespaces
|
2024-05-08 20:26:57 -04:00
|
|
|
vim.opt.fillchars = { eob = " " };
|
|
|
|
vim.fn.matchadd('errorMsg', [[\s\+$]]);
|
2024-05-07 22:49:00 -04:00
|
|
|
|
2024-05-08 20:26:57 -04:00
|
|
|
vim.cmd.colorscheme('dracula');
|
2024-05-07 22:49:00 -04:00
|
|
|
'';
|
|
|
|
}
|
|
|
|
{
|
2024-08-31 19:16:06 -04:00
|
|
|
plugin = pkgs.vimPlugins.indent-blankline-nvim;
|
2024-05-07 22:49:00 -04:00
|
|
|
type = "lua";
|
2024-05-08 20:26:57 -04:00
|
|
|
config =
|
2024-06-09 22:49:30 -04:00
|
|
|
# lua
|
2024-05-08 20:26:57 -04:00
|
|
|
''
|
2024-06-09 22:49:30 -04:00
|
|
|
--
|
2024-05-08 20:26:57 -04:00
|
|
|
local highlight = {
|
|
|
|
"RainbowRed",
|
|
|
|
"RainbowYellow",
|
|
|
|
"RainbowBlue",
|
|
|
|
"RainbowOrange",
|
|
|
|
"RainbowGreen",
|
|
|
|
"RainbowViolet",
|
|
|
|
"RainbowCyan",
|
|
|
|
};
|
|
|
|
|
|
|
|
local hooks = require('ibl.hooks');
|
|
|
|
hooks.register(hooks.type.HIGHLIGHT_SETUP, function()
|
2024-05-16 11:24:22 -04:00
|
|
|
vim.api.nvim_set_hl(0, "RainbowRed", { fg = "#E06C75" });
|
|
|
|
vim.api.nvim_set_hl(0, "RainbowYellow", { fg = "#E5C07B" });
|
|
|
|
vim.api.nvim_set_hl(0, "RainbowBlue", { fg = "#61AFEF" });
|
|
|
|
vim.api.nvim_set_hl(0, "RainbowOrange", { fg = "#D19A66" });
|
|
|
|
vim.api.nvim_set_hl(0, "RainbowGreen", { fg = "#98C379" });
|
|
|
|
vim.api.nvim_set_hl(0, "RainbowViolet", { fg = "#C678DD" });
|
|
|
|
vim.api.nvim_set_hl(0, "RainbowCyan", { fg = "#56B6C2" });
|
2024-05-08 20:26:57 -04:00
|
|
|
end);
|
|
|
|
|
|
|
|
require('ibl').setup({
|
|
|
|
indent = {
|
|
|
|
highlight = highlight,
|
|
|
|
char = "▏",
|
|
|
|
},
|
|
|
|
});
|
|
|
|
'';
|
2024-05-07 22:49:00 -04:00
|
|
|
}
|
2024-05-16 11:24:22 -04:00
|
|
|
|
|
|
|
# Deps of heirline config
|
2024-08-31 19:16:06 -04:00
|
|
|
pkgs.vimPlugins.nvim-web-devicons
|
2024-05-07 22:49:00 -04:00
|
|
|
{
|
2024-08-31 19:16:06 -04:00
|
|
|
plugin = pkgs.vimPlugins.heirline-nvim;
|
2024-05-07 22:49:00 -04:00
|
|
|
type = "lua";
|
2024-05-16 11:24:22 -04:00
|
|
|
config = fileContents ./plugins/heirline.lua;
|
2024-05-07 22:49:00 -04:00
|
|
|
}
|
2024-05-08 20:26:57 -04:00
|
|
|
]
|
|
|
|
++ optionals neovimIde [
|
2024-05-07 22:49:00 -04:00
|
|
|
{
|
2024-08-31 19:16:06 -04:00
|
|
|
plugin = pkgs.vimPlugins.neo-tree-nvim;
|
2024-05-08 20:26:57 -04:00
|
|
|
type = "lua";
|
2024-05-16 11:24:22 -04:00
|
|
|
config = fileContents ./plugins/neotree.lua;
|
2024-05-08 20:26:57 -04:00
|
|
|
}
|
|
|
|
{
|
2024-08-31 19:16:06 -04:00
|
|
|
plugin = pkgs.vimPlugins.codewindow-nvim;
|
2024-05-08 20:26:57 -04:00
|
|
|
type = "lua";
|
|
|
|
config =
|
2024-06-09 22:49:30 -04:00
|
|
|
# lua
|
2024-05-08 20:26:57 -04:00
|
|
|
''
|
2024-06-09 22:49:30 -04:00
|
|
|
--
|
2024-05-08 20:26:57 -04:00
|
|
|
local codewindow = require('codewindow');
|
|
|
|
|
|
|
|
codewindow.setup({
|
|
|
|
auto_enable = false,
|
|
|
|
minimap_width = 8,
|
|
|
|
relative = 'editor',
|
|
|
|
window_border = 'none',
|
|
|
|
exclude_filetypes = { 'help' },
|
|
|
|
});
|
2024-05-07 22:49:00 -04:00
|
|
|
|
2024-05-08 20:26:57 -04:00
|
|
|
vim.api.nvim_create_autocmd({ 'VimEnter', 'VimResized' }, {
|
|
|
|
pattern = '*',
|
|
|
|
callback = function()
|
|
|
|
if vim.api.nvim_win_get_width(0) < 88 then
|
|
|
|
codewindow.close_minimap();
|
|
|
|
else
|
|
|
|
codewindow.open_minimap();
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
});
|
|
|
|
'';
|
|
|
|
}
|
|
|
|
{
|
2024-08-31 19:16:06 -04:00
|
|
|
plugin = pkgs.vimPlugins.transparent-nvim;
|
2024-05-08 20:26:57 -04:00
|
|
|
type = "lua";
|
|
|
|
config =
|
2024-06-09 22:49:30 -04:00
|
|
|
# lua
|
2024-05-08 20:26:57 -04:00
|
|
|
''
|
2024-06-09 22:49:30 -04:00
|
|
|
require('transparent').setup({
|
2024-05-08 20:26:57 -04:00
|
|
|
groups = {
|
2024-06-09 22:49:30 -04:00
|
|
|
'Normal',
|
|
|
|
'NormalNC',
|
|
|
|
'Comment',
|
|
|
|
'Constant',
|
|
|
|
'Special',
|
|
|
|
'Identifier',
|
|
|
|
'Statement',
|
|
|
|
'PreProc',
|
|
|
|
'Type',
|
|
|
|
'Underlined',
|
|
|
|
'Todo',
|
|
|
|
'String',
|
|
|
|
'Function',
|
|
|
|
'Conditional',
|
|
|
|
'Repeat',
|
|
|
|
'Operator',
|
|
|
|
'Structure',
|
|
|
|
'LineNr',
|
|
|
|
'NonText',
|
|
|
|
'SignColumn',
|
|
|
|
'CursorLine',
|
|
|
|
'CursorLineNr',
|
|
|
|
'StatusLine',
|
|
|
|
'StatusLineNC',
|
|
|
|
'EndOfBuffer',
|
2024-05-08 20:26:57 -04:00
|
|
|
},
|
|
|
|
extra_groups = {},
|
|
|
|
exclude_groups = {},
|
|
|
|
});
|
|
|
|
'';
|
2024-05-07 22:49:00 -04:00
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|