mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-24 06:10:44 +00:00
f9789432f9
* modules: switch to gerg's neovim-wrapper * modules: use initViml instead of writing the file * treewide: make the entire generated config lua based * docs: remove mentions of configRC * plugins/treesitter: remove vim.cmd hack * treewide: move resolveDag to lib * modules/wrapper(rc): fix typo * treewide: migrate to pluginRC for correct DAG order The "new" DAG order is as follows: - (luaConfigPre) - globalsScript - basic - theme - pluginConfigs - extraPluginConfigs - mappings - (luaConfigPost) * plugins/theme: fix theme DAG place * plugins/theme: fix fixed theme DAG place * modules/wrapper(rc): add removed option module for configRC * docs: add dag-entries chapter, add release note entry * fix: formatting CI * languages/nix: add missing `local` * docs: fix page link * docs: add mention of breaking changes at the start of the release notes * plugins/neo-tree: convert to pluginRC * modules/wrapper(rc): add back entryAnywhere * modules/wrapper(rc): expose pluginRC * apply raf patch --------- Co-authored-by: NotAShelf <raf@notashelf.dev>
59 lines
1.6 KiB
Nix
59 lines
1.6 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
...
|
|
}: let
|
|
inherit (builtins) toJSON;
|
|
inherit (lib.lists) optionals;
|
|
inherit (lib.modules) mkIf mkMerge;
|
|
inherit (lib.meta) getExe;
|
|
inherit (lib.nvim.binds) mkBinding;
|
|
inherit (lib.nvim.dag) entryAnywhere entryAfter;
|
|
inherit (lib.nvim.lua) toLuaObject;
|
|
|
|
cfg = config.vim.terminal.toggleterm;
|
|
in {
|
|
config = mkMerge [
|
|
(
|
|
mkIf cfg.enable {
|
|
vim = {
|
|
startPlugins = [
|
|
"toggleterm-nvim"
|
|
];
|
|
|
|
maps.normal = mkBinding cfg.mappings.open "<Cmd>execute v:count . \"ToggleTerm\"<CR>" "Toggle terminal";
|
|
|
|
pluginRC.toggleterm = entryAnywhere ''
|
|
require("toggleterm").setup(${toLuaObject cfg.setupOpts})
|
|
'';
|
|
};
|
|
}
|
|
)
|
|
(
|
|
mkIf (cfg.enable && cfg.lazygit.enable)
|
|
{
|
|
vim.startPlugins = optionals (cfg.lazygit.package != null) [
|
|
cfg.lazygit.package
|
|
];
|
|
vim.pluginRC.toggleterm-lazygit = entryAfter ["toggleterm"] ''
|
|
local terminal = require 'toggleterm.terminal'
|
|
local lazygit = terminal.Terminal:new({
|
|
cmd = '${
|
|
if (cfg.lazygit.package != null)
|
|
then getExe cfg.lazygit.package
|
|
else "lazygit"
|
|
}',
|
|
direction = '${cfg.lazygit.direction}',
|
|
hidden = true,
|
|
on_open = function(term)
|
|
vim.cmd("startinsert!")
|
|
end
|
|
})
|
|
|
|
vim.keymap.set('n', ${toJSON cfg.lazygit.mappings.open}, function() lazygit:toggle() end, {silent = true, noremap = true, desc = 'Open lazygit [toggleterm]'})
|
|
'';
|
|
}
|
|
)
|
|
];
|
|
}
|