mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-10-01 14:33:28 +00:00
Merge pull request #1161 from alfarelcynthesis/less-import
treewide: don't import modules manually
This commit is contained in:
commit
06bc21e75c
13 changed files with 27 additions and 34 deletions
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
options,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
|
@ -10,8 +11,7 @@
|
|||
|
||||
cfg = config.vim.assistant.chatgpt;
|
||||
|
||||
self = import ./chatgpt.nix {inherit lib;};
|
||||
mappingDefinitions = self.options.vim.assistant.chatgpt.mappings;
|
||||
mappingDefinitions = options.vim.assistant.chatgpt.mappings;
|
||||
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
|
||||
maps = mkMerge [
|
||||
(mkSetBinding mappings.editWithInstructions "<cmd>ChatGPTEditWithInstruction<CR>")
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
options,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
|
@ -10,8 +11,7 @@
|
|||
|
||||
cfg = config.vim.git.git-conflict;
|
||||
|
||||
self = import ./git-conflict.nix {inherit lib config;};
|
||||
gcMappingDefinitions = self.options.vim.git.git-conflict.mappings;
|
||||
gcMappingDefinitions = options.vim.git.git-conflict.mappings;
|
||||
|
||||
gcMappings = addDescriptionsToMappings cfg.mappings gcMappingDefinitions;
|
||||
in {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
options,
|
||||
...
|
||||
}: let
|
||||
inherit (builtins) toJSON;
|
||||
|
@ -12,8 +13,7 @@
|
|||
|
||||
cfg = config.vim.git.gitsigns;
|
||||
|
||||
self = import ./gitsigns.nix {inherit lib config;};
|
||||
gsMappingDefinitions = self.options.vim.git.gitsigns.mappings;
|
||||
gsMappingDefinitions = options.vim.git.gitsigns.mappings;
|
||||
|
||||
gsMappings = addDescriptionsToMappings cfg.mappings gsMappingDefinitions;
|
||||
in {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
options,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.generators) mkLuaInline;
|
||||
|
@ -14,12 +14,11 @@
|
|||
cfg = config.vim.lsp;
|
||||
usingNvimCmp = config.vim.autocomplete.nvim-cmp.enable;
|
||||
usingBlinkCmp = config.vim.autocomplete.blink-cmp.enable;
|
||||
self = import ./module.nix {inherit config lib pkgs;};
|
||||
conformCfg = config.vim.formatter.conform-nvim;
|
||||
conformFormatOnSave = conformCfg.enable && conformCfg.setupOpts.format_on_save != null;
|
||||
|
||||
augroup = "nvf_lsp";
|
||||
mappingDefinitions = self.options.vim.lsp.mappings;
|
||||
mappingDefinitions = options.vim.lsp.mappings;
|
||||
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
|
||||
mkBinding = binding: action:
|
||||
if binding.value != null
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
options,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
|
@ -9,9 +10,8 @@
|
|||
inherit (lib.nvim.lua) toLuaObject;
|
||||
|
||||
cfg = config.vim.lsp.nvim-docs-view;
|
||||
self = import ./nvim-docs-view.nix {inherit lib;};
|
||||
|
||||
mappingDefinitions = self.options.vim.lsp.nvim-docs-view.mappings;
|
||||
mappingDefinitions = options.vim.lsp.nvim-docs-view.mappings;
|
||||
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
options,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
|
@ -10,8 +11,7 @@
|
|||
|
||||
cfg = config.vim.lsp;
|
||||
|
||||
self = import ./otter.nix {inherit lib;};
|
||||
mappingDefinitions = self.options.vim.lsp.otter-nvim.mappings;
|
||||
mappingDefinitions = options.vim.lsp.otter-nvim.mappings;
|
||||
mappings = addDescriptionsToMappings cfg.otter-nvim.mappings mappingDefinitions;
|
||||
in {
|
||||
config = mkIf (cfg.enable && cfg.otter-nvim.enable) {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
options,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
|
@ -9,9 +10,7 @@
|
|||
|
||||
cfg = config.vim.minimap.codewindow;
|
||||
|
||||
self = import ./codewindow.nix {inherit lib;};
|
||||
|
||||
mappingDefinitions = self.options.vim.minimap.codewindow.mappings;
|
||||
mappingDefinitions = options.vim.minimap.codewindow.mappings;
|
||||
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
options,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkMerge mkIf;
|
||||
|
@ -9,8 +9,7 @@
|
|||
inherit (lib.nvim.lua) toLuaObject;
|
||||
|
||||
cfg = config.vim.notes.todo-comments;
|
||||
self = import ./todo-comments.nix {inherit pkgs lib;};
|
||||
inherit (self.options.vim.notes.todo-comments) mappings;
|
||||
inherit (options.vim.notes.todo-comments) mappings;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
options,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
|
@ -9,8 +10,8 @@
|
|||
inherit (lib.nvim.lua) toLuaObject;
|
||||
|
||||
cfg = config.vim.tabline.nvimBufferline;
|
||||
self = import ./nvim-bufferline.nix {inherit config lib;};
|
||||
inherit (self.options.vim.tabline.nvimBufferline) mappings;
|
||||
|
||||
inherit (options.vim.tabline.nvimBufferline) mappings;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
options,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
|
@ -12,8 +12,7 @@
|
|||
|
||||
cfg = config.vim.treesitter;
|
||||
|
||||
self = import ./treesitter.nix {inherit pkgs lib;};
|
||||
mappingDefinitions = self.options.vim.treesitter.mappings;
|
||||
mappingDefinitions = options.vim.treesitter.mappings;
|
||||
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
options,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
|
@ -9,9 +10,7 @@
|
|||
|
||||
cfg = config.vim.gestures.gesture-nvim;
|
||||
|
||||
self = import ./gesture-nvim.nix {inherit lib;};
|
||||
|
||||
mappingDefinitions = self.options.vim.gestures.gesture-nvim.mappings;
|
||||
mappingDefinitions = options.vim.gestures.gesture-nvim.mappings;
|
||||
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
options,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
|
@ -9,9 +10,7 @@
|
|||
|
||||
cfg = config.vim.utility.motion.hop;
|
||||
|
||||
self = import ./hop.nix {inherit lib;};
|
||||
|
||||
mappingDefinitions = self.options.vim.utility.motion.hop.mappings;
|
||||
mappingDefinitions = options.vim.utility.motion.hop.mappings;
|
||||
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
options,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
|
@ -9,10 +10,7 @@
|
|||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
|
||||
cfg = config.vim.utility.preview.glow;
|
||||
self = import ./glow.nix {
|
||||
inherit lib config pkgs;
|
||||
};
|
||||
inherit (self.options.vim.utility.preview.glow) mappings;
|
||||
inherit (options.vim.utility.preview.glow) mappings;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim.startPlugins = ["glow-nvim"];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue