Merge branch 'main' into feature/listof-str-border

This commit is contained in:
raf 2024-07-20 08:33:39 +00:00 committed by GitHub
commit d88b1129e5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
86 changed files with 453 additions and 473 deletions

View file

@ -33,7 +33,7 @@ in {
startPlugins = [
"chatgpt"
];
luaConfigRC.chagpt = entryAnywhere ''
pluginRC.chagpt = entryAnywhere ''
require("chatgpt").setup(${toLuaObject cfg.setupOpts})
'';
maps.normal = mkMerge [

View file

@ -34,7 +34,7 @@ in {
"copilot-cmp"
];
vim.luaConfigRC.copilot = entryAnywhere ''
vim.pluginRC.copilot = entryAnywhere ''
require("copilot").setup(${toLuaObject cfg.setupOpts})
${lib.optionalString cfg.cmp.enable ''

View file

@ -12,7 +12,7 @@ in {
config = mkIf cfg.enable {
vim.startPlugins = ["nvim-autopairs"];
vim.luaConfigRC.autopairs = entryAnywhere ''
vim.pluginRC.autopairs = entryAnywhere ''
require("nvim-autopairs").setup({ map_cr = ${boolToString (!config.vim.autocomplete.enable)} })
'';
};

View file

@ -41,7 +41,7 @@ in {
(mkBinding cfg.mappings.toggleSelectedBlock "<Plug>(comment_toggle_blockwise_visual)" mappings.toggleSelectedBlock.description)
];
vim.luaConfigRC.comment-nvim = entryAnywhere ''
vim.pluginRC.comment-nvim = entryAnywhere ''
require('Comment').setup({
mappings = { basic = false, extra = false, },
})

View file

@ -186,7 +186,7 @@ in {
# TODO: alternative snippet engines to vsnip
# https://github.com/hrsh7th/nvim-cmp/blob/main/doc/cmp.txt#L82
vim.luaConfigRC.completion = mkIf (cfg.type == "nvim-cmp") (dagPlacement ''
vim.pluginRC.completion = mkIf (cfg.type == "nvim-cmp") (dagPlacement ''
local nvim_cmp_menu_map = function(entry, vim_item)
-- name for each source
vim_item.menu = ({

View file

@ -16,7 +16,7 @@ in {
# the entire credit for this dashboard configuration to https://github.com/Rishabh672003
# honestly, excellent work
vim.luaConfigRC.alpha = entryAnywhere ''
vim.pluginRC.alpha = entryAnywhere ''
local alpha = require("alpha")
local plenary_path = require("plenary.path")
local dashboard = require("alpha.themes.dashboard")

View file

@ -13,7 +13,7 @@ in {
"dashboard-nvim"
];
vim.luaConfigRC.dashboard-nvim = entryAnywhere ''
vim.pluginRC.dashboard-nvim = entryAnywhere ''
require("dashboard").setup{}
'';
};

View file

@ -5,7 +5,6 @@
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.vim) mkVimBool;
cfg = config.vim.dashboard.startify;
in {
@ -23,28 +22,28 @@ in {
else cfg.customFooter;
"startify_bookmarks" = cfg.bookmarks;
"startify_lists" = cfg.lists;
"startify_change_to_dir" = mkVimBool cfg.changeToDir;
"startify_change_to_vcs_root" = mkVimBool cfg.changeToVCRoot;
"startify_change_to_dir" = cfg.changeToDir;
"startify_change_to_vcs_root" = cfg.changeToVCRoot;
"startify_change_cmd" = cfg.changeDirCmd;
"startify_skiplist" = cfg.skipList;
"startify_update_oldfiles" = mkVimBool cfg.updateOldFiles;
"startify_session_autoload" = mkVimBool cfg.sessionAutoload;
"startify_update_oldfiles" = cfg.updateOldFiles;
"startify_session_autoload" = cfg.sessionAutoload;
"startify_commands" = cfg.commands;
"startify_files_number" = cfg.filesNumber;
"startify_custom_indices" = cfg.customIndices;
"startify_disable_at_vimenter" = mkVimBool cfg.disableOnStartup;
"startify_enable_unsafe" = mkVimBool cfg.unsafe;
"startify_disable_at_vimenter" = cfg.disableOnStartup;
"startify_enable_unsafe" = cfg.unsafe;
"startify_padding_left" = cfg.paddingLeft;
"startify_use_env" = mkVimBool cfg.useEnv;
"startify_use_env" = cfg.useEnv;
"startify_session_before_save" = cfg.sessionBeforeSave;
"startify_session_persistence" = mkVimBool cfg.sessionPersistence;
"startify_session_delete_buffers" = mkVimBool cfg.sessionDeleteBuffers;
"startify_session_persistence" = cfg.sessionPersistence;
"startify_session_delete_buffers" = cfg.sessionDeleteBuffers;
"startify_session_dir" = cfg.sessionDir;
"startify_skiplist_server" = cfg.skipListServer;
"startify_session_remove_lines" = cfg.sessionRemoveLines;
"startify_session_savevars" = cfg.sessionSavevars;
"startify_session_savecmds" = cfg.sessionSavecmds;
"startify_session_sort" = mkVimBool cfg.sessionSort;
"startify_session_sort" = cfg.sessionSort;
};
};
}

View file

@ -18,7 +18,7 @@ in {
(mkIf cfg.enable {
vim.startPlugins = ["nvim-dap"];
vim.luaConfigRC =
vim.pluginRC =
{
# TODO customizable keymaps
nvim-dap = entryAnywhere ''
@ -51,7 +51,7 @@ in {
(mkIf (cfg.enable && cfg.ui.enable) {
vim.startPlugins = ["nvim-dap-ui" "nvim-nio"];
vim.luaConfigRC.nvim-dap-ui = entryAfter ["nvim-dap"] (''
vim.pluginRC.nvim-dap-ui = entryAfter ["nvim-dap"] (''
local dapui = require("dapui")
dapui.setup()
''

View file

@ -20,7 +20,7 @@ in {
"neo-tree-nvim"
];
luaConfigRC.neo-tree = entryAnywhere ''
pluginRC.neo-tree = entryAnywhere ''
require("neo-tree").setup(${toLuaObject cfg.setupOpts})
'';
};

View file

@ -29,7 +29,7 @@ in {
"<leader>t" = "+NvimTree";
};
vim.luaConfigRC.nvimtreelua = entryAnywhere ''
vim.pluginRC.nvimtreelua = entryAnywhere ''
${
optionalString cfg.setupOpts.disable_netrw ''
-- disable netrew completely

View file

@ -69,7 +69,7 @@ in {
"<leader>g" = "+Gitsigns";
};
luaConfigRC.gitsigns = entryAnywhere ''
pluginRC.gitsigns = entryAnywhere ''
require('gitsigns').setup{}
'';
};

View file

@ -12,7 +12,7 @@
inherit (lib.modules) mkIf mkMerge;
inherit (lib.nvim.lua) expToLua;
inherit (lib.nvim.types) mkGrammarOption;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.dag) entryAfter;
packageToCmd = package: defaultCmd:
if isList cfg.lsp.package
@ -141,7 +141,7 @@ in {
config = mkIf cfg.enable (mkMerge [
(mkIf cfg.cHeader {
vim.configRC.c-header = entryAnywhere "let g:c_syntax_for_h = 1";
vim.pluginRC.c-header = entryAfter ["basic"] "vim.g.c_syntax_for_h = 1";
})
(mkIf cfg.treesitter.enable {

View file

@ -140,7 +140,7 @@ in {
then ["flutter-tools-patched"]
else ["flutter-tools"];
vim.luaConfigRC.flutter-tools = entryAnywhere ''
vim.pluginRC.flutter-tools = entryAnywhere ''
require('flutter-tools').setup {
lsp = {
color = { -- show the derived colours for dart variables

View file

@ -113,7 +113,7 @@ in {
(mkIf cfg.elixir-tools.enable {
vim.startPlugins = ["elixir-tools"];
vim.luaConfigRC.elixir-tools = entryAnywhere ''
vim.pluginRC.elixir-tools = entryAnywhere ''
local elixir-tools = require("elixir")
local elixirls = require("elixir-tools.elixirls")

View file

@ -102,7 +102,7 @@ in {
(mkIf cfg.dap.enable {
vim = {
startPlugins = ["nvim-dap-go"];
luaConfigRC.nvim-dap-go = entryAfter ["nvim-dap"] ''
pluginRC.nvim-dap-go = entryAfter ["nvim-dap"] ''
require('dap-go').setup {
delve = {
path = '${getExe cfg.dap.package}',

View file

@ -36,7 +36,7 @@ in {
grammars = [cfg.treesitter.package];
};
luaConfigRC.html-autotag = mkIf cfg.treesitter.autotagHtml (entryAnywhere ''
pluginRC.html-autotag = mkIf cfg.treesitter.autotagHtml (entryAnywhere ''
require('nvim-ts-autotag').setup()
'');
};

View file

@ -61,7 +61,7 @@ in {
(mkIf cfg.lsp.neodev.enable {
vim.startPlugins = ["neodev-nvim"];
vim.luaConfigRC.neodev = entryBefore ["lua-lsp"] ''
vim.pluginRC.neodev = entryBefore ["lua-lsp"] ''
require("neodev").setup({})
'';
})

View file

@ -11,7 +11,6 @@
inherit (lib.strings) optionalString;
inherit (lib.types) enum either listOf package str;
inherit (lib.nvim.types) mkGrammarOption diagnostics;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) expToLua;
inherit (lib.nvim.languages) diagnosticsToLua;
@ -176,8 +175,16 @@ in {
config = mkIf cfg.enable (mkMerge [
{
vim.configRC.nix = entryAnywhere ''
autocmd filetype nix setlocal tabstop=2 shiftwidth=2 softtabstop=2
vim.pluginRC.nix = ''
vim.api.nvim_create_autocmd("FileType", {
pattern = "nix",
callback = function(opts)
local bo = vim.bo[opts.buf]
bo.tabstop = 2
bo.shiftwidth = 2
bo.softtabstop = 2
end
})
'';
}

View file

@ -102,7 +102,7 @@ in {
startPlugins = ["crates-nvim"];
lsp.null-ls.enable = mkIf cfg.crates.codeActions true;
autocomplete.sources = {"crates" = "[Crates]";};
luaConfigRC.rust-crates = entryAnywhere ''
pluginRC.rust-crates = entryAnywhere ''
require('crates').setup {
null_ls = {
enabled = ${boolToString cfg.crates.codeActions},
@ -125,72 +125,61 @@ in {
(mkIf (cfg.lsp.enable || cfg.dap.enable) {
vim = {
startPlugins = ["rust-tools"] ++ optionals cfg.dap.enable [cfg.dap.package];
startPlugins = ["rustaceanvim"];
lsp.lspconfig = {
enable = true;
sources.rust-lsp = ''
local rt = require('rust-tools')
rust_on_attach = function(client, bufnr)
default_on_attach(client, bufnr)
local opts = { noremap=true, silent=true, buffer = bufnr }
vim.keymap.set("n", "<leader>ris", rt.inlay_hints.set, opts)
vim.keymap.set("n", "<leader>riu", rt.inlay_hints.unset, opts)
vim.keymap.set("n", "<leader>rr", rt.runnables.runnables, opts)
vim.keymap.set("n", "<leader>rp", rt.parent_module.parent_module, opts)
vim.keymap.set("n", "<leader>rm", rt.expand_macro.expand_macro, opts)
vim.keymap.set("n", "<leader>rc", rt.open_cargo_toml.open_cargo_toml, opts)
vim.keymap.set("n", "<leader>rg", function() rt.crate_graph.view_crate_graph("x11", nil) end, opts)
${optionalString cfg.dap.enable ''
vim.keymap.set("n", "<leader>rd", ":RustDebuggables<cr>", opts)
vim.keymap.set(
"n", "${config.vim.debugger.nvim-dap.mappings.continue}",
function()
local dap = require("dap")
if dap.status() == "" then
vim.cmd "RustDebuggables"
else
dap.continue()
end
end,
opts
)
''}
end
local rustopts = {
tools = {
autoSetHints = true,
hover_with_actions = false,
inlay_hints = {
only_current_line = false,
}
luaConfigRC.rustaceanvim = entryAnywhere ''
vim.g.rustaceanvim = {
${optionalString cfg.lsp.enable ''
-- LSP
tools = {
hover_actions = {
replace_builtin_hover = false
},
server = {
capabilities = capabilities,
on_attach = rust_on_attach,
cmd = ${
},
server = {
cmd = ${
if isList cfg.lsp.package
then expToLua cfg.lsp.package
else ''{"${cfg.lsp.package}/bin/rust-analyzer"}''
},
settings = {
${cfg.lsp.opts}
}
},
${optionalString cfg.dap.enable ''
dap = {
adapter = {
type = "executable",
command = "${cfg.dap.package}/bin/lldb-vscode",
name = "rt_lldb",
},
},
on_attach = function(client, bufnr)
default_on_attach(client, bufnr)
local opts = { noremap=true, silent=true, buffer = bufnr }
vim.keymap.set("n", "<leader>rr", ":RustLsp runnables<CR>", opts)
vim.keymap.set("n", "<leader>rp", ":RustLsp parentModule<CR>", opts)
vim.keymap.set("n", "<leader>rm", ":RustLsp expandMacro<CR>", opts)
vim.keymap.set("n", "<leader>rc", ":RustLsp openCargo", opts)
vim.keymap.set("n", "<leader>rg", ":RustLsp crateGraph x11", opts)
${optionalString cfg.dap.enable ''
vim.keymap.set("n", "<leader>rd", ":RustLsp debuggables<cr>", opts)
vim.keymap.set(
"n", "${config.vim.debugger.nvim-dap.mappings.continue}",
function()
local dap = require("dap")
if dap.status() == "" then
vim.cmd "RustLsp debuggables"
else
dap.continue()
end
end,
opts
)
''}
}
rt.setup(rustopts)
'';
};
end
},
''}
${optionalString cfg.dap.enable ''
dap = {
adapter = {
type = "executable",
command = "${cfg.dap.package}/bin/lldb-vscode",
name = "rustacean_lldb",
},
},
''}
}
'';
};
})
]);

View file

@ -192,7 +192,7 @@ in {
(mkIf cfg.extensions."ts-error-translator".enable {
vim.startPlugins = ["ts-error-translator"];
vim.luaConfigRC.ts-error-translator = entryAnywhere ''
vim.pluginRC.ts-error-translator = entryAnywhere ''
require("ts-error-translator").setup(${toLuaObject cfg.extensions.ts-error-translator.setupOpts})
'';
})

View file

@ -27,7 +27,7 @@ in {
autocomplete.sources = {"nvim_lsp" = "[LSP]";};
luaConfigRC.lsp-setup = ''
pluginRC.lsp-setup = ''
vim.g.formatsave = ${boolToString cfg.formatOnSave};
local attach_keymaps = function(client, bufnr)

View file

@ -12,7 +12,7 @@ in {
vim = {
startPlugins = ["nvim-lightbulb"];
luaConfigRC.lightbulb = entryAnywhere ''
pluginRC.lightbulb = entryAnywhere ''
vim.api.nvim_command('autocmd CursorHold,CursorHoldI * lua require\'nvim-lightbulb\'.update_lightbulb()')
-- Enable trouble diagnostics viewer

View file

@ -20,7 +20,7 @@ in {
handler_opts.border = config.vim.ui.borders.plugins.lsp-signature.style;
};
luaConfigRC.lsp-signature = entryAnywhere ''
pluginRC.lsp-signature = entryAnywhere ''
-- Enable lsp signature viewer
require("lsp_signature").setup(${toLuaObject cfg.lspSignature.setupOpts})
'';

View file

@ -18,7 +18,7 @@ in {
startPlugins = ["nvim-lspconfig"];
luaConfigRC.lspconfig = entryAfter ["lsp-setup"] ''
pluginRC.lspconfig = entryAfter ["lsp-setup"] ''
local lspconfig = require('lspconfig')
${
@ -30,7 +30,7 @@ in {
};
}
{
vim.luaConfigRC = mapAttrs (_: v: (entryAfter ["lspconfig"] v)) cfg.lspconfig.sources;
vim.pluginRC = mapAttrs (_: v: (entryAfter ["lspconfig"] v)) cfg.lspconfig.sources;
}
]);
}

View file

@ -10,7 +10,7 @@
in {
config = mkIf (cfg.enable && cfg.lspkind.enable) {
vim.startPlugins = ["lspkind"];
vim.luaConfigRC.lspkind = entryAnywhere ''
vim.pluginRC.lspkind = entryAnywhere ''
local lspkind = require'lspkind'
local lspkind_opts = {
mode = '${cfg.lspkind.mode}'

View file

@ -10,7 +10,7 @@
in {
config = mkIf (cfg.enable && cfg.lsplines.enable) {
vim.startPlugins = ["lsp-lines"];
vim.luaConfigRC.lsplines = entryAfter ["lspconfig"] ''
vim.pluginRC.lsplines = entryAfter ["lspconfig"] ''
require("lsp_lines").setup()
vim.diagnostic.config({

View file

@ -41,7 +41,7 @@ in {
];
};
luaConfigRC.lspsaga = entryAnywhere ''
pluginRC.lspsaga = entryAnywhere ''
require('lspsaga').init_lsp_saga({
${optionalString config.vim.ui.borders.plugins.lspsaga.enable ''
border_style = '${config.vim.ui.borders.plugins.lspsaga.style}',

View file

@ -22,7 +22,7 @@ in {
# since it will hook into LSPs to receive information
lsp.enable = true;
luaConfigRC = {
pluginRC = {
# early setup for null-ls
null_ls-setup = entryAnywhere ''
local null_ls = require("null-ls")
@ -46,7 +46,7 @@ in {
};
}
{
vim.luaConfigRC = mapAttrs (_: v: (entryBetween ["null_ls"] ["null_ls-setup"] v)) cfg.null-ls.sources;
vim.pluginRC = mapAttrs (_: v: (entryBetween ["null_ls"] ["null_ls-setup"] v)) cfg.null-ls.sources;
}
]);
}

View file

@ -24,7 +24,7 @@ in {
"<leader>c" = "+CodeAction";
};
luaConfigRC.code-action-menu = entryAnywhere ''
pluginRC.code-action-menu = entryAnywhere ''
-- border configuration
vim.g.code_action_menu_window_border = ${toLuaObject config.vim.ui.borders.plugins.code-action-menu.style}

View file

@ -19,7 +19,7 @@ in {
lsp.enable = true;
startPlugins = ["nvim-docs-view"];
luaConfigRC.nvim-docs-view = entryAnywhere ''
pluginRC.nvim-docs-view = entryAnywhere ''
require("docs-view").setup ${toLuaObject cfg.setupOpts}
'';

View file

@ -32,7 +32,7 @@ in {
"<leader>lw" = "Workspace";
};
luaConfigRC.trouble = entryAnywhere ''
pluginRC.trouble = entryAnywhere ''
-- Enable trouble diagnostics viewer
require("trouble").setup {}
'';

View file

@ -31,7 +31,7 @@ in {
"<leader>m" = "+Minimap";
};
luaConfigRC.codewindow = entryAnywhere ''
pluginRC.codewindow = entryAnywhere ''
local codewindow = require('codewindow')
codewindow.setup({
exclude_filetypes = { 'NvimTree', 'orgagenda', 'Alpha'},

View file

@ -25,7 +25,7 @@ in {
"<leader>o" = "+Notes";
};
luaConfigRC.mind-nvim = entryAnywhere ''
pluginRC.mind-nvim = entryAnywhere ''
require'mind'.setup()
'';
};

View file

@ -22,7 +22,7 @@ in {
"<leader>o" = "+Notes";
};
luaConfigRC.obsidian = entryAnywhere ''
pluginRC.obsidian = entryAnywhere ''
require("obsidian").setup(${toLuaObject cfg.setupOpts})
'';
};

View file

@ -21,7 +21,7 @@ in {
"<leader>o" = "+Notes";
};
luaConfigRC.orgmode = entryAnywhere ''
pluginRC.orgmode = entryAnywhere ''
-- Treesitter configuration
require('nvim-treesitter.configs').setup {

View file

@ -24,7 +24,7 @@ in {
(mkIf config.vim.lsp.trouble.enable (mkBinding cfg.mappings.trouble ":TodoTrouble<CR>" mappings.trouble.description))
];
luaConfigRC.todo-comments = ''
pluginRC.todo-comments = ''
require('todo-comments').setup(${toLuaObject cfg.setupOpts})
'';
};

View file

@ -14,7 +14,7 @@ in {
"project-nvim"
];
vim.luaConfigRC.project-nvim = entryAnywhere ''
vim.pluginRC.project-nvim = entryAnywhere ''
require('project_nvim').setup(${toLuaObject cfg.setupOpts})
'';
};

View file

@ -12,7 +12,7 @@ in {
config = mkIf cfg.enable {
vim.startPlugins = ["neocord"];
vim.luaConfigRC.neocord = entryAnywhere ''
vim.pluginRC.neocord = entryAnywhere ''
-- Description of each option can be found in https://github.com/IogaMaster/neocord#lua
require("neocord").setup(${toLuaObject cfg.setupOpts})
'';

View file

@ -28,7 +28,7 @@ in {
# TODO: load_current_dir_session
];
luaConfigRC.nvim-session-manager = entryAnywhere ''
pluginRC.nvim-session-manager = entryAnywhere ''
local Path = require('plenary.path')
local sm = require('session_manager.config')
require('session_manager').setup(${toLuaObject cfg.setupOpts})

View file

@ -14,7 +14,7 @@ in {
# vim-dirtytalk doesn't have any setup
# but we would like to append programming to spelllang
# as soon as possible while the plugin is enabled
luaConfigRC.vim-dirtytalk = entryAfter ["basic"] ''
pluginRC.vim-dirtytalk = entryAfter ["basic"] ''
-- append programming to spelllang
vim.opt.spelllang:append("programming")
'';

View file

@ -35,7 +35,7 @@ in {
vim = {
startPlugins = ["lualine"];
luaConfigRC.lualine = entryAnywhere ''
pluginRC.lualine = entryAnywhere ''
local lualine = require('lualine')
lualine.setup ${toLuaObject cfg.setupOpts}
'';

View file

@ -39,7 +39,7 @@ in {
"<leader>bsi" = "BufferLineSortById";
};
luaConfigRC.nvimBufferline = entryAnywhere ''
pluginRC.nvimBufferline = entryAnywhere ''
require("bufferline").setup(${toLuaObject cfg.setupOpts})
'';
};

View file

@ -23,7 +23,7 @@ in {
maps.normal = mkBinding cfg.mappings.open "<Cmd>execute v:count . \"ToggleTerm\"<CR>" "Toggle terminal";
luaConfigRC.toggleterm = entryAnywhere ''
pluginRC.toggleterm = entryAnywhere ''
require("toggleterm").setup(${toLuaObject cfg.setupOpts})
'';
};
@ -35,7 +35,7 @@ in {
vim.startPlugins = optionals (cfg.lazygit.package != null) [
cfg.lazygit.package
];
vim.luaConfigRC.toggleterm-lazygit = entryAfter ["toggleterm"] ''
vim.pluginRC.toggleterm-lazygit = entryAfter ["toggleterm"] ''
local terminal = require 'toggleterm.terminal'
local lazygit = terminal.Terminal:new({
cmd = '${

View file

@ -7,10 +7,10 @@
inherit (lib.attrsets) attrNames;
inherit (lib.types) bool lines enum;
inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryBefore;
inherit (lib.nvim.dag) entryAfter;
cfg = config.vim.theme;
supported_themes = import ./supported_themes.nix {
supportedThemes = import ./supported-themes.nix {
inherit lib config;
};
in {
@ -21,12 +21,12 @@ in {
};
name = mkOption {
type = enum (attrNames supported_themes);
description = "Supported themes can be found in `supported_themes.nix`";
type = enum (attrNames supportedThemes);
description = "Supported themes can be found in `supportedThemes.nix`";
};
style = mkOption {
type = enum supported_themes.${cfg.name}.styles;
type = enum supportedThemes.${cfg.name}.styles;
description = "Specific style for theme if it supports it";
};
@ -45,11 +45,9 @@ in {
config = mkIf cfg.enable {
vim = {
startPlugins = [cfg.name];
configRC.theme = entryBefore ["luaScript"] ''
lua << EOF
luaConfigRC.theme = entryAfter ["basic"] ''
${cfg.extraConfig}
${supported_themes.${cfg.name}.setup (with cfg; {inherit style transparent;})}
EOF
${supportedThemes.${cfg.name}.setup {inherit (cfg) style transparent;}}
'';
};
};

View file

@ -37,18 +37,18 @@ in {
};
# For some reason treesitter highlighting does not work on start if this is set before syntax on
configRC.treesitter-fold = mkIf cfg.fold (entryBefore ["basic"] ''
" This is required by treesitter-context to handle folds
set foldmethod=expr
set foldexpr=nvim_treesitter#foldexpr()
pluginRC.treesitter-fold = mkIf cfg.fold (entryBefore ["basic"] ''
-- This is required by treesitter-context to handle folds
vim.o.foldmethod = "expr"
vim.o.foldexpr = "nvim_treesitter#foldexpr()"
" This is optional, but is set rather as a sane default.
" If unset, opened files will be folded by automatically as
" the files are opened
set nofoldenable
-- This is optional, but is set rather as a sane default.
-- If unset, opened files will be folded by automatically as
-- the files are opened
vim.o.foldenable = false
'');
luaConfigRC.treesitter = entryAfter ["basic"] ''
pluginRC.treesitter = entryAfter ["basic"] ''
require('nvim-treesitter.configs').setup {
-- Disable imperative treesitter options that would attempt to fetch
-- grammars into the read-only Nix store. To add additional grammars here

View file

@ -16,7 +16,7 @@ in {
# set up treesitter-context after Treesitter. The ordering
# should not matter, but there is no harm in doing this
luaConfigRC.treesitter-context = entryAfter ["treesitter"] ''
pluginRC.treesitter-context = entryAfter ["treesitter"] ''
require("treesitter-context").setup(${toLuaObject cfg.setupOpts})
'';
};

View file

@ -78,7 +78,7 @@ in {
};
};
vim.luaConfigRC.breadcrumbs = entryAfter ["lspconfig"] ''
vim.pluginRC.breadcrumbs = entryAfter ["lspconfig"] ''
${optionalString (cfg.source == "nvim-navic") ''
local navic = require("nvim-navic")

View file

@ -14,7 +14,7 @@ in {
"nvim-colorizer-lua"
];
vim.luaConfigRC.colorizer = entryAnywhere ''
vim.pluginRC.colorizer = entryAnywhere ''
require('colorizer').setup(${toLuaObject cfg.setupOpts})
'';
};

View file

@ -11,7 +11,7 @@ in {
config = mkIf cfg.enable {
vim.startPlugins = ["vim-illuminate"];
vim.luaConfigRC.vim-illuminate = entryAnywhere ''
vim.pluginRC.vim-illuminate = entryAnywhere ''
require('illuminate').configure({
filetypes_denylist = {
'dirvish',

View file

@ -14,7 +14,7 @@ in {
"modes-nvim"
];
vim.luaConfigRC.modes-nvim = entryAnywhere ''
vim.pluginRC.modes-nvim = entryAnywhere ''
require('modes').setup(${toLuaObject cfg.setupOpts})
'';
};

View file

@ -23,7 +23,7 @@ in {
treesitter.grammars = optionals tscfg.addDefaultGrammars defaultGrammars;
luaConfigRC.noice-nvim = entryAnywhere ''
pluginRC.noice-nvim = entryAnywhere ''
require("noice").setup(${toLuaObject cfg.setupOpts})
'';
};

View file

@ -13,7 +13,7 @@ in {
vim = {
startPlugins = ["nvim-notify"];
luaConfigRC.nvim-notify = entryAnywhere ''
pluginRC.nvim-notify = entryAnywhere ''
require('notify').setup(${toLuaObject cfg.setupOpts})
-- required to fix offset_encoding errors

View file

@ -13,7 +13,7 @@ in {
vim = {
startPlugins = ["smartcolumn"];
luaConfigRC.smartcolumn = entryAnywhere ''
pluginRC.smartcolumn = entryAnywhere ''
require("smartcolumn").setup(${toLuaObject cfg.setupOpts})
'';
};

View file

@ -11,7 +11,7 @@ in {
config = mkIf cfg.enable {
vim.startPlugins = ["cheatsheet-nvim"];
vim.luaConfigRC.cheaetsheet-nvim = entryAnywhere ''
vim.pluginRC.cheaetsheet-nvim = entryAnywhere ''
require('cheatsheet').setup({})
'';
};

View file

@ -13,7 +13,7 @@ in {
config = mkIf cfg.enable {
vim.startPlugins = ["which-key"];
vim.luaConfigRC.whichkey = entryAnywhere ''
vim.pluginRC.whichkey = entryAnywhere ''
local wk = require("which-key")
wk.setup ({
key_labels = {

View file

@ -13,7 +13,7 @@ in {
"ccc"
];
vim.luaConfigRC.ccc = entryAnywhere ''
vim.pluginRC.ccc = entryAnywhere ''
local ccc = require("ccc")
ccc.setup {
highlighter = {

View file

@ -25,7 +25,7 @@ in {
})
];
vim.luaConfigRC.gesture-nvim = entryAnywhere ''
vim.pluginRC.gesture-nvim = entryAnywhere ''
vim.opt.mouse = "a"
local gesture = require("gesture")

View file

@ -14,7 +14,7 @@ in {
"dressing-nvim"
];
vim.luaConfigRC.icon-picker = entryAnywhere ''
vim.pluginRC.icon-picker = entryAnywhere ''
require("icon-picker").setup({
disable_legacy_commands = true
})

View file

@ -19,7 +19,7 @@ in {
"magick"
];
luaConfigRC.image-nvim = entryAnywhere ''
pluginRC.image-nvim = entryAnywhere ''
require("image").setup(
${toLuaObject cfg.setupOpts}
)

View file

@ -19,7 +19,7 @@ in {
vim.maps.normal = mkSetBinding mappings.hop "<cmd> HopPattern<CR>";
vim.luaConfigRC.hop-nvim = entryAnywhere ''
vim.pluginRC.hop-nvim = entryAnywhere ''
require('hop').setup()
'';
};

View file

@ -37,7 +37,7 @@ in {
(mkBinding cfg.mappings.leapFromWindow "<Plug>(leap-from-window)" "Leap from window")
];
vim.luaConfigRC.leap-nvim = entryAnywhere ''
vim.pluginRC.leap-nvim = entryAnywhere ''
require('leap').opts = {
max_phase_one_targets = nil,
highlight_unlabeled_phase_one_targets = false,

View file

@ -25,7 +25,7 @@ in {
"<leader>pm" = "+Preview Markdown";
};
vim.luaConfigRC.glow = entryAnywhere ''
vim.pluginRC.glow = entryAnywhere ''
require('glow').setup({
glow_path = "${pkgs.glow}/bin/glow"
});

View file

@ -4,25 +4,23 @@
lib,
...
}: let
inherit (lib.strings) optionalString stringLength concatMapStringsSep;
inherit (lib.strings) stringLength concatMapStringsSep;
inherit (lib.modules) mkIf;
inherit (lib.nvim.vim) mkVimBool;
inherit (lib.nvim.dag) entryAnywhere;
cfg = config.vim.utility.preview.markdownPreview;
in {
config = mkIf cfg.enable {
vim.startPlugins = [pkgs.vimPlugins.markdown-preview-nvim];
vim.configRC.markdown-preview = entryAnywhere ''
let g:mkdp_auto_start = ${mkVimBool cfg.autoStart}
let g:mkdp_auto_close = ${mkVimBool cfg.autoClose}
let g:mkdp_refresh_slow = ${mkVimBool cfg.lazyRefresh}
let g:mkdp_filetypes = [${concatMapStringsSep ", " (x: "'" + x + "'") cfg.filetypes}]
let g:mkdp_command_for_global = ${mkVimBool cfg.alwaysAllowPreview}
let g:mkdp_open_to_the_world = ${mkVimBool cfg.broadcastServer}
${optionalString (stringLength cfg.customIP > 0) "let g:mkdp_open_ip = '${cfg.customIP}'"}
${optionalString (stringLength cfg.customPort > 0) "let g:mkdp_port = '${cfg.customPort}'"}
'';
vim.globals = {
mkdp_auto_start = cfg.autoStart;
mkdp_auto_close = cfg.autoClose;
mkdp_refresh_slow = cfg.lazyRefresh;
mkdp_filetypes = [(concatMapStringsSep ", " (x: "'" + x + "'") cfg.filetypes)];
mkdp_command_for_global = cfg.alwaysAllowPreview;
mkdp_open_to_the_world = cfg.broadcastServer;
mkdp_open_ip = mkIf (stringLength cfg.customIP > 0) cfg.customIP;
mkdp_port = mkIf (stringLength cfg.customPort > 0) cfg.customPort;
};
};
}

View file

@ -18,7 +18,7 @@ in {
"nvim-surround"
];
luaConfigRC.surround = entryAnywhere ''
pluginRC.surround = entryAnywhere ''
require('nvim-surround').setup()
'';

View file

@ -65,7 +65,7 @@ in {
"<leader>fvc" = "Commits";
};
vim.luaConfigRC.telescope = entryAnywhere ''
vim.pluginRC.telescope = entryAnywhere ''
local telescope = require('telescope')
telescope.setup(${toLuaObject cfg.setupOpts})

View file

@ -5,21 +5,14 @@
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
cfg = config.vim.utility.vim-wakatime;
in {
config = mkIf cfg.enable {
vim.startPlugins = [
pkgs.vimPlugins.vim-wakatime
];
vim.startPlugins = [pkgs.vimPlugins.vim-wakatime];
vim.configRC.vim-wakatime = entryAnywhere ''
${
if cfg.cli-package == null
then ""
else ''let g:wakatime_CLIPath = "${cfg.cli-package}"''
}
vim.pluginRC.vim-wakatime = mkIf (cfg.cli-package != null) ''
vim.g.wakatime_CLIPath = "${cfg.cli-package}"
'';
};
}

View file

@ -14,14 +14,14 @@ in {
config = mkIf cfg.enable (mkMerge [
(mkIf cfg.indentBlankline.enable {
vim.startPlugins = ["indent-blankline"];
vim.luaConfigRC.indent-blankline = entryAnywhere ''
vim.pluginRC.indent-blankline = entryAnywhere ''
require("ibl").setup(${toLuaObject cfg.indentBlankline.setupOpts})
'';
})
(mkIf cfg.cursorline.enable {
vim.startPlugins = ["nvim-cursorline"];
vim.luaConfigRC.cursorline = entryAnywhere ''
vim.pluginRC.cursorline = entryAnywhere ''
require('nvim-cursorline').setup {
cursorline = {
timeout = ${toString cfg.cursorline.lineTimeout},
@ -37,7 +37,7 @@ in {
(mkIf cfg.scrollBar.enable {
vim.startPlugins = ["scrollbar-nvim"];
vim.luaConfigRC.scrollBar = entryAnywhere ''
vim.pluginRC.scrollBar = entryAnywhere ''
require('scrollbar').setup{
excluded_filetypes = {
'prompt',
@ -56,7 +56,7 @@ in {
(mkIf cfg.smoothScroll.enable {
vim.startPlugins = ["cinnamon-nvim"];
vim.luaConfigRC.smoothScroll = entryAnywhere ''
vim.pluginRC.smoothScroll = entryAnywhere ''
require('cinnamon').setup()
'';
})
@ -66,7 +66,7 @@ in {
vim.maps.normal = mkBinding cfg.cellularAutomaton.mappings.makeItRain "<cmd>CellularAutomaton make_it_rain<CR>" "Make it rain";
vim.luaConfigRC.cellularAUtomaton = entryAnywhere ''
vim.pluginRC.cellularAUtomaton = entryAnywhere ''
local config = {
fps = 50,
name = 'slide',
@ -94,7 +94,7 @@ in {
(mkIf cfg.highlight-undo.enable {
vim.startPlugins = ["highlight-undo"];
vim.luaConfigRC.highlight-undo = entryAnywhere ''
vim.pluginRC.highlight-undo = entryAnywhere ''
require('highlight-undo').setup({
duration = ${toString cfg.highlight-undo.duration},
highlight_for_count = ${boolToString cfg.highlight-undo.highlightForCount},

View file

@ -12,7 +12,7 @@ in {
config = mkIf cfg.enable {
vim.startPlugins = ["fidget-nvim"];
vim.luaConfigRC.fidget-nvim = entryAnywhere ''
vim.pluginRC.fidget-nvim = entryAnywhere ''
require'fidget'.setup(${toLuaObject cfg.setupOpts})
'';
};