mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-04 20:41:14 +00:00
99ace503ad
Some checks failed
Set up binary cache / cachix (default) (push) Has been cancelled
Set up binary cache / cachix (maximal) (push) Has been cancelled
Set up binary cache / cachix (nix) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs-html) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs-json) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs-manpages) (push) Has been cancelled
Validate flake & check formatting / Validate Flake (push) Has been cancelled
Validate flake & check formatting / Formatting via Alejandra (push) Has been cancelled
Build and deploy documentation / publish (push) Has been cancelled
* plugins/lsp: add code-actions module; add fastaction.nvim * deprecate nvimCodeActionMenu * fastaction-nvim: move range_code_action to visual maps * fastaction: move to vim.ui, remove mappings, enable register_ui_select by default * fastaction: add missing documentation * fastaction: support vim.ui.borders * treewide: clean up nvim-code-action-menu remnants * docs: add missing section ids --------- Co-authored-by: NotAShelf <raf@notashelf.dev>
119 lines
3.2 KiB
Nix
119 lines
3.2 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
...
|
|
}: let
|
|
inherit (lib.modules) mkIf mkMerge;
|
|
inherit (lib.trivial) boolToString;
|
|
inherit (lib.nvim.binds) mkBinding;
|
|
inherit (lib.nvim.dag) entryAnywhere;
|
|
inherit (lib.nvim.lua) toLuaObject;
|
|
|
|
cfg = config.vim.visuals;
|
|
in {
|
|
config = mkIf cfg.enable (mkMerge [
|
|
(mkIf cfg.indentBlankline.enable {
|
|
vim.startPlugins = ["indent-blankline"];
|
|
vim.pluginRC.indent-blankline = entryAnywhere ''
|
|
require("ibl").setup(${toLuaObject cfg.indentBlankline.setupOpts})
|
|
'';
|
|
})
|
|
|
|
(mkIf cfg.cursorline.enable {
|
|
vim.startPlugins = ["nvim-cursorline"];
|
|
vim.pluginRC.cursorline = entryAnywhere ''
|
|
require('nvim-cursorline').setup {
|
|
cursorline = {
|
|
timeout = ${toString cfg.cursorline.lineTimeout},
|
|
number = ${boolToString (!cfg.cursorline.lineNumbersOnly)},
|
|
}
|
|
}
|
|
'';
|
|
})
|
|
|
|
(mkIf cfg.nvimWebDevicons.enable {
|
|
vim.startPlugins = ["nvim-web-devicons"];
|
|
})
|
|
|
|
(mkIf cfg.scrollBar.enable {
|
|
vim.startPlugins = ["scrollbar-nvim"];
|
|
vim.pluginRC.scrollBar = entryAnywhere ''
|
|
require('scrollbar').setup{
|
|
excluded_filetypes = {
|
|
'prompt',
|
|
'TelescopePrompt',
|
|
'noice',
|
|
'NvimTree',
|
|
'alpha',
|
|
'notify',
|
|
'Navbuddy'
|
|
},
|
|
}
|
|
'';
|
|
})
|
|
|
|
(mkIf cfg.smoothScroll.enable {
|
|
vim.startPlugins = ["cinnamon-nvim"];
|
|
vim.pluginRC.smoothScroll = entryAnywhere ''
|
|
require('cinnamon').setup()
|
|
'';
|
|
})
|
|
|
|
(mkIf cfg.cellularAutomaton.enable {
|
|
vim.startPlugins = ["cellular-automaton"];
|
|
|
|
vim.maps.normal = mkBinding cfg.cellularAutomaton.mappings.makeItRain "<cmd>CellularAutomaton make_it_rain<CR>" "Make it rain";
|
|
|
|
vim.pluginRC.cellularAUtomaton = 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
|
|
end
|
|
return true
|
|
end
|
|
|
|
require("cellular-automaton").register_animation(config)
|
|
'';
|
|
})
|
|
|
|
(mkIf cfg.highlight-undo.enable {
|
|
vim.startPlugins = ["highlight-undo"];
|
|
vim.pluginRC.highlight-undo = entryAnywhere ''
|
|
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 = {}
|
|
},
|
|
})
|
|
'';
|
|
})
|
|
]);
|
|
}
|