mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-01-08 11:47:18 +00:00
modules: add comments; formatting
This commit is contained in:
parent
4eb26c0d98
commit
7c66ea2e05
4 changed files with 39 additions and 34 deletions
|
|
@ -1,32 +1,32 @@
|
||||||
{lib, ...}: let
|
{lib, ...}: let
|
||||||
inherit (lib) mkOption types;
|
inherit (lib) mkOption types;
|
||||||
inherit (lib) nvim;
|
inherit (lib) nvim;
|
||||||
inherit (nvim.bool) mkBool;
|
inherit (nvim.modules) mkBoolOption;
|
||||||
|
|
||||||
# Most of the keybindings code is highly inspired by pta2002/nixvim. Thank you!
|
# Most of the keybindings code is highly inspired by pta2002/nixvim. Thank you!
|
||||||
mapConfigOptions = {
|
mapConfigOptions = {
|
||||||
silent =
|
silent =
|
||||||
mkBool false
|
mkBoolOption false
|
||||||
"Whether this mapping should be silent. Equivalent to adding <silent> to a map.";
|
"Whether this mapping should be silent. Equivalent to adding <silent> to a map.";
|
||||||
|
|
||||||
nowait =
|
nowait =
|
||||||
mkBool false
|
mkBoolOption false
|
||||||
"Whether to wait for extra input on ambiguous mappings. Equivalent to adding <nowait> to a map.";
|
"Whether to wait for extra input on ambiguous mappings. Equivalent to adding <nowait> to a map.";
|
||||||
|
|
||||||
script =
|
script =
|
||||||
mkBool false
|
mkBoolOption false
|
||||||
"Equivalent to adding <script> to a map.";
|
"Equivalent to adding <script> to a map.";
|
||||||
|
|
||||||
expr =
|
expr =
|
||||||
mkBool false
|
mkBoolOption false
|
||||||
"Means that the action is actually an expression. Equivalent to adding <expr> to a map.";
|
"Means that the action is actually an expression. Equivalent to adding <expr> to a map.";
|
||||||
|
|
||||||
unique =
|
unique =
|
||||||
mkBool false
|
mkBoolOption false
|
||||||
"Whether to fail if the map is already defined. Equivalent to adding <unique> to a map.";
|
"Whether to fail if the map is already defined. Equivalent to adding <unique> to a map.";
|
||||||
|
|
||||||
noremap =
|
noremap =
|
||||||
mkBool true
|
mkBoolOption true
|
||||||
"Whether to use the 'noremap' variant of the command, ignoring any custom mappings on the defined action. It is highly advised to keep this on, which is the default.";
|
"Whether to use the 'noremap' variant of the command, ignoring any custom mappings on the defined action. It is highly advised to keep this on, which is the default.";
|
||||||
|
|
||||||
desc = mkOption {
|
desc = mkOption {
|
||||||
|
|
|
||||||
|
|
@ -6,11 +6,12 @@ inputs: {
|
||||||
extraSpecialArgs ? {},
|
extraSpecialArgs ? {},
|
||||||
}: let
|
}: let
|
||||||
inherit (builtins) map filter isString toString getAttr;
|
inherit (builtins) map filter isString toString getAttr;
|
||||||
inherit (pkgs) wrapNeovim vimPlugins;
|
inherit (lib.asserts) assertMsg;
|
||||||
inherit (pkgs.vimUtils) buildVimPlugin;
|
|
||||||
|
|
||||||
|
# extend nixpkgs.lib with our own set of functions
|
||||||
extendedLib = import ../lib/stdlib-extended.nix lib;
|
extendedLib = import ../lib/stdlib-extended.nix lib;
|
||||||
|
|
||||||
|
# define neovim modules that will be used to configure neovim
|
||||||
nvimModules = import ./modules.nix {
|
nvimModules = import ./modules.nix {
|
||||||
inherit check pkgs;
|
inherit check pkgs;
|
||||||
lib = extendedLib;
|
lib = extendedLib;
|
||||||
|
|
@ -23,10 +24,13 @@ inputs: {
|
||||||
|
|
||||||
vimOptions = module.config.vim;
|
vimOptions = module.config.vim;
|
||||||
|
|
||||||
|
inherit (pkgs) wrapNeovim vimPlugins;
|
||||||
|
inherit (pkgs.vimUtils) buildVimPlugin;
|
||||||
|
|
||||||
extraLuaPackages = ps: map (x: ps.${x}) vimOptions.luaPackages;
|
extraLuaPackages = ps: map (x: ps.${x}) vimOptions.luaPackages;
|
||||||
|
|
||||||
buildPlug = {pname, ...} @ args:
|
buildPlug = {pname, ...} @ args:
|
||||||
assert lib.asserts.assertMsg (pname != "nvim-treesitter") "Use buildTreesitterPlug for building nvim-treesitter.";
|
assert assertMsg (pname != "nvim-treesitter") "Use buildTreesitterPlug for building nvim-treesitter.";
|
||||||
buildVimPlugin (args
|
buildVimPlugin (args
|
||||||
// {
|
// {
|
||||||
version = "master";
|
version = "master";
|
||||||
|
|
@ -57,6 +61,10 @@ inputs: {
|
||||||
(f: f != null)
|
(f: f != null)
|
||||||
plugins);
|
plugins);
|
||||||
|
|
||||||
|
# configure the neovim wrapper
|
||||||
|
# for details on how to use the wrapper, see:
|
||||||
|
# - https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/neovim/wrapper.nix
|
||||||
|
# - https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/neovim/utils.nix
|
||||||
neovim = wrapNeovim vimOptions.package {
|
neovim = wrapNeovim vimOptions.package {
|
||||||
inherit (vimOptions) viAlias;
|
inherit (vimOptions) viAlias;
|
||||||
inherit (vimOptions) vimAlias;
|
inherit (vimOptions) vimAlias;
|
||||||
|
|
|
||||||
|
|
@ -8,31 +8,33 @@
|
||||||
inherit (lib.lists) concatLists;
|
inherit (lib.lists) concatLists;
|
||||||
|
|
||||||
# map each plugin from our plugins module into a list
|
# map each plugin from our plugins module into a list
|
||||||
|
# while adding a new parent module, it needs to be added
|
||||||
|
# here by name before it can be evaluated
|
||||||
plugins = map (p: ./plugins + "/${p}") [
|
plugins = map (p: ./plugins + "/${p}") [
|
||||||
|
"assistant"
|
||||||
|
"autopairs"
|
||||||
|
"comments"
|
||||||
"completion"
|
"completion"
|
||||||
"theme"
|
"dashboard"
|
||||||
|
"debugger"
|
||||||
|
"filetree"
|
||||||
|
"git"
|
||||||
|
"languages"
|
||||||
|
"lsp"
|
||||||
|
"minimap"
|
||||||
|
"notes"
|
||||||
|
"projects"
|
||||||
|
"rich-presence"
|
||||||
|
"session"
|
||||||
|
"snippets"
|
||||||
"statusline"
|
"statusline"
|
||||||
"tabline"
|
"tabline"
|
||||||
"filetree"
|
|
||||||
"visuals"
|
|
||||||
"lsp"
|
|
||||||
"treesitter"
|
|
||||||
"autopairs"
|
|
||||||
"snippets"
|
|
||||||
"git"
|
|
||||||
"minimap"
|
|
||||||
"dashboard"
|
|
||||||
"utility"
|
|
||||||
"rich-presence"
|
|
||||||
"notes"
|
|
||||||
"terminal"
|
"terminal"
|
||||||
|
"theme"
|
||||||
|
"treesitter"
|
||||||
"ui"
|
"ui"
|
||||||
"assistant"
|
"utility"
|
||||||
"session"
|
"visuals"
|
||||||
"comments"
|
|
||||||
"projects"
|
|
||||||
"languages"
|
|
||||||
"debugger"
|
|
||||||
];
|
];
|
||||||
|
|
||||||
core = map (p: ./core + "/${p}") [
|
core = map (p: ./core + "/${p}") [
|
||||||
|
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
imports = [
|
|
||||||
./config.nix
|
|
||||||
./module.nix
|
|
||||||
];
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue