refactor: modified nixvim configuration to use bundled format with minimal config
This commit is contained in:
parent
8d2c1d921e
commit
6d3c87f9b5
37 changed files with 1839 additions and 1361 deletions
51
config/bundles/common.nix
Normal file
51
config/bundles/common.nix
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
namespace,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
inherit (lib.${namespace}) getAttrByNamespace mkOptionsWithNamespace enabled;
|
||||
base = "${namespace}.bundles.common";
|
||||
cfg = getAttrByNamespace config base;
|
||||
in {
|
||||
options = mkOptionsWithNamespace base {
|
||||
enable = mkEnableOption "common bundle";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
${namespace} = {
|
||||
languages = {
|
||||
cmp = enabled;
|
||||
conform = enabled;
|
||||
dap = enabled;
|
||||
luasnip = enabled;
|
||||
treesitter = enabled;
|
||||
};
|
||||
|
||||
navigation = {
|
||||
harpoon = enabled;
|
||||
nvim-tree = enabled;
|
||||
telescope = enabled;
|
||||
};
|
||||
|
||||
ui = {
|
||||
alpha = enabled;
|
||||
fidget = enabled;
|
||||
indent-blankline = enabled;
|
||||
lualine = enabled;
|
||||
noice = enabled;
|
||||
nvim-notify = enabled;
|
||||
};
|
||||
|
||||
utils = {
|
||||
lazygit = enabled;
|
||||
todo-comments = enabled;
|
||||
toggleterm = enabled;
|
||||
undotree = enabled;
|
||||
which-key = enabled;
|
||||
zenmode = enabled;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
5
config/bundles/default.nix
Normal file
5
config/bundles/default.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{...} @ inputs: {
|
||||
imports = [
|
||||
(import ./common.nix inputs)
|
||||
];
|
||||
}
|
||||
|
|
@ -1,9 +1,11 @@
|
|||
{
|
||||
{...} @ inputs: {
|
||||
imports = [
|
||||
./languages
|
||||
./navigation
|
||||
./ui
|
||||
./utils
|
||||
(import ./bundles inputs)
|
||||
|
||||
(import ./languages inputs)
|
||||
(import ./navigation inputs)
|
||||
(import ./ui inputs)
|
||||
(import ./utils inputs)
|
||||
|
||||
./autocmds.nix
|
||||
./mappings.nix
|
||||
|
|
|
|||
|
|
@ -1,4 +1,19 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
namespace,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
inherit (lib.${namespace}) getAttrByNamespace mkOptionsWithNamespace;
|
||||
base = "${namespace}.languages.cmp";
|
||||
cfg = getAttrByNamespace config base;
|
||||
in {
|
||||
options = mkOptionsWithNamespace base {
|
||||
enable = mkEnableOption "nvim-cmp";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
plugins = {
|
||||
cmp = {
|
||||
enable = true;
|
||||
|
|
@ -104,4 +119,5 @@
|
|||
}),
|
||||
})
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,20 @@
|
|||
{lib, ...}: let
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
namespace,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
inherit (lib.${namespace}) getAttrByNamespace mkOptionsWithNamespace;
|
||||
inherit (lib.nixvim.utils) listToUnkeyedAttrs;
|
||||
base = "${namespace}.languages.conform";
|
||||
cfg = getAttrByNamespace config base;
|
||||
in {
|
||||
options = mkOptionsWithNamespace base {
|
||||
enable = mkEnableOption "conform";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
keymaps = [
|
||||
{
|
||||
mode = "n";
|
||||
|
|
@ -101,4 +115,5 @@ in {
|
|||
end
|
||||
end, { desc = "Toggle autoformat-on-save", bang = true })
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,20 @@
|
|||
{pkgs, ...}: {
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
namespace,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
inherit (lib.${namespace}) getAttrByNamespace mkOptionsWithNamespace;
|
||||
base = "${namespace}.languages.dap";
|
||||
cfg = getAttrByNamespace config base;
|
||||
in {
|
||||
options = mkOptionsWithNamespace base {
|
||||
enable = mkEnableOption "dap";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
keymaps = [
|
||||
{
|
||||
mode = "n";
|
||||
|
|
@ -359,4 +375,5 @@
|
|||
settings.codelldb_path = "${pkgs.vscode-extensions.vadimcn.vscode-lldb}/share/vscode/extensions/vadimcn.vscode-lldb/adapter/codelldb";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,12 @@
|
|||
{
|
||||
{...} @ inputs: {
|
||||
imports = [
|
||||
./cmp.nix
|
||||
./conform.nix
|
||||
./dap.nix
|
||||
./lsp.nix
|
||||
./lspkind.nix
|
||||
./lspsaga.nix
|
||||
./luasnip.nix
|
||||
./treesitter.nix
|
||||
(import ./lsp inputs)
|
||||
|
||||
(import ./cmp.nix inputs)
|
||||
(import ./conform.nix inputs)
|
||||
(import ./dap.nix inputs)
|
||||
(import ./luasnip.nix inputs)
|
||||
(import ./treesitter.nix inputs)
|
||||
];
|
||||
|
||||
plugins = {
|
||||
|
|
|
|||
|
|
@ -1,64 +0,0 @@
|
|||
{pkgs, ...}: {
|
||||
plugins = {
|
||||
lsp = {
|
||||
enable = true;
|
||||
capabilities = "offsetEncoding = 'utf-16'";
|
||||
servers = {
|
||||
astro.enable = true;
|
||||
clangd.enable = true;
|
||||
csharp_ls.enable = true;
|
||||
gopls.enable = true;
|
||||
hls = {
|
||||
enable = true;
|
||||
installGhc = false;
|
||||
package = pkgs.haskell-language-server.override {supportedGhcVersions = ["98" "910"];};
|
||||
};
|
||||
jdtls.enable = true;
|
||||
lua_ls.enable = true;
|
||||
nixd.enable = true;
|
||||
pylsp = {
|
||||
enable = true;
|
||||
settings.configurationSources = "pycodestyle";
|
||||
settings = {
|
||||
plugins = {
|
||||
pyflakes.enabled = true;
|
||||
mccabe.enabled = true;
|
||||
pycodestyle.enabled = true;
|
||||
pydocstyle.enabled = true;
|
||||
yapf.enabled = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
sqls.enable = true;
|
||||
zls.enable = true;
|
||||
};
|
||||
};
|
||||
rustaceanvim.enable = true;
|
||||
typescript-tools.enable = true;
|
||||
};
|
||||
|
||||
extraConfigLua = ''
|
||||
local _border = "rounded"
|
||||
|
||||
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(
|
||||
vim.lsp.handlers.hover, {
|
||||
border = _border;
|
||||
}
|
||||
)
|
||||
|
||||
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(
|
||||
vim.lsp.handlers.signature_help, {
|
||||
border = _border;
|
||||
}
|
||||
)
|
||||
|
||||
vim.diagnostic.config {
|
||||
float = { border=_border };
|
||||
virtual_text = true;
|
||||
};
|
||||
|
||||
require('lspconfig.ui.windows').default_options = {
|
||||
border = _border;
|
||||
}
|
||||
'';
|
||||
}
|
||||
86
config/languages/lsp/default.nix
Normal file
86
config/languages/lsp/default.nix
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
namespace,
|
||||
pkgs,
|
||||
...
|
||||
} @ inputs: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
inherit (lib.${namespace}) getAttrByNamespace mkOptionsWithNamespace;
|
||||
base = "${namespace}.languages.lsp";
|
||||
cfg = getAttrByNamespace config base;
|
||||
in {
|
||||
imports = [
|
||||
(import ./lspkind.nix inputs)
|
||||
(import ./lspsaga.nix inputs)
|
||||
];
|
||||
|
||||
options = mkOptionsWithNamespace base {
|
||||
enable = mkEnableOption "lsp";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
plugins = {
|
||||
lsp = {
|
||||
enable = true;
|
||||
capabilities = "offsetEncoding = 'utf-16'";
|
||||
servers = {
|
||||
astro.enable = true;
|
||||
clangd.enable = true;
|
||||
csharp_ls.enable = true;
|
||||
gopls.enable = true;
|
||||
hls = {
|
||||
enable = true;
|
||||
installGhc = false;
|
||||
package = pkgs.haskell-language-server.override {supportedGhcVersions = ["98" "910"];};
|
||||
};
|
||||
jdtls.enable = true;
|
||||
lua_ls.enable = true;
|
||||
nixd.enable = true;
|
||||
pylsp = {
|
||||
enable = true;
|
||||
settings.configurationSources = "pycodestyle";
|
||||
settings = {
|
||||
plugins = {
|
||||
pyflakes.enabled = true;
|
||||
mccabe.enabled = true;
|
||||
pycodestyle.enabled = true;
|
||||
pydocstyle.enabled = true;
|
||||
yapf.enabled = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
sqls.enable = true;
|
||||
zls.enable = true;
|
||||
};
|
||||
};
|
||||
rustaceanvim.enable = true;
|
||||
typescript-tools.enable = true;
|
||||
};
|
||||
|
||||
extraConfigLua = ''
|
||||
local _border = "rounded"
|
||||
|
||||
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(
|
||||
vim.lsp.handlers.hover, {
|
||||
border = _border;
|
||||
}
|
||||
)
|
||||
|
||||
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(
|
||||
vim.lsp.handlers.signature_help, {
|
||||
border = _border;
|
||||
}
|
||||
)
|
||||
|
||||
vim.diagnostic.config {
|
||||
float = { border=_border };
|
||||
virtual_text = true;
|
||||
};
|
||||
|
||||
require('lspconfig.ui.windows').default_options = {
|
||||
border = _border;
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
||||
20
config/languages/lsp/lspkind.nix
Executable file
20
config/languages/lsp/lspkind.nix
Executable file
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
namespace,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
inherit (lib.${namespace}) getAttrByNamespace;
|
||||
cfg = getAttrByNamespace config "${namespace}.languages.lsp";
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
plugins.lspkind = {
|
||||
enable = true;
|
||||
extraOptions = {
|
||||
maxwidth = 50;
|
||||
ellipsis_char = "...";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
155
config/languages/lsp/lspsaga.nix
Executable file
155
config/languages/lsp/lspsaga.nix
Executable file
|
|
@ -0,0 +1,155 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
namespace,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
inherit (lib.${namespace}) getAttrByNamespace;
|
||||
cfg = getAttrByNamespace config "${namespace}.languages.lsp";
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
keymaps = [
|
||||
{
|
||||
mode = "n";
|
||||
key = "gd";
|
||||
action = "<cmd>Lspsaga finder def<cr>";
|
||||
options = {
|
||||
desc = "Goto Definition";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "gr";
|
||||
action = "<cmd>Lspsaga finder ref<cr>";
|
||||
options = {
|
||||
desc = "Goto References";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "gI";
|
||||
action = "<cmd>Lspsaga finder imp<cr>";
|
||||
options = {
|
||||
desc = "Goto Implementation";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "gT";
|
||||
action = "<cmd>Lspsaga peek_type_definition<cr>";
|
||||
options = {
|
||||
desc = "Type Definition";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "K";
|
||||
action = "<cmd>Lspsaga hover_doc<cr>";
|
||||
options = {
|
||||
desc = "Hover";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>cw";
|
||||
action = "<cmd>Lspsaga outline<cr>";
|
||||
options = {
|
||||
desc = "Outline";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>cr";
|
||||
action = "<cmd>Lspsaga rename<cr>";
|
||||
options = {
|
||||
desc = "Rename";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>ca";
|
||||
action = "<cmd>Lspsaga code_action<cr>";
|
||||
options = {
|
||||
desc = "Code Action";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
];
|
||||
|
||||
plugins.lspsaga = {
|
||||
enable = true;
|
||||
beacon = {
|
||||
enable = true;
|
||||
};
|
||||
ui = {
|
||||
border = "rounded";
|
||||
codeAction = "💡";
|
||||
};
|
||||
hover = {
|
||||
openCmd = "!floorp";
|
||||
openLink = "gx";
|
||||
};
|
||||
diagnostic = {
|
||||
borderFollow = true;
|
||||
diagnosticOnlyCurrent = false;
|
||||
showCodeAction = true;
|
||||
};
|
||||
symbolInWinbar = {
|
||||
enable = true;
|
||||
};
|
||||
codeAction = {
|
||||
extendGitSigns = false;
|
||||
showServerName = true;
|
||||
onlyInCursor = true;
|
||||
numShortcut = true;
|
||||
keys = {
|
||||
exec = "<cr>";
|
||||
quit = ["<Esc>" "q"];
|
||||
};
|
||||
};
|
||||
lightbulb = {
|
||||
enable = false;
|
||||
sign = false;
|
||||
virtualText = true;
|
||||
};
|
||||
implement.enable = false;
|
||||
rename = {
|
||||
autoSave = false;
|
||||
keys = {
|
||||
exec = "<cr>";
|
||||
quit = ["<C-k>" "<Esc>"];
|
||||
select = "x";
|
||||
};
|
||||
};
|
||||
outline = {
|
||||
autoClose = true;
|
||||
autoPreview = true;
|
||||
closeAfterJump = true;
|
||||
layout = "normal";
|
||||
winPosition = "right";
|
||||
keys = {
|
||||
jump = "e";
|
||||
quit = "q";
|
||||
toggleOrJump = "o";
|
||||
};
|
||||
};
|
||||
scrollPreview = {
|
||||
scrollDown = "<C-f>";
|
||||
scrollUp = "<C-b>";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
{
|
||||
plugins.lspkind = {
|
||||
enable = true;
|
||||
extraOptions = {
|
||||
maxwidth = 50;
|
||||
ellipsis_char = "...";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,144 +0,0 @@
|
|||
{
|
||||
keymaps = [
|
||||
{
|
||||
mode = "n";
|
||||
key = "gd";
|
||||
action = "<cmd>Lspsaga finder def<cr>";
|
||||
options = {
|
||||
desc = "Goto Definition";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "gr";
|
||||
action = "<cmd>Lspsaga finder ref<cr>";
|
||||
options = {
|
||||
desc = "Goto References";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "gI";
|
||||
action = "<cmd>Lspsaga finder imp<cr>";
|
||||
options = {
|
||||
desc = "Goto Implementation";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "gT";
|
||||
action = "<cmd>Lspsaga peek_type_definition<cr>";
|
||||
options = {
|
||||
desc = "Type Definition";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "K";
|
||||
action = "<cmd>Lspsaga hover_doc<cr>";
|
||||
options = {
|
||||
desc = "Hover";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>cw";
|
||||
action = "<cmd>Lspsaga outline<cr>";
|
||||
options = {
|
||||
desc = "Outline";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>cr";
|
||||
action = "<cmd>Lspsaga rename<cr>";
|
||||
options = {
|
||||
desc = "Rename";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>ca";
|
||||
action = "<cmd>Lspsaga code_action<cr>";
|
||||
options = {
|
||||
desc = "Code Action";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
];
|
||||
|
||||
plugins.lspsaga = {
|
||||
enable = true;
|
||||
beacon = {
|
||||
enable = true;
|
||||
};
|
||||
ui = {
|
||||
border = "rounded";
|
||||
codeAction = "💡";
|
||||
};
|
||||
hover = {
|
||||
openCmd = "!floorp";
|
||||
openLink = "gx";
|
||||
};
|
||||
diagnostic = {
|
||||
borderFollow = true;
|
||||
diagnosticOnlyCurrent = false;
|
||||
showCodeAction = true;
|
||||
};
|
||||
symbolInWinbar = {
|
||||
enable = true;
|
||||
};
|
||||
codeAction = {
|
||||
extendGitSigns = false;
|
||||
showServerName = true;
|
||||
onlyInCursor = true;
|
||||
numShortcut = true;
|
||||
keys = {
|
||||
exec = "<cr>";
|
||||
quit = ["<Esc>" "q"];
|
||||
};
|
||||
};
|
||||
lightbulb = {
|
||||
enable = false;
|
||||
sign = false;
|
||||
virtualText = true;
|
||||
};
|
||||
implement.enable = false;
|
||||
rename = {
|
||||
autoSave = false;
|
||||
keys = {
|
||||
exec = "<cr>";
|
||||
quit = ["<C-k>" "<Esc>"];
|
||||
select = "x";
|
||||
};
|
||||
};
|
||||
outline = {
|
||||
autoClose = true;
|
||||
autoPreview = true;
|
||||
closeAfterJump = true;
|
||||
layout = "normal";
|
||||
winPosition = "right";
|
||||
keys = {
|
||||
jump = "e";
|
||||
quit = "q";
|
||||
toggleOrJump = "o";
|
||||
};
|
||||
};
|
||||
scrollPreview = {
|
||||
scrollDown = "<C-f>";
|
||||
scrollUp = "<C-b>";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,4 +1,20 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
namespace,
|
||||
...
|
||||
}: let
|
||||
inherit (builtins) readDir;
|
||||
inherit (lib) mkIf mkEnableOption filter match attrNames concatStringsSep;
|
||||
inherit (lib.${namespace}) getAttrByNamespace mkOptionsWithNamespace;
|
||||
base = "${namespace}.languages.luasnip";
|
||||
cfg = getAttrByNamespace config base;
|
||||
in {
|
||||
options = mkOptionsWithNamespace base {
|
||||
enable = mkEnableOption "luasnip";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
plugins.luasnip = {
|
||||
enable = true;
|
||||
|
||||
|
|
@ -32,17 +48,14 @@
|
|||
}
|
||||
];
|
||||
|
||||
# Core snippet configuration and definitions
|
||||
# Uses unified snippets config from ../snippets/default.nix for all LuaSnip setup.
|
||||
# Use the unified snippets config for LuaSnip
|
||||
extraConfigLua = let
|
||||
snippetDir = ../languages/snippets;
|
||||
snippetFiles =
|
||||
builtins.filter
|
||||
(name: builtins.match ".*\\.nix$" name != null)
|
||||
(builtins.attrNames (builtins.readDir snippetDir));
|
||||
snippetConfigs = map (file: (import (snippetDir + "/${file}")).extraConfigLua) snippetFiles;
|
||||
allSnippets = builtins.concatStringsSep "\n" snippetConfigs;
|
||||
snippets =
|
||||
readDir ../languages/snippets
|
||||
|> attrNames
|
||||
|> filter (name: match ".*\\.nix$" name != null)
|
||||
|> map (name: ../languages/snippets + "/${name}")
|
||||
|> map (file: (import file).extraConfigLua)
|
||||
|> concatStringsSep "\n";
|
||||
in ''
|
||||
-- Get comment string for current filetype
|
||||
local function get_comment_string()
|
||||
|
|
@ -118,6 +131,7 @@
|
|||
is_test_file = is_test_file
|
||||
}
|
||||
|
||||
${allSnippets}
|
||||
${snippets}
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,19 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
namespace,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
inherit (lib.${namespace}) getAttrByNamespace mkOptionsWithNamespace;
|
||||
base = "${namespace}.languages.treesitter";
|
||||
cfg = getAttrByNamespace config base;
|
||||
in {
|
||||
options = mkOptionsWithNamespace base {
|
||||
enable = mkEnableOption "treesitter";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
plugins.treesitter = {
|
||||
enable = true;
|
||||
folding = true;
|
||||
|
|
@ -6,4 +21,5 @@
|
|||
enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
{...} @ inputs: {
|
||||
imports = [
|
||||
./harpoon.nix
|
||||
./nvim-tree.nix
|
||||
./telescope.nix
|
||||
(import ./harpoon.nix inputs)
|
||||
(import ./nvim-tree.nix inputs)
|
||||
(import ./telescope.nix inputs)
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,19 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
namespace,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
inherit (lib.${namespace}) getAttrByNamespace mkOptionsWithNamespace;
|
||||
base = "${namespace}.navigation.harpoon";
|
||||
cfg = getAttrByNamespace config base;
|
||||
in {
|
||||
options = mkOptionsWithNamespace base {
|
||||
enable = mkEnableOption "harpoon";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
keymaps = [
|
||||
{
|
||||
mode = "n";
|
||||
|
|
@ -41,4 +56,5 @@
|
|||
local harpoon = require("harpoon")
|
||||
harpoon:setup({ settings = { save_on_toggle = true }})
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,19 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
namespace,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
inherit (lib.${namespace}) getAttrByNamespace mkOptionsWithNamespace;
|
||||
base = "${namespace}.navigation.nvim-tree";
|
||||
cfg = getAttrByNamespace config base;
|
||||
in {
|
||||
options = mkOptionsWithNamespace base {
|
||||
enable = mkEnableOption "nvim-tree";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
keymaps = [
|
||||
{
|
||||
mode = "n";
|
||||
|
|
@ -74,4 +89,5 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,19 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
namespace,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
inherit (lib.${namespace}) getAttrByNamespace mkOptionsWithNamespace;
|
||||
base = "${namespace}.navigation.telescope";
|
||||
cfg = getAttrByNamespace config base;
|
||||
in {
|
||||
options = mkOptionsWithNamespace base {
|
||||
enable = mkEnableOption "telescope";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
keymaps = [
|
||||
{
|
||||
mode = "n";
|
||||
|
|
@ -90,4 +105,5 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,23 @@
|
|||
{
|
||||
plugins.alpha = {
|
||||
config,
|
||||
lib,
|
||||
namespace,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
inherit (lib.${namespace}) getAttrByNamespace mkOptionsWithNamespace;
|
||||
base = "${namespace}.ui.alpha";
|
||||
cfg = getAttrByNamespace config base;
|
||||
in {
|
||||
options = mkOptionsWithNamespace base {
|
||||
enable = mkEnableOption "alpha";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
plugins = {
|
||||
persistence.enable = true;
|
||||
|
||||
alpha = {
|
||||
enable = true;
|
||||
theme = null;
|
||||
layout = let
|
||||
|
|
@ -71,4 +89,6 @@
|
|||
(mkButton " Quit Neovim" "q" "<CMD>qa<CR>")
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
{pkgs, ...}: {
|
||||
{pkgs, ...} @ inputs: {
|
||||
imports = [
|
||||
./alpha.nix
|
||||
./fidget.nix
|
||||
./indent-blankline.nix
|
||||
./lualine.nix
|
||||
./noice.nix
|
||||
./nvim-notify.nix
|
||||
(import ./alpha.nix inputs)
|
||||
(import ./fidget.nix inputs)
|
||||
(import ./indent-blankline.nix inputs)
|
||||
(import ./lualine.nix inputs)
|
||||
(import ./noice.nix inputs)
|
||||
(import ./nvim-notify.nix inputs)
|
||||
];
|
||||
|
||||
colorschemes.tokyonight = {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,19 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
namespace,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
inherit (lib.${namespace}) getAttrByNamespace mkOptionsWithNamespace;
|
||||
base = "${namespace}.ui.fidget";
|
||||
cfg = getAttrByNamespace config base;
|
||||
in {
|
||||
options = mkOptionsWithNamespace base {
|
||||
enable = mkEnableOption "fidget";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
plugins.fidget = {
|
||||
enable = true;
|
||||
|
||||
|
|
@ -95,4 +110,5 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,22 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
namespace,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
inherit (lib.${namespace}) getAttrByNamespace mkOptionsWithNamespace;
|
||||
base = "${namespace}.ui.indent-blankline";
|
||||
cfg = getAttrByNamespace config base;
|
||||
in {
|
||||
options = mkOptionsWithNamespace base {
|
||||
enable = mkEnableOption "indent-blankline";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
plugins.indent-blankline = {
|
||||
enable = true;
|
||||
settings.scope.enabled = false;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,19 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
namespace,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
inherit (lib.${namespace}) getAttrByNamespace mkOptionsWithNamespace;
|
||||
base = "${namespace}.ui.lualine";
|
||||
cfg = getAttrByNamespace config base;
|
||||
in {
|
||||
options = mkOptionsWithNamespace base {
|
||||
enable = mkEnableOption "lualine";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
plugins.lualine = {
|
||||
enable = true;
|
||||
|
||||
|
|
@ -48,4 +63,5 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,19 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
namespace,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
inherit (lib.${namespace}) getAttrByNamespace mkOptionsWithNamespace;
|
||||
base = "${namespace}.ui.noice";
|
||||
cfg = getAttrByNamespace config base;
|
||||
in {
|
||||
options = mkOptionsWithNamespace base {
|
||||
enable = mkEnableOption "noice";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
plugins.noice = {
|
||||
enable = true;
|
||||
|
||||
|
|
@ -32,4 +47,5 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,19 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
namespace,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
inherit (lib.${namespace}) getAttrByNamespace mkOptionsWithNamespace;
|
||||
base = "${namespace}.ui.nvim-notify";
|
||||
cfg = getAttrByNamespace config base;
|
||||
in {
|
||||
options = mkOptionsWithNamespace base {
|
||||
enable = mkEnableOption "nvim-notify";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
keymaps = [
|
||||
{
|
||||
mode = "n";
|
||||
|
|
@ -44,4 +59,5 @@
|
|||
return notify(message, level, merged_opts)
|
||||
end
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,16 +1,12 @@
|
|||
{
|
||||
{...} @ inputs: {
|
||||
imports = [
|
||||
./lazygit.nix
|
||||
./obsidian.nix
|
||||
./todo-comments.nix
|
||||
./toggleterm.nix
|
||||
./undotree.nix
|
||||
./vimtex.nix
|
||||
./zenmode.nix
|
||||
(import ./lazygit.nix inputs)
|
||||
(import ./obsidian.nix inputs)
|
||||
(import ./todo-comments.nix inputs)
|
||||
(import ./toggleterm.nix inputs)
|
||||
(import ./undotree.nix inputs)
|
||||
(import ./vimtex.nix inputs)
|
||||
(import ./which-key.nix inputs)
|
||||
(import ./zenmode.nix inputs)
|
||||
];
|
||||
|
||||
plugins = {
|
||||
persistence.enable = true;
|
||||
which-key.enable = true;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,19 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
namespace,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
inherit (lib.${namespace}) getAttrByNamespace mkOptionsWithNamespace;
|
||||
base = "${namespace}.utils.lazygit";
|
||||
cfg = getAttrByNamespace config base;
|
||||
in {
|
||||
options = mkOptionsWithNamespace base {
|
||||
enable = mkEnableOption "lazygit";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
keymaps = [
|
||||
{
|
||||
mode = "n";
|
||||
|
|
@ -11,4 +26,5 @@
|
|||
plugins = {
|
||||
lazygit.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,19 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
namespace,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
inherit (lib.${namespace}) getAttrByNamespace mkOptionsWithNamespace;
|
||||
base = "${namespace}.utils.obsidian";
|
||||
cfg = getAttrByNamespace config base;
|
||||
in {
|
||||
options = mkOptionsWithNamespace base {
|
||||
enable = mkEnableOption "obsidian";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
plugins = {
|
||||
obsidian = {
|
||||
enable = true;
|
||||
|
|
@ -12,4 +27,5 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,19 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
namespace,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
inherit (lib.${namespace}) getAttrByNamespace mkOptionsWithNamespace;
|
||||
base = "${namespace}.utils.todo-comments";
|
||||
cfg = getAttrByNamespace config base;
|
||||
in {
|
||||
options = mkOptionsWithNamespace base {
|
||||
enable = mkEnableOption "todo-comments";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
keymaps = [
|
||||
{
|
||||
mode = "n";
|
||||
|
|
@ -11,4 +26,5 @@
|
|||
plugins = {
|
||||
todo-comments.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,19 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
namespace,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
inherit (lib.${namespace}) getAttrByNamespace mkOptionsWithNamespace;
|
||||
base = "${namespace}.utils.toggleterm";
|
||||
cfg = getAttrByNamespace config base;
|
||||
in {
|
||||
options = mkOptionsWithNamespace base {
|
||||
enable = mkEnableOption "toggleterm";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
plugins.toggleterm = {
|
||||
enable = true;
|
||||
|
||||
|
|
@ -11,4 +26,5 @@
|
|||
winbar.enabled = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,19 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
namespace,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
inherit (lib.${namespace}) getAttrByNamespace mkOptionsWithNamespace;
|
||||
base = "${namespace}.utils.undotree";
|
||||
cfg = getAttrByNamespace config base;
|
||||
in {
|
||||
options = mkOptionsWithNamespace base {
|
||||
enable = mkEnableOption "undotree";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
keymaps = [
|
||||
{
|
||||
mode = "n";
|
||||
|
|
@ -17,4 +32,5 @@
|
|||
SplitWidth = 40;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,20 @@
|
|||
{pkgs, ...}: {
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
namespace,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
inherit (lib.${namespace}) getAttrByNamespace mkOptionsWithNamespace;
|
||||
base = "${namespace}.utils.vimtex";
|
||||
cfg = getAttrByNamespace config base;
|
||||
in {
|
||||
options = mkOptionsWithNamespace base {
|
||||
enable = mkEnableOption "vimtex";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
plugins.vimtex = {
|
||||
enable = true;
|
||||
texlivePackage = pkgs.texliveFull;
|
||||
|
|
@ -7,4 +23,5 @@
|
|||
view_method = "zathura";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
21
config/utils/which-key.nix
Normal file
21
config/utils/which-key.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
namespace,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
inherit (lib.${namespace}) getAttrByNamespace mkOptionsWithNamespace;
|
||||
base = "${namespace}.utils.which-key";
|
||||
cfg = getAttrByNamespace config base;
|
||||
in {
|
||||
options = mkOptionsWithNamespace base {
|
||||
enable = mkEnableOption "which-key";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
plugins = {
|
||||
which-key.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,4 +1,19 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
namespace,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
inherit (lib.${namespace}) getAttrByNamespace mkOptionsWithNamespace;
|
||||
base = "${namespace}.utils.zenmode";
|
||||
cfg = getAttrByNamespace config base;
|
||||
in {
|
||||
options = mkOptionsWithNamespace base {
|
||||
enable = mkEnableOption "zenmode";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
keymaps = [
|
||||
{
|
||||
mode = "n";
|
||||
|
|
@ -11,4 +26,5 @@
|
|||
enable = true;
|
||||
settings.window.width = 150;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
63
flake.nix
63
flake.nix
|
|
@ -19,22 +19,6 @@
|
|||
system: let
|
||||
namespace = "yumevim";
|
||||
|
||||
pkgs = import nixpkgs {inherit system;};
|
||||
mergedLib = pkgs.lib.extend (final: prev: {${namespace} = import ./lib {lib = pkgs.lib;};});
|
||||
|
||||
nixvimLib = nixvim.lib.${system};
|
||||
nixvim' = nixvim.legacyPackages.${system};
|
||||
nixvimModule = {
|
||||
inherit pkgs;
|
||||
module = import ./config;
|
||||
extraSpecialArgs = {
|
||||
lib = mergedLib.extend nixvim.lib.overlay;
|
||||
namespace = namespace;
|
||||
};
|
||||
};
|
||||
|
||||
nvim = nixvim'.makeNixvimWithModule nixvimModule;
|
||||
|
||||
treefmtConfig = {...}: {
|
||||
projectRootFile = "flake.nix";
|
||||
programs = {
|
||||
|
|
@ -42,13 +26,50 @@
|
|||
};
|
||||
};
|
||||
treefmtEval = treefmt-nix.lib.evalModule pkgs (treefmtConfig {inherit pkgs;});
|
||||
in {
|
||||
checks = {
|
||||
default = nixvimLib.check.mkTestDerivationFromNixvimModule nixvimModule;
|
||||
treefmt = treefmtEval.config.build.check self;
|
||||
|
||||
pkgs = import nixpkgs {inherit system;};
|
||||
mergedLib = pkgs.lib.extend (final: prev: {${namespace} = import ./lib {lib = pkgs.lib;};});
|
||||
|
||||
nixvimLib = nixvim.lib.${system};
|
||||
nixvim' = nixvim.legacyPackages.${system};
|
||||
mkNixvimProfile = custom: {
|
||||
module = {
|
||||
imports = [./config];
|
||||
|
||||
${namespace} = pkgs.lib.mkMerge [
|
||||
{
|
||||
bundles.common.enable = true;
|
||||
}
|
||||
custom
|
||||
];
|
||||
};
|
||||
|
||||
packages.default = nvim;
|
||||
extraSpecialArgs = {
|
||||
inherit namespace pkgs;
|
||||
lib = mergedLib.extend nixvim.lib.overlay;
|
||||
};
|
||||
};
|
||||
|
||||
minimal = mkNixvimProfile {};
|
||||
|
||||
full = mkNixvimProfile {
|
||||
languages = {
|
||||
lsp.enable = true;
|
||||
};
|
||||
utils = {
|
||||
obsidian.enable = true;
|
||||
};
|
||||
};
|
||||
in {
|
||||
checks = {
|
||||
treefmt = treefmtEval.config.build.check self;
|
||||
minimal = nixvimLib.check.mkTestDerivationFromNixvimModule minimal;
|
||||
};
|
||||
|
||||
packages = {
|
||||
default = nixvim'.makeNixvimWithModule minimal;
|
||||
full = nixvim'.makeNixvimWithModule full;
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue