2024-11-22 02:48:41 -05:00
|
|
|
self: {
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
inherit (self.inputs) nvim-theme-src;
|
2024-12-21 23:34:10 -05:00
|
|
|
inherit (lib) attrValues fileContents mkIf;
|
2024-11-22 02:48:41 -05:00
|
|
|
|
|
|
|
cfg = config.programs.neovim;
|
|
|
|
in {
|
2024-12-21 21:49:59 -05:00
|
|
|
imports = [./treesitter.nix];
|
|
|
|
|
2024-12-21 23:34:10 -05:00
|
|
|
config = mkIf cfg.enable {
|
|
|
|
programs.neovim = {
|
|
|
|
extraPackages = attrValues {
|
|
|
|
inherit (pkgs) bat;
|
|
|
|
};
|
2024-11-22 02:48:41 -05:00
|
|
|
|
2024-12-21 23:34:10 -05:00
|
|
|
plugins = [
|
2024-11-22 02:48:41 -05:00
|
|
|
{
|
|
|
|
plugin = pkgs.vimPlugins.dracula-nvim.overrideAttrs {
|
|
|
|
src = nvim-theme-src;
|
|
|
|
};
|
|
|
|
type = "lua";
|
|
|
|
config =
|
|
|
|
# lua
|
|
|
|
''
|
|
|
|
-- set dot icon in place of trailing whitespaces
|
|
|
|
vim.opt.listchars = {
|
|
|
|
tab = '→ ',
|
|
|
|
trail = '•',
|
|
|
|
extends = '⟩',
|
|
|
|
precedes = '⟨',
|
|
|
|
nbsp = '␣',
|
|
|
|
};
|
|
|
|
vim.opt.list = true;
|
|
|
|
|
|
|
|
-- Add visual indicator for trailing whitespaces
|
|
|
|
vim.opt.fillchars = { eob = " " };
|
|
|
|
vim.fn.matchadd('errorMsg', [[\s\+$]]);
|
|
|
|
|
|
|
|
vim.cmd.colorscheme('dracula');
|
|
|
|
'';
|
|
|
|
}
|
|
|
|
{
|
|
|
|
plugin = pkgs.vimPlugins.indent-blankline-nvim;
|
|
|
|
type = "lua";
|
|
|
|
config =
|
|
|
|
# lua
|
|
|
|
''
|
|
|
|
--
|
|
|
|
local highlight = {
|
|
|
|
"RainbowRed",
|
|
|
|
"RainbowYellow",
|
|
|
|
"RainbowBlue",
|
|
|
|
"RainbowOrange",
|
|
|
|
"RainbowGreen",
|
|
|
|
"RainbowViolet",
|
|
|
|
"RainbowCyan",
|
|
|
|
};
|
|
|
|
|
|
|
|
local hooks = require('ibl.hooks');
|
|
|
|
hooks.register(hooks.type.HIGHLIGHT_SETUP, function()
|
|
|
|
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" });
|
|
|
|
end);
|
|
|
|
|
|
|
|
require('ibl').setup({
|
|
|
|
indent = {
|
|
|
|
highlight = highlight,
|
|
|
|
char = "▏",
|
|
|
|
},
|
|
|
|
});
|
|
|
|
'';
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
plugin = pkgs.vimPlugins.nvim-highlight-colors;
|
|
|
|
type = "lua";
|
|
|
|
config =
|
|
|
|
# lua
|
|
|
|
''
|
|
|
|
-- Ensure termguicolors is enabled if not already
|
|
|
|
vim.opt.termguicolors = true;
|
|
|
|
|
|
|
|
require('nvim-highlight-colors').setup({});
|
|
|
|
'';
|
|
|
|
}
|
|
|
|
|
|
|
|
# Deps of heirline config
|
|
|
|
pkgs.vimPlugins.nvim-web-devicons
|
|
|
|
{
|
|
|
|
plugin = pkgs.vimPlugins.heirline-nvim;
|
|
|
|
type = "lua";
|
2024-12-21 21:49:59 -05:00
|
|
|
config = fileContents ./config/heirline.lua;
|
2024-11-22 02:48:41 -05:00
|
|
|
}
|
2024-12-21 23:34:10 -05:00
|
|
|
|
2024-11-22 02:48:41 -05:00
|
|
|
{
|
|
|
|
plugin = pkgs.vimPlugins.neo-tree-nvim;
|
|
|
|
type = "lua";
|
2024-12-21 21:49:59 -05:00
|
|
|
config = fileContents ./config/neotree.lua;
|
2024-11-22 02:48:41 -05:00
|
|
|
}
|
|
|
|
{
|
|
|
|
plugin = pkgs.vimPlugins.codewindow-nvim;
|
|
|
|
type = "lua";
|
|
|
|
config =
|
|
|
|
# lua
|
|
|
|
''
|
|
|
|
--
|
|
|
|
local codewindow = require('codewindow');
|
|
|
|
|
|
|
|
codewindow.setup({
|
|
|
|
auto_enable = false,
|
|
|
|
minimap_width = 8,
|
|
|
|
relative = 'editor',
|
|
|
|
window_border = 'none',
|
|
|
|
exclude_filetypes = { 'help' },
|
|
|
|
});
|
|
|
|
|
|
|
|
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,
|
|
|
|
});
|
|
|
|
'';
|
|
|
|
}
|
|
|
|
{
|
|
|
|
plugin = pkgs.vimPlugins.transparent-nvim;
|
|
|
|
type = "lua";
|
|
|
|
config =
|
|
|
|
# lua
|
|
|
|
''
|
|
|
|
require('transparent').setup({
|
|
|
|
groups = {
|
|
|
|
'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',
|
|
|
|
},
|
|
|
|
extra_groups = {},
|
|
|
|
exclude_groups = {},
|
|
|
|
});
|
|
|
|
'';
|
|
|
|
}
|
|
|
|
];
|
2024-12-21 23:34:10 -05:00
|
|
|
};
|
2024-11-22 02:48:41 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
# For accurate stack trace
|
2024-12-21 23:34:10 -05:00
|
|
|
_file = ./default.nix;
|
2024-11-22 02:48:41 -05:00
|
|
|
}
|