Skip to content

Commit

Permalink
plugins: convert to by-name import
Browse files Browse the repository at this point in the history
More manual imports, for now. But, trying to get away from the
readAllFiles usage.
  • Loading branch information
khaneliman committed Jan 20, 2025
1 parent 57576d1 commit 43ba14e
Show file tree
Hide file tree
Showing 85 changed files with 69 additions and 12 deletions.
25 changes: 23 additions & 2 deletions modules/nixvim/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,25 @@
{ self, ... }:
{ lib, ... }:
let
inherit (builtins) readDir;
inherit (lib.attrsets) foldlAttrs;
inherit (lib.lists) optional;
by-name = ./plugins;
in
{
imports = self.lib.khanelivim.readAllFiles ./.;
# Plugin by-name directory imports
imports =
(foldlAttrs (
prev: name: type:
prev ++ optional (type == "directory") (by-name + "/${name}")
) [ ] (readDir by-name))
++ [
./autocommands.nix
./diagnostics.nix
./ft.nix
./keymappings.nix
./lua.nix
./options.nix
./performance.nix
./usercommands.nix
];
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
{
lib,
config,
self,
...
}:
{
imports = self.lib.khanelivim.readAllFiles ./fzf-lua;
imports = [
./dap.nix
./git.nix
./lsp.nix
];

plugins = {
fzf-lua = {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,19 @@
config,
lib,
pkgs,
self,
...
}:
{
imports = self.lib.khanelivim.readAllFiles ./lsp;
imports = [
./ccls.nix
./clangd.nix
./harper-ls.nix
./helm-ls.nix
./nil-ls.nix
./nixd.nix
./rust-analyzer.nix
./typos-lsp.nix
];

# TODO: migrate to mkneovimplugin
extraConfigLuaPre = ''
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
{
config,
lib,
self,
...
}:
{
imports = self.lib.khanelivim.readAllFiles ./mini;
imports = [
./bufremove.nix
./comment.nix
./diff.nix
./files.nix
./fuzzy.nix
./hipatterns.nix
./indentscope.nix
./map.nix
./pairs.nix
./starter.nix
./surround.nix
];

plugins = {
mini = {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
{
config,
self,
...
}:
{
imports = self.lib.khanelivim.readAllFiles ./snacks;
imports = [
./bigfile.nix
./bufdelete.nix
./gitbrowse.nix
./lazygit.nix
./picker.nix
./profiler.nix
./zen.nix
];

plugins = {
snacks = {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
{
config,
lib,
self,
...
}:
{
imports = self.lib.khanelivim.readAllFiles ./telescope;
imports = [
./file-browser.nix
./frecency.nix
./fzf-native.nix
./live_grep.nix
./manix.nix
./ui-select.nix
./undo.nix
];

plugins.telescope = {
enable = true;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 43ba14e

Please sign in to comment.