working nvf with LazyGit!

This commit is contained in:
Charlie Root 2024-07-08 00:13:37 +02:00
commit 2ef8643abf
7 changed files with 82 additions and 111 deletions

View file

@ -12,7 +12,7 @@
mkNeovimModule = { mkNeovimModule = {
path, path,
ignoredPaths ? [./nvf.nix ./plugins/sources/default.nix ./plugins], ignoredPaths ? [],
}: }:
filter (hasSuffix ".nix") ( filter (hasSuffix ".nix") (
map toString ( map toString (
@ -28,28 +28,6 @@ in {
imports = concatLists [ imports = concatLists [
# neovim-flake home-manager module # neovim-flake home-manager module
[nvf.nixosModules.default] [nvf.nixosModules.default]
# [./plugins/settings/ui.nix]
# [./plugins/settings/filetree.nix]
# [
# ./plugins/settings/autocomplete.nix
# ./plugins/settings/visuals.nix
# ./plugins/settings/autopairs.nix
# ./plugins/settings/binds.nix
# ./plugins/settings/comments.nix
# ./plugins/settings/dashboard.nix
# ./plugins/settings/debugger.nix
# ./plugins/settings/languages.nix
# ./plugins/settings/lsp.nix
# ./plugins/settings/telescope.nix
# ./plugins/settings/notes.nix
# ./plugins/settings/notify.nix
# ./plugins/settings/projects.nix
# ./plugins/settings/statusline.nix
# ./plugins/settings/tabline.nix
# ./plugins/settings/theme.nix
# ./plugins/settings/treesitter.nix
# ./plugins/settings/utility.nix
# ./plugins/settings/git.nix
# construct this entore directory as a module # construct this entore directory as a module
# which means all default.nix files will be imported automtically # which means all default.nix files will be imported automtically
(mkNeovimModule {path = ./.;}) (mkNeovimModule {path = ./.;})

View file

@ -1,11 +1,11 @@
{ {
programs.neovim-flake.settings.vim.maps = { programs.neovim-flake.settings.vim.maps = {
normal = { normal = {
"<leader>gg".action = "<cmd>LazyGit<CR>";
/* /*
# General # General
"<leader>fd".action = ":lua vim.g.formatsave = not vim.g.formatsave<CR>"; "<leader>fd".action = ":lua vim.g.formatsave = not vim.g.formatsave<CR>";
"<leader>zt".action = ":<C-U>let g:default_terminal = v:count1<CR>"; "<leader>zt".action = ":<C-U>let g:default_terminal = v:count1<CR>";
#"<leader>e".action = ":NvimTreeToggle<CR>";
# "<leader>ld".action = ":lua vim.diagnostic.setqflist({open = true})<CR>"; # "<leader>ld".action = ":lua vim.diagnostic.setqflist({open = true})<CR>";
# "<leader>lf".action = ":lua vim.lsp.buf.format()<CR>"; # "<leader>lf".action = ":lua vim.lsp.buf.format()<CR>";
# "<leader>li".action = ":lua vim.lsp.buf.implementation()<CR>"; # "<leader>li".action = ":lua vim.lsp.buf.implementation()<CR>";
@ -28,17 +28,17 @@
"<leader>gb".action = "<cmd>Gitsigns blame_line<CR>"; "<leader>gb".action = "<cmd>Gitsigns blame_line<CR>";
"<leader>gD".action = "<cmd>Gitsigns diffthis HEAD<CR>"; "<leader>gD".action = "<cmd>Gitsigns diffthis HEAD<CR>";
"<leader>gw".action = "<cmd>Gitsigns toggle_word_diff<CR>"; "<leader>gw".action = "<cmd>Gitsigns toggle_word_diff<CR>";
*/
# Movement # Movement
"<C-h>".action = "<C-W>h"; "<C-h>".action = "<C-W>h";
"<C-j>".action = "<C-W>j"; "<C-j>".action = "<C-W>j";
"<C-k>".action = "<C-W>k"; "<C-k>".action = "<C-W>k";
"<C-l>".action = "<C-W>l"; "<C-l>".action = "<C-W>l";
# Telescope # Telescope
"<M-f>".action = ":Telescope resume<CR>"; "<M-f>".action = "<cmd>Telescope resume<CR>";
"<leader>fq".action = ":Telescope quickfix<CR>"; "<leader>fq".action = ":Telescope quickfix<CR>";
"<leader>f/".action = ":Telescope live_grep<cr>"; "<leader>f/".action = ":Telescope live_grep<cr>";
/*
# Aerial # Aerial
"<S-O>".action = ":AerialToggle<CR>"; "<S-O>".action = ":AerialToggle<CR>";

View file

@ -82,66 +82,66 @@
in { in {
programs.neovim-flake.settings.vim.extraPlugins = { programs.neovim-flake.settings.vim.extraPlugins = {
# plugins that are pulled from nixpkgs # plugins that are pulled from nixpkgs
# direnv = {package = direnv-vim;};
friendly-snippets = {package = friendly-snippets;};
mkdir-nvim = {package = mkdir-nvim;};
lazygit-nvim = {package = lazygit-nvim;};
aerial = {
package = aerial-nvim;
setup = "require('aerial').setup {}";
};
nvim-surround = {
package = nvim-surround;
setup = "require('nvim-surround').setup {}";
};
/* /*
direnv = {package = direnv-vim;}; undotree = {
friendly-snippets = {package = friendly-snippets;}; package = undotree;
mkdir-nvim = {package = mkdir-nvim;}; setup = ''
lazygit-nvim = {package = lazygit-nvim;}; vim.g.undotree_ShortIndicators = true
aerial = { vim.g.undotree_TreeVertShape = ''
package = aerial-nvim; '';
setup = "require('aerial').setup {}"; };
}; */
ssr-nvim = {
package = ssr-nvim;
setup = "require('ssr').setup {}";
};
nvim-surround = { legendary = {
package = nvim-surround; package = legendary-nvim;
setup = "require('nvim-surround').setup {}"; setup = ''
}; require('legendary').setup {};
'';
};
undotree = { # plugins that are built from their sources
package = undotree; # regexplainer = {package = pluginSources.regexplainer;};
setup = '' # vim-nftables = {package = pluginSources.vim-nftables;};
vim.g.undotree_ShortIndicators = true
vim.g.undotree_TreeVertShape = ''
'';
};
ssr-nvim = {
package = ssr-nvim;
setup = "require('ssr').setup {}";
};
legendary = {
package = legendary-nvim;
setup = ''
require('legendary').setup {};
'';
};
# plugins that are built from their sources
regexplainer = {package = pluginSources.regexplainer;};
vim-nftables = {package = pluginSources.vim-nftables;};
/* /*
data-view = { data-view = {
package = pluginSources.data-viewer-nvim; package = pluginSources.data-viewer-nvim;
setup = '' setup = ''
-- open data files in data-viewer.nvim -- open data files in data-viewer.nvim
vim.api.nvim_exec([[ vim.api.nvim_exec([[
autocmd BufReadPost,BufNewFile *.sqlite,*.csv,*.tsv DataViewer autocmd BufReadPost,BufNewFile *.sqlite,*.csv,*.tsv DataViewer
]], false) ]], false)
-- keybinds -- keybinds
vim.api.nvim_set_keymap('n', '<leader>dv', ':DataViewer<CR>', {noremap = true}) vim.api.nvim_set_keymap('n', '<leader>dv', ':DataViewer<CR>', {noremap = true})
vim.api.nvim_set_keymap('n', '<leader>dvn', ':DataViewerNextTable<CR>', {noremap = true}) vim.api.nvim_set_keymap('n', '<leader>dvn', ':DataViewerNextTable<CR>', {noremap = true})
vim.api.nvim_set_keymap('n', '<leader>dvp', ':DataViewerPrevTable<CR>', {noremap = true}) vim.api.nvim_set_keymap('n', '<leader>dvp', ':DataViewerPrevTable<CR>', {noremap = true})
vim.api.nvim_set_keymap('n', '<leader>dvc', ':DataViewerClose<CR>', {noremap = true}) vim.api.nvim_set_keymap('n', '<leader>dvc', ':DataViewerClose<CR>', {noremap = true})
''; '';
}; };
*/
smart-splits = { smart-splits = {
package = pluginSources.smart-splits; package = pluginSources.smart-splits;
setup = "require('smart-splits').setup {}"; setup = "require('smart-splits').setup {}";
}; };
/*
neotab-nvim = { neotab-nvim = {
package = pluginSources.neotab-nvim; package = pluginSources.neotab-nvim;
setup = '' setup = ''
@ -173,7 +173,7 @@ in {
} }
''; '';
}; };
*/
specs-nvim = { specs-nvim = {
package = pluginSources.specs-nvim; package = pluginSources.specs-nvim;
setup = '' setup = ''
@ -202,6 +202,5 @@ in {
vim.api.nvim_set_keymap('n', 'N', 'N:lua require("specs").show_specs()<CR>', { noremap = true, silent = true }) vim.api.nvim_set_keymap('n', 'N', 'N:lua require("specs").show_specs()<CR>', { noremap = true, silent = true })
''; '';
}; };
*/
}; };
} }

View file

@ -1,6 +1,4 @@
{config, ...}: let _: {
inherit (config.modules.other.system) username;
in {
programs.neovim-flake.settings.vim = { programs.neovim-flake.settings.vim = {
comments.comment-nvim.enable = true; comments.comment-nvim.enable = true;
}; };

View file

@ -1,9 +1,7 @@
{config, ...}: let _: {
inherit (config.modules.other.system) username;
in {
programs.neovim-flake.settings.vim = { programs.neovim-flake.settings.vim = {
dashboard = { dashboard = {
alpha.enable = false; alpha.enable = true;
}; };
}; };
} }

View file

@ -1,6 +1,4 @@
{config, ...}: let _: {
inherit (config.modules.other.system) username;
in {
programs.neovim-flake.settings.vim = { programs.neovim-flake.settings.vim = {
debugger.nvim-dap = { debugger.nvim-dap = {
enable = true; enable = true;

View file

@ -38,7 +38,6 @@ in {
# alternatively, neovim-nightly from the neovim-nightly overlay # alternatively, neovim-nightly from the neovim-nightly overlay
# via inputs.neovim-nightly.packages.${pkgs.stdenv.system}.neovim # via inputs.neovim-nightly.packages.${pkgs.stdenv.system}.neovim
package = pkgs.neovim-unwrapped; package = pkgs.neovim-unwrapped;
/*
viAlias = true; viAlias = true;
vimAlias = true; vimAlias = true;
@ -57,15 +56,15 @@ in {
enableLuaLoader = true; enableLuaLoader = true;
enableEditorconfig = true; enableEditorconfig = true;
debugMode = { debugMode = {
enable = false; enable = false;
logFile = "/tmp/nvim.log"; logFile = "/tmp/nvim.log";
}; };
additionalRuntimePaths = [ additionalRuntimePaths = [
(mkRuntimeDir "after") (mkRuntimeDir "after")
(mkRuntimeDir "spell") (mkRuntimeDir "spell")
]; ];
# while I should be doing this in luaConfigRC below # while I should be doing this in luaConfigRC below
# I have come to realise that spellfile contents are # I have come to realise that spellfile contents are
@ -80,20 +79,21 @@ in {
# the lua configuration of my Neovim configuration # the lua configuration of my Neovim configuration
# wrapper. this is recursively read from the lua # wrapper. this is recursively read from the lua
# directory, so we do not need to use require # directory, so we do not need to use require
luaConfigRC = let /*
# get the name of each lua file in the lua directory, where setting files reside luaConfigRC = let
# and import them recursively # get the name of each lua file in the lua directory, where setting files reside
configPaths = filter (hasSuffix ".lua") (map toString (listFilesRecursive ./lua)); # and import them recursively
configPaths = filter (hasSuffix ".lua") (map toString (listFilesRecursive ./lua));
# generates a key-value pair that looks roughly as follows: # generates a key-value pair that looks roughly as follows:
# `<filePath> = entryAnywhere ''<contents of filePath>''` # `<filePath> = entryAnywhere ''<contents of filePath>''`
# which is expected by neovim-flake's modified DAG library # which is expected by neovim-flake's modified DAG library
luaConfig = genAttrs configPaths (file: luaConfig = genAttrs configPaths (file:
entryBefore ["luaScript"] '' entryBefore ["luaScript"] ''
${fileContents "${file}"} ${fileContents "${file}"}
''); '');
in in
luaConfig; luaConfig;
*/ */
}; };
}; };