2023-02-01 21:01:35 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
2023-11-07 00:50:27 +00:00
|
|
|
}: let
|
|
|
|
inherit (lib) mkIf mkMerge nvim optionalString boolToString mkBinding;
|
|
|
|
|
2023-02-28 07:13:56 +00:00
|
|
|
cfg = config.vim.visuals;
|
|
|
|
in {
|
2023-04-17 22:36:14 +00:00
|
|
|
config = mkIf cfg.enable (mkMerge [
|
|
|
|
(mkIf cfg.indentBlankline.enable {
|
|
|
|
vim.startPlugins = ["indent-blankline"];
|
|
|
|
vim.luaConfigRC.indent-blankline = nvim.dag.entryAnywhere ''
|
|
|
|
-- highlight error: https://github.com/lukas-reineke/indent-blankline.nvim/issues/59
|
2023-10-14 11:04:48 +00:00
|
|
|
-- vim.wo.colorcolumn = "99999"
|
2023-04-17 22:36:14 +00:00
|
|
|
vim.opt.list = true
|
2023-02-28 07:13:56 +00:00
|
|
|
|
2023-04-17 23:17:36 +00:00
|
|
|
${optionalString (cfg.indentBlankline.eolChar != null) ''
|
2023-04-17 22:36:14 +00:00
|
|
|
vim.opt.listchars:append({ eol = "${cfg.indentBlankline.eolChar}" })
|
|
|
|
''}
|
2023-04-17 23:17:36 +00:00
|
|
|
${optionalString (cfg.indentBlankline.fillChar != null) ''
|
|
|
|
vim.opt.listchars:append({ space = "${cfg.indentBlankline.fillChar}" })
|
2023-04-17 22:36:14 +00:00
|
|
|
''}
|
2023-02-28 07:13:56 +00:00
|
|
|
|
2023-10-14 11:04:48 +00:00
|
|
|
require("ibl").setup {
|
2023-04-17 23:17:36 +00:00
|
|
|
enabled = true,
|
2023-10-14 11:04:48 +00:00
|
|
|
debounce = ${toString cfg.indentBlankline.debounce},
|
|
|
|
indent = { char = "${cfg.indentBlankline.indent.char}" },
|
|
|
|
|
|
|
|
viewport_buffer = {
|
|
|
|
min = ${toString cfg.indentBlankline.viewportBuffer.min},
|
|
|
|
max = ${toString cfg.indentBlankline.viewportBuffer.max},
|
|
|
|
},
|
|
|
|
|
|
|
|
scope = {
|
2023-11-24 09:05:19 +00:00
|
|
|
enabled = ${boolToString cfg.indentBlankline.scope.enabled},
|
2023-10-14 11:04:48 +00:00
|
|
|
show_end = ${boolToString cfg.indentBlankline.scope.showEndOfLine}
|
|
|
|
},
|
2023-04-17 22:36:14 +00:00
|
|
|
}
|
|
|
|
'';
|
|
|
|
})
|
2023-02-28 07:13:56 +00:00
|
|
|
|
2023-08-07 02:30:06 +00:00
|
|
|
(mkIf cfg.cursorline.enable {
|
2023-04-17 22:36:14 +00:00
|
|
|
vim.startPlugins = ["nvim-cursorline"];
|
|
|
|
vim.luaConfigRC.cursorline = nvim.dag.entryAnywhere ''
|
2023-08-07 02:30:06 +00:00
|
|
|
require('nvim-cursorline').setup {
|
|
|
|
cursorline = {
|
|
|
|
timeout = ${toString cfg.cursorline.lineTimeout},
|
|
|
|
number = ${boolToString (!cfg.cursorline.lineNumbersOnly)},
|
|
|
|
}
|
|
|
|
}
|
2023-04-17 22:36:14 +00:00
|
|
|
'';
|
|
|
|
})
|
2023-02-28 07:13:56 +00:00
|
|
|
|
2023-04-17 22:36:14 +00:00
|
|
|
(mkIf cfg.nvimWebDevicons.enable {
|
|
|
|
vim.startPlugins = ["nvim-web-devicons"];
|
|
|
|
})
|
2023-02-28 07:13:56 +00:00
|
|
|
|
2023-04-17 22:36:14 +00:00
|
|
|
(mkIf cfg.scrollBar.enable {
|
|
|
|
vim.startPlugins = ["scrollbar-nvim"];
|
|
|
|
vim.luaConfigRC.scrollBar = nvim.dag.entryAnywhere ''
|
|
|
|
require('scrollbar').setup{
|
2023-02-28 07:13:56 +00:00
|
|
|
excluded_filetypes = {
|
|
|
|
'prompt',
|
|
|
|
'TelescopePrompt',
|
|
|
|
'noice',
|
|
|
|
'NvimTree',
|
2023-04-18 00:22:35 +00:00
|
|
|
'alpha',
|
2023-06-04 05:47:41 +00:00
|
|
|
'code-action-menu-menu',
|
|
|
|
'code-action-menu-warning-message',
|
2023-07-24 18:36:01 +00:00
|
|
|
'notify',
|
|
|
|
'Navbuddy'
|
2023-02-28 07:13:56 +00:00
|
|
|
},
|
|
|
|
}
|
2023-04-17 22:36:14 +00:00
|
|
|
'';
|
|
|
|
})
|
2023-02-28 07:13:56 +00:00
|
|
|
|
2023-04-17 22:36:14 +00:00
|
|
|
(mkIf cfg.smoothScroll.enable {
|
|
|
|
vim.startPlugins = ["cinnamon-nvim"];
|
|
|
|
vim.luaConfigRC.smoothScroll = nvim.dag.entryAnywhere ''
|
|
|
|
require('cinnamon').setup()
|
|
|
|
'';
|
|
|
|
})
|
2023-02-28 07:13:56 +00:00
|
|
|
|
2023-04-17 22:36:14 +00:00
|
|
|
(mkIf cfg.cellularAutomaton.enable {
|
|
|
|
vim.startPlugins = ["cellular-automaton"];
|
2023-04-15 13:35:34 +00:00
|
|
|
|
|
|
|
vim.maps.normal = mkBinding cfg.cellularAutomaton.mappings.makeItRain "<cmd>CellularAutomaton make_it_rain<CR>" "Make it rain";
|
|
|
|
|
2023-04-17 22:36:14 +00:00
|
|
|
vim.luaConfigRC.cellularAUtomaton = nvim.dag.entryAnywhere ''
|
|
|
|
local config = {
|
|
|
|
fps = 50,
|
|
|
|
name = 'slide',
|
|
|
|
}
|
|
|
|
|
|
|
|
-- init function is invoked only once at the start
|
|
|
|
-- config.init = function (grid)
|
|
|
|
--
|
|
|
|
-- end
|
|
|
|
|
|
|
|
-- update function
|
|
|
|
config.update = function (grid)
|
|
|
|
for i = 1, #grid do
|
|
|
|
local prev = grid[i][#(grid[i])]
|
|
|
|
for j = 1, #(grid[i]) do
|
|
|
|
grid[i][j], prev = prev, grid[i][j]
|
|
|
|
end
|
2023-02-28 07:13:56 +00:00
|
|
|
end
|
2023-04-17 22:36:14 +00:00
|
|
|
return true
|
2023-02-28 07:13:56 +00:00
|
|
|
end
|
|
|
|
|
2023-04-17 22:36:14 +00:00
|
|
|
require("cellular-automaton").register_animation(config)
|
|
|
|
'';
|
|
|
|
})
|
|
|
|
|
2023-10-21 22:22:31 +00:00
|
|
|
(mkIf cfg.highlight-undo.enable {
|
|
|
|
vim.startPlugins = ["highlight-undo"];
|
2024-02-11 01:49:27 +00:00
|
|
|
vim.luaConfigRC.highlight-undo = nvim.dag.entryAnywhere ''
|
2023-10-21 22:22:31 +00:00
|
|
|
require('highlight-undo').setup({
|
|
|
|
duration = ${toString cfg.highlight-undo.duration},
|
|
|
|
highlight_for_count = ${boolToString cfg.highlight-undo.highlightForCount},
|
|
|
|
undo = {
|
|
|
|
hlgroup = ${cfg.highlight-undo.undo.hlGroup},
|
|
|
|
mode = 'n',
|
|
|
|
lhs = 'u',
|
|
|
|
map = 'undo',
|
|
|
|
opts = {}
|
|
|
|
},
|
|
|
|
|
|
|
|
redo = {
|
|
|
|
hlgroup = ${cfg.highlight-undo.redo.hlGroup},
|
|
|
|
mode = 'n',
|
|
|
|
lhs = '<C-r>',
|
|
|
|
map = 'redo',
|
|
|
|
opts = {}
|
|
|
|
},
|
|
|
|
})
|
|
|
|
'';
|
|
|
|
})
|
2023-04-17 22:36:14 +00:00
|
|
|
]);
|
2023-02-01 19:11:37 +00:00
|
|
|
}
|