2023-02-01 22:01:35 +01:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
2023-02-01 20:11:37 +01:00
|
|
|
}:
|
2023-02-28 08:13:56 +01:00
|
|
|
with lib; let
|
|
|
|
cfg = config.vim.visuals;
|
|
|
|
in {
|
2023-04-18 00:36:14 +02: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
|
|
|
|
vim.wo.colorcolumn = "99999"
|
|
|
|
vim.opt.list = true
|
2023-02-28 08:13:56 +01:00
|
|
|
|
2023-04-18 01:17:36 +02:00
|
|
|
${optionalString (cfg.indentBlankline.eolChar != null) ''
|
2023-04-18 00:36:14 +02:00
|
|
|
vim.opt.listchars:append({ eol = "${cfg.indentBlankline.eolChar}" })
|
|
|
|
''}
|
2023-04-18 01:17:36 +02:00
|
|
|
${optionalString (cfg.indentBlankline.fillChar != null) ''
|
|
|
|
vim.opt.listchars:append({ space = "${cfg.indentBlankline.fillChar}" })
|
2023-04-18 00:36:14 +02:00
|
|
|
''}
|
2023-02-28 08:13:56 +01:00
|
|
|
|
2023-04-18 00:36:14 +02:00
|
|
|
require("indent_blankline").setup {
|
2023-04-18 01:17:36 +02:00
|
|
|
enabled = true,
|
2023-04-18 00:36:14 +02:00
|
|
|
char = "${cfg.indentBlankline.listChar}",
|
|
|
|
show_current_context = ${boolToString cfg.indentBlankline.showCurrContext},
|
2023-04-18 01:17:36 +02:00
|
|
|
show_end_of_line = ${boolToString cfg.indentBlankline.showEndOfLine},
|
|
|
|
use_treesitter = ${boolToString cfg.indentBlankline.useTreesitter},
|
2023-04-18 00:36:14 +02:00
|
|
|
}
|
|
|
|
'';
|
|
|
|
})
|
2023-02-28 08:13:56 +01:00
|
|
|
|
2023-04-18 00:36:14 +02:00
|
|
|
(mkIf cfg.cursorWordline.enable {
|
|
|
|
vim.startPlugins = ["nvim-cursorline"];
|
|
|
|
vim.luaConfigRC.cursorline = nvim.dag.entryAnywhere ''
|
|
|
|
vim.g.cursorline_timeout = ${toString cfg.cursorWordline.lineTimeout}
|
|
|
|
'';
|
|
|
|
})
|
2023-02-28 08:13:56 +01:00
|
|
|
|
2023-04-18 00:36:14 +02:00
|
|
|
(mkIf cfg.nvimWebDevicons.enable {
|
|
|
|
vim.startPlugins = ["nvim-web-devicons"];
|
|
|
|
})
|
2023-02-28 08:13:56 +01:00
|
|
|
|
2023-04-18 00:36:14 +02:00
|
|
|
(mkIf cfg.scrollBar.enable {
|
|
|
|
vim.startPlugins = ["scrollbar-nvim"];
|
|
|
|
vim.luaConfigRC.scrollBar = nvim.dag.entryAnywhere ''
|
|
|
|
require('scrollbar').setup{
|
2023-02-28 08:13:56 +01:00
|
|
|
excluded_filetypes = {
|
|
|
|
'prompt',
|
|
|
|
'TelescopePrompt',
|
|
|
|
'noice',
|
|
|
|
'NvimTree',
|
2023-04-18 02:22:35 +02:00
|
|
|
'alpha',
|
|
|
|
'code-action-menu-menu'
|
2023-02-28 08:13:56 +01:00
|
|
|
},
|
|
|
|
}
|
2023-04-18 00:36:14 +02:00
|
|
|
'';
|
|
|
|
})
|
2023-02-28 08:13:56 +01:00
|
|
|
|
2023-04-18 00:36:14 +02:00
|
|
|
(mkIf cfg.smoothScroll.enable {
|
|
|
|
vim.startPlugins = ["cinnamon-nvim"];
|
|
|
|
vim.luaConfigRC.smoothScroll = nvim.dag.entryAnywhere ''
|
|
|
|
require('cinnamon').setup()
|
|
|
|
'';
|
|
|
|
})
|
2023-02-28 08:13:56 +01:00
|
|
|
|
2023-04-18 00:36:14 +02:00
|
|
|
(mkIf cfg.cellularAutomaton.enable {
|
|
|
|
vim.startPlugins = ["cellular-automaton"];
|
2023-04-15 15:35:34 +02:00
|
|
|
|
|
|
|
vim.maps.normal = mkBinding cfg.cellularAutomaton.mappings.makeItRain "<cmd>CellularAutomaton make_it_rain<CR>" "Make it rain";
|
|
|
|
|
2023-04-18 00:36:14 +02: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 08:13:56 +01:00
|
|
|
end
|
2023-04-18 00:36:14 +02:00
|
|
|
return true
|
2023-02-28 08:13:56 +01:00
|
|
|
end
|
|
|
|
|
2023-04-18 00:36:14 +02:00
|
|
|
require("cellular-automaton").register_animation(config)
|
|
|
|
'';
|
|
|
|
})
|
|
|
|
|
|
|
|
(mkIf cfg.fidget-nvim.enable {
|
|
|
|
vim.startPlugins = ["fidget-nvim"];
|
|
|
|
vim.luaConfigRC.fidget-nvim = nvim.dag.entryAnywhere ''
|
|
|
|
require"fidget".setup{
|
|
|
|
align = {
|
|
|
|
bottom = ${boolToString cfg.fidget-nvim.align.bottom},
|
|
|
|
right = ${boolToString cfg.fidget-nvim.align.right},
|
2023-02-28 11:00:38 +01:00
|
|
|
}
|
2023-04-18 00:36:14 +02:00
|
|
|
}
|
|
|
|
'';
|
|
|
|
})
|
|
|
|
]);
|
2023-02-01 20:11:37 +01:00
|
|
|
}
|