neovim-flake/modules/visuals/config.nix
NotAShelf 729276c4c5
feat: apply new module format to utility plugins
new file:   modules/utility/binds/cheatsheet/cheatsheet.nix
	new file:   modules/utility/binds/cheatsheet/config.nix
	modified:   modules/utility/binds/cheatsheet/default.nix
	modified:   modules/utility/binds/default.nix
	new file:   modules/utility/binds/which-key/config.nix
	modified:   modules/utility/binds/which-key/default.nix
	new file:   modules/utility/binds/which-key/which-key.nix
	renamed:    modules/utility/colorizer.nix -> modules/utility/colorizer/colorizer.nix
	new file:   modules/utility/colorizer/config.nix
	new file:   modules/utility/colorizer/default.nix
	modified:   modules/utility/default.nix
	modified:   modules/utility/gestures/default.nix
	renamed:    modules/utility/gestures/gesture-nvim.nix -> modules/utility/gestures/gesture-nvim/config.nix
	new file:   modules/utility/gestures/gesture-nvim/default.nix
	new file:   modules/utility/gestures/gesture-nvim/gesture-nvim.nix
	renamed:    modules/utility/icon-picker.nix -> modules/utility/icon-picker/config.nix
	new file:   modules/utility/icon-picker/default.nix
	new file:   modules/utility/icon-picker/icon-picker.nix
	new file:   modules/utility/telescope/config.nix
	modified:   modules/utility/telescope/default.nix
	new file:   modules/utility/telescope/telescope.nix
	renamed:    modules/utility/venn.nix -> modules/utility/venn/config.nix
	new file:   modules/utility/venn/default.nix
	new file:   modules/utility/venn/venn.nix
2023-02-28 10:14:44 +03:00

140 lines
3.2 KiB
Nix

{
pkgs,
config,
lib,
...
}:
with lib; let
cfg = config.vim.visuals;
in {
config = mkIf cfg.enable {
vim.startPlugins = [
(
if cfg.nvimWebDevicons.enable
then "nvim-web-devicons"
else null
)
(
if cfg.lspkind.enable
then "lspkind"
else null
)
(
if cfg.cursorWordline.enable
then "nvim-cursorline"
else null
)
(
if cfg.indentBlankline.enable
then "indent-blankline"
else null
)
(
if cfg.scrollBar.enable
then "scrollbar-nvim"
else null
)
(
if cfg.smoothScroll.enable
then "cinnamon-nvim"
else null
)
(
if cfg.cellularAutomaton.enable
then "cellular-automaton"
else null
)
];
vim.luaConfigRC.visuals = nvim.dag.entryAnywhere ''
${
if cfg.lspkind.enable
then "require'lspkind'.init()"
else ""
}
${
if cfg.indentBlankline.enable
then ''
-- highlight error: https://github.com/lukas-reineke/indent-blankline.nvim/issues/59
vim.wo.colorcolumn = "99999"
vim.opt.list = true
${
if cfg.indentBlankline.eolChar == ""
then ""
else ''vim.opt.listchars:append({ eol = "${cfg.indentBlankline.eolChar}" })''
}
${
if cfg.indentBlankline.fillChar == ""
then ""
else ''vim.opt.listchars:append({ space = "${cfg.indentBlankline.fillChar}"})''
}
require("indent_blankline").setup {
char = "${cfg.indentBlankline.listChar}",
show_current_context = ${boolToString cfg.indentBlankline.showCurrContext},
show_end_of_line = true,
}
''
else ""
}
${
if cfg.cursorWordline.enable
then "vim.g.cursorline_timeout = ${toString cfg.cursorWordline.lineTimeout}"
else ""
}
${
if cfg.scrollBar.enable
then "require('scrollbar').setup{
excluded_filetypes = {
'prompt',
'TelescopePrompt',
'noice',
'NvimTree',
'alpha'
},
}"
else ""
}
${
if cfg.smoothScroll.enable
then "require('cinnamon').setup()"
else ""
}
${
if cfg.cellularAutomaton.enable
then ''
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
end
return true
end
require("cellular-automaton").register_animation(config)
vim.keymap.set("n", "<leader>fml", "<cmd>CellularAutomaton make_it_rain<CR>")
''
else ""
}
'';
};
}