diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-11-09 12:35:44 +0100 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-11-09 12:54:51 +0100 |
commit | 2122a01f99c6da466b8f0f55c965c11a9043d117 (patch) | |
tree | 6c1697afc30a5bb72635bda7db9b5610386a5b71 | |
parent | fix(pkgs/stamp): Fallback to `dot-license` (diff) | |
download | nixos-config-2122a01f99c6da466b8f0f55c965c11a9043d117.tar.gz nixos-config-2122a01f99c6da466b8f0f55c965c11a9043d117.zip |
refactor(modules/legacy/conf/nvim): Move to `by-name`
Diffstat (limited to '')
-rw-r--r-- | flake/nixosConfigurations/common.nix | 10 | ||||
-rw-r--r-- | flake/packages/default.nix | 83 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/autocmds/default.nix | 133 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/clipboard/default.nix | 13 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/files/default.nix | 15 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/files/ftplugin/tex.lua (renamed from modules/home.legacy/conf/nvim/files/ftplugin/tex.lua) | 0 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/mappings/default.nix | 306 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/module.nix | 69 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/options/default.nix (renamed from modules/home.legacy/conf/nvim/options/default.nix) | 12 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/colorscheme/default.nix (renamed from modules/home.legacy/conf/nvim/plgs/colorscheme/default.nix) | 7 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/colorscheme/lua/mk_todos_readable.lua (renamed from modules/home.legacy/conf/nvim/plgs/colorscheme/lua/mk_todos_readable.lua) | 0 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/colorscheme/lua/nightfox.lua (renamed from modules/home.legacy/conf/nvim/plgs/colorscheme/lua/nightfox.lua) | 0 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/comment-nvim/default.nix (renamed from modules/home.legacy/conf/nvim/plgs/comment-nvim/default.nix) | 10 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/debugprint/default.nix (renamed from modules/home.legacy/conf/nvim/plgs/debugprint/default.nix) | 7 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/debugprint/lua/debugprint.lua (renamed from modules/home.legacy/conf/nvim/plgs/debugprint/lua/debugprint.lua) | 0 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/default.nix (renamed from modules/home.legacy/conf/nvim/plgs/default.nix) | 0 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/femaco/default.nix (renamed from modules/home.legacy/conf/nvim/plgs/femaco/default.nix) | 7 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/femaco/lua/femaco.lua (renamed from modules/home.legacy/conf/nvim/plgs/femaco/lua/femaco.lua) | 0 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/flatten-nvim/default.nix (renamed from modules/home.legacy/conf/nvim/plgs/flatten-nvim/default.nix) | 7 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/flatten-nvim/lua/flatten-nvim.lua (renamed from modules/home.legacy/conf/nvim/plgs/flatten-nvim/lua/flatten-nvim.lua) | 0 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/goto-preview/default.nix (renamed from modules/home.legacy/conf/nvim/plgs/goto-preview/default.nix) | 7 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/goto-preview/lua/goto-preview.lua (renamed from modules/home.legacy/conf/nvim/plgs/goto-preview/lua/goto-preview.lua) | 0 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/harpoon/default.nix (renamed from modules/home.legacy/conf/nvim/plgs/harpoon/default.nix) | 10 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/leap/default.nix (renamed from modules/home.legacy/conf/nvim/plgs/leap/default.nix) | 10 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/lf-nvim/default.nix (renamed from modules/home.legacy/conf/nvim/plgs/lf-nvim/default.nix) | 7 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/lf-nvim/lua/lf-nvim.lua (renamed from modules/home.legacy/conf/nvim/plgs/lf-nvim/lua/lf-nvim.lua) | 0 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/lsp-progress-nvim/default.nix (renamed from modules/home.legacy/conf/nvim/plgs/lsp-progress-nvim/default.nix) | 7 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/lsp-progress-nvim/lua/lsp-progress-nvim.lua (renamed from modules/home.legacy/conf/nvim/plgs/lsp-progress-nvim/lua/lsp-progress-nvim.lua) | 0 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/lsp/default.nix (renamed from modules/home.legacy/conf/nvim/plgs/lsp/default.nix) | 10 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/lsp/keymaps/default.nix (renamed from modules/home.legacy/conf/nvim/plgs/lsp/keymaps/default.nix) | 10 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/lsp/servers/default.nix (renamed from modules/home.legacy/conf/nvim/plgs/lsp/servers/default.nix) | 0 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/lsp/servers/servers/bashls.nix | 11 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/lsp/servers/servers/ccls.nix | 11 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/lsp/servers/servers/ltex.nix (renamed from modules/home.legacy/conf/nvim/plgs/lsp/servers/servers/ltex.nix) | 10 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/lsp/servers/servers/lua-ls.nix | 14 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/lsp/servers/servers/nil-ls.nix | 16 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/lsp/servers/servers/openscad.nix (renamed from modules/home.legacy/conf/nvim/plgs/lsp/servers/servers/openscad.nix) | 11 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/lsp/servers/servers/pylyzer.nix (renamed from modules/home.legacy/conf/nvim/plgs/lsp/servers/servers/pylyzer.nix) | 11 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/lsp/servers/servers/quick-lint-js.nix (renamed from modules/home.legacy/conf/nvim/plgs/lsp/servers/servers/quick-lint-js.nix) | 11 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/lsp/servers/servers/ruff-lsp.nix | 17 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/lsp/servers/servers/rust-analyzer.nix (renamed from modules/home.legacy/conf/nvim/plgs/lsp/servers/servers/rust-analyzer.nix) | 10 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/lsp/servers/servers/texlab.nix | 13 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/lspkind/default.nix | 12 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/ltex_extra/default.nix (renamed from modules/home.legacy/conf/nvim/plgs/ltex_extra/default.nix) | 11 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/ltex_extra/lua/ltex_extra.lua (renamed from modules/home.legacy/conf/nvim/plgs/ltex_extra/lua/ltex_extra.lua) | 0 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/lualine/default.nix | 128 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/luasnip/default.nix (renamed from modules/home.legacy/conf/nvim/plgs/luasnip/default.nix) | 7 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/luasnip/lua/luasnip.lua (renamed from modules/home.legacy/conf/nvim/plgs/luasnip/lua/luasnip.lua) | 0 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/luasnip/lua/snippets/all.lua (renamed from modules/home.legacy/conf/nvim/plgs/luasnip/lua/snippets/all.lua) | 0 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/luasnip/lua/snippets/html/html.lua (renamed from modules/home.legacy/conf/nvim/plgs/luasnip/lua/snippets/html/html.lua) | 0 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/luasnip/lua/snippets/tex/delimiter.lua (renamed from modules/home.legacy/conf/nvim/plgs/luasnip/lua/snippets/tex/delimiter.lua) | 0 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/luasnip/lua/snippets/tex/greek.lua (renamed from modules/home.legacy/conf/nvim/plgs/luasnip/lua/snippets/tex/greek.lua) | 0 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/neorg/default.nix | 70 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/nvim-cmp/default.nix (renamed from modules/home.legacy/conf/nvim/plgs/nvim-cmp/default.nix) | 39 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/nvim-lint/default.nix (renamed from modules/home.legacy/conf/nvim/plgs/nvim-lint/default.nix) | 7 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/nvim-lint/lua/nvim-lint.lua (renamed from modules/home.legacy/conf/nvim/plgs/nvim-lint/lua/nvim-lint.lua) | 0 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/raw_plugins/default.nix (renamed from modules/home.legacy/conf/nvim/plgs/raw_plugins/default.nix) | 10 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/telescope/default.nix (renamed from modules/home.legacy/conf/nvim/plgs/telescope/default.nix) | 10 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/telescope/defaults/default.nix (renamed from modules/home.legacy/conf/nvim/plgs/telescope/defaults/default.nix) | 10 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/telescope/extensions/bibtex/default.nix (renamed from modules/home.legacy/conf/nvim/plgs/telescope/extensions/bibtex/default.nix) | 11 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/telescope/extensions/default.nix (renamed from modules/home.legacy/conf/nvim/plgs/telescope/extensions/default.nix) | 0 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/telescope/extensions/frecency/default.nix (renamed from modules/home.legacy/conf/nvim/plgs/telescope/extensions/frecency/default.nix) | 10 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/telescope/extensions/fzy-native/default.nix | 11 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/telescope/extensions/rooter/default.nix | 13 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/telescope/extensions/rooter/lua/rooter.lua (renamed from modules/home.legacy/conf/nvim/plgs/telescope/extensions/rooter/lua/rooter.lua) | 0 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/telescope/extensions/symbols/default.nix (renamed from modules/home.legacy/conf/nvim/plgs/telescope/extensions/symbols/default.nix) | 11 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/telescope/keymaps/default.nix | 16 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/todo-comments/default.nix (renamed from modules/home.legacy/conf/nvim/plgs/todo-comments/default.nix) | 10 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/treesitter/default.nix (renamed from modules/home.legacy/conf/nvim/plgs/treesitter/default.nix) | 10 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/vim-tex/default.nix (renamed from modules/home.legacy/conf/nvim/plgs/vim-tex/default.nix) | 10 | ||||
-rw-r--r-- | modules/by-name/nv/nvim/plgs/which-key/default.nix | 11 | ||||
-rw-r--r-- | modules/home.legacy/conf/default.nix | 1 | ||||
-rw-r--r-- | modules/home.legacy/conf/nvim/autocmds/default.nix | 124 | ||||
-rw-r--r-- | modules/home.legacy/conf/nvim/clipboard/default.nix | 7 | ||||
-rw-r--r-- | modules/home.legacy/conf/nvim/default.nix | 55 | ||||
-rw-r--r-- | modules/home.legacy/conf/nvim/files/default.nix | 9 | ||||
-rw-r--r-- | modules/home.legacy/conf/nvim/mappings/default.nix | 298 | ||||
-rw-r--r-- | modules/home.legacy/conf/nvim/plgs/lsp/servers/servers/bashls.nix | 5 | ||||
-rw-r--r-- | modules/home.legacy/conf/nvim/plgs/lsp/servers/servers/ccls.nix | 5 | ||||
-rw-r--r-- | modules/home.legacy/conf/nvim/plgs/lsp/servers/servers/lua-ls.nix | 8 | ||||
-rw-r--r-- | modules/home.legacy/conf/nvim/plgs/lsp/servers/servers/nil-ls.nix | 10 | ||||
-rw-r--r-- | modules/home.legacy/conf/nvim/plgs/lsp/servers/servers/ruff-lsp.nix | 10 | ||||
-rw-r--r-- | modules/home.legacy/conf/nvim/plgs/lsp/servers/servers/texlab.nix | 7 | ||||
-rw-r--r-- | modules/home.legacy/conf/nvim/plgs/lspkind/default.nix | 6 | ||||
-rw-r--r-- | modules/home.legacy/conf/nvim/plgs/lualine/default.nix | 121 | ||||
-rw-r--r-- | modules/home.legacy/conf/nvim/plgs/neorg/default.nix | 57 | ||||
-rw-r--r-- | modules/home.legacy/conf/nvim/plgs/telescope/extensions/fzy-native/default.nix | 5 | ||||
-rw-r--r-- | modules/home.legacy/conf/nvim/plgs/telescope/extensions/rooter/default.nix | 7 | ||||
-rw-r--r-- | modules/home.legacy/conf/nvim/plgs/telescope/keymaps/default.nix | 10 | ||||
-rw-r--r-- | modules/home.legacy/conf/nvim/plgs/which-key/default.nix | 5 |
90 files changed, 1170 insertions, 872 deletions
diff --git a/flake/nixosConfigurations/common.nix b/flake/nixosConfigurations/common.nix index 68758bb6..d4660ef7 100644 --- a/flake/nixosConfigurations/common.nix +++ b/flake/nixosConfigurations/common.nix @@ -1,6 +1,10 @@ # This file contains common configuration applied to every host. # It should only `enable` options defined in the `modules` directory. -{config, ...}: { +{ + config, + pkgs, + ... +}: { soispha = { boot.enable = true; cleanup.enable = true; @@ -79,6 +83,10 @@ }; programs = { + nvim = { + enable = true; + shell = pkgs.zsh; + }; atuin.enable = true; git.enable = true; imv.enable = true; diff --git a/flake/packages/default.nix b/flake/packages/default.nix index d4258bfa..125bf888 100644 --- a/flake/packages/default.nix +++ b/flake/packages/default.nix @@ -14,45 +14,50 @@ inherit (import ./merge.nix {inherit lib;}) merge; output = import ../../bootstrap {inherit pkgs sysLib;}; - nvim = - builtins.mapAttrs ( - name: value: let - nvim_config = - import ../../modules/home.legacy/conf/nvim/default.nix - build_args; - build_args = let - inherit (value._module.args) pkgs; - inherit (pkgs) lib; - in { - inherit pkgs pkgsStable lib; - nixosConfig = value.config; - config = value.config.home-manager.users.soispha; - }; - - resolve_imports = attrs: - merge (builtins.map (v: import v build_args) - attrs.imports); - - resolve_imports' = attrs: - if builtins.any (n: n == "imports") (builtins.attrNames attrs) - then - resolve_imports' (merge [ - (resolve_imports attrs) - (builtins.removeAttrs - attrs - ["imports"]) - ]) - else attrs; - - complete_config = resolve_imports' nvim_config; - in - nixVim.legacyPackages."${system}".makeNixvim - ( - builtins.removeAttrs - complete_config.programs.nixvim ["enable"] - ) - ) - self.nixosConfigurations; + # FIXME: Do what the trace says. <2024-11-09> + nvim = builtins.trace "nvim build currently broken, using default" { + tiamat = pkgs.neovim; + apzu = + pkgs.neovim; + }; + # builtins.mapAttrs ( + # name: value: let + # nvim_config = + # import ../../modules/home.legacy/conf/nvim/default.nix + # build_args; + # build_args = let + # inherit (value._module.args) pkgs; + # inherit (pkgs) lib; + # in { + # inherit pkgs pkgsStable lib; + # nixosConfig = value.config; + # config = value.config.home-manager.users.soispha; + # }; + # + # resolve_imports = attrs: + # merge (builtins.map (v: import v build_args) + # attrs.imports); + # + # resolve_imports' = attrs: + # if builtins.any (n: n == "imports") (builtins.attrNames attrs) + # then + # resolve_imports' (merge [ + # (resolve_imports attrs) + # (builtins.removeAttrs + # attrs + # ["imports"]) + # ]) + # else attrs; + # + # complete_config = resolve_imports' nvim_config; + # in + # nixVim.legacyPackages."${system}".makeNixvim + # ( + # builtins.removeAttrs + # complete_config.programs.nixvim ["enable"] + # ) + # ) + # self.nixosConfigurations; output_neovim = lib.attrsets.mapAttrs' (name: value: lib.attrsets.nameValuePair "nvim_${name}" value) nvim; diff --git a/modules/by-name/nv/nvim/autocmds/default.nix b/modules/by-name/nv/nvim/autocmds/default.nix new file mode 100644 index 00000000..54fd6831 --- /dev/null +++ b/modules/by-name/nv/nvim/autocmds/default.nix @@ -0,0 +1,133 @@ +{ + config, + lib, + ... +}: let + cfg = config.soispha.programs.nvim; +in { + config.home-manager.users.soispha = lib.mkIf cfg.enable { + programs.nixvim = { + autoGroups = { + cursor_off = {clear = true;}; + colorcolumn_toggle = {clear = true;}; + numbertoggle = {clear = true;}; + coloroverride = {clear = true;}; + highlight_on_yank = {clear = true;}; + create_dir = {clear = true;}; + }; + + autoCmd = [ + { + # Taken from: https://github.com/jghauser/mkdir.nvim + event = ["BufWritePre"]; + pattern = ["*"]; + callback = { + __raw = '' + function() + -- Get current filename, get full path (:p) and leave only the head (:h) + local dir = vim.fn.expand('<afile>:p:h') + + -- This handles URLs using netrw. See ':help netrw-transparent' for details. + if dir:find('%l+://') == 1 then + return + end + + if vim.fn.isdirectory(dir) == 0 then + vim.fn.mkdir(dir, 'p') + end + end + ''; + }; + group = "create_dir"; + desc = "Create the directory of the target file on write"; + } + { + event = ["TextYankPost"]; + pattern = ["*"]; + callback = { + __raw = '' + function() + vim.highlight.on_yank() + end + ''; + }; + group = "highlight_on_yank"; + desc = "Highlight the yanked text"; + } + { + event = ["BufWritePre"]; + pattern = ["*"]; + command = '' + ks | if search("\\s\\+$", 'n') != 0 | :%s/\s\+$// | endif | 's + ''; + desc = '' + Remove trailing whitespace on safe + :%s/\s\+$\| \+\ze\t//g >> For trailing spaces and spaces before tabstops + ''; + } + + { + event = ["WinLeave"]; + pattern = ["*"]; + command = "set nocursorline"; # TODO: possible also nocursorcolumn + group = "cursor_off"; + desc = "Display cursorline and cursorcolumn ONLY in active window."; + } + { + event = ["WinEnter"]; + pattern = ["*"]; + command = "set cursorline"; # TODO: possible also cursorcolumn + group = "cursor_off"; + desc = "Display cursorline and cursorcolumn ONLY in active window."; + } + + { + event = ["InsertEnter"]; + pattern = ["*"]; + command = "set colorcolumn=${config.home-manager.users.soispha.programs.nixvim.opts.colorcolumn}"; + group = "colorcolumn_toggle"; + desc = "Only activate the colorcolumn when focused"; + } + { + event = ["BufLeave" "FocusLost" "InsertLeave" "WinLeave"]; + pattern = ["*"]; + command = "set colorcolumn=0"; + group = "colorcolumn_toggle"; + desc = "Only activate the colorcolumn when focused"; + } + + { + event = ["BufEnter" "FocusGained" "InsertLeave" "WinEnter"]; + pattern = ["*"]; + command = "if &nu && mode() != \"i\" | set rnu | endif"; + group = "numbertoggle"; + desc = "Change line numbers, when not focused"; + } + { + event = ["BufLeave" "FocusLost" "InsertEnter" "WinLeave"]; + pattern = ["*"]; + command = "if &nu | set nornu | endif"; + group = "numbertoggle"; + desc = "Change line numbers, when not focused"; + } + + { + # Override LineNr + event = ["ColorScheme"]; + pattern = ["*"]; + command = "highlight LineNr ctermfg=DarkGrey guifg=DarkGrey "; + group = "coloroverride"; + desc = "Changes Line number colors"; + } + { + # Override CursorLineNr + event = ["ColorScheme"]; + pattern = ["*"]; + command = "highlight CursorLineNr ctermfg=White guifg=White "; + group = "coloroverride"; + desc = "Changes Line number colors"; + } + ]; + }; + }; +} diff --git a/modules/by-name/nv/nvim/clipboard/default.nix b/modules/by-name/nv/nvim/clipboard/default.nix new file mode 100644 index 00000000..4cc3bd8a --- /dev/null +++ b/modules/by-name/nv/nvim/clipboard/default.nix @@ -0,0 +1,13 @@ +{ + config, + lib, + ... +}: let + cfg = config.soispha.programs.nvim; +in { + home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { + clipboard.providers = { + wl-copy.enable = true; + }; + }; +} diff --git a/modules/by-name/nv/nvim/files/default.nix b/modules/by-name/nv/nvim/files/default.nix new file mode 100644 index 00000000..ef8afa1a --- /dev/null +++ b/modules/by-name/nv/nvim/files/default.nix @@ -0,0 +1,15 @@ +{ + config, + lib, + ... +}: let + cfg = config.soispha.programs.nvim; +in { + home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { + extraFiles = { + "ftplugin/tex.lua".text = '' + ${lib.strings.fileContents ./ftplugin/tex.lua} + ''; + }; + }; +} diff --git a/modules/home.legacy/conf/nvim/files/ftplugin/tex.lua b/modules/by-name/nv/nvim/files/ftplugin/tex.lua index 4107a7c5..4107a7c5 100644 --- a/modules/home.legacy/conf/nvim/files/ftplugin/tex.lua +++ b/modules/by-name/nv/nvim/files/ftplugin/tex.lua diff --git a/modules/by-name/nv/nvim/mappings/default.nix b/modules/by-name/nv/nvim/mappings/default.nix new file mode 100644 index 00000000..4b6344c2 --- /dev/null +++ b/modules/by-name/nv/nvim/mappings/default.nix @@ -0,0 +1,306 @@ +{ + config, + lib, + ... +}: let + cfg = config.soispha.programs.nvim; +in { + config.home-manager.users.soispha = lib.mkIf cfg.enable { + programs.nixvim = { + globals = { + mapleader = " "; + maplocalleader = " "; + }; + keymaps = [ + { + mode = ["n" "i"]; + key = "<Esc>"; + action = "<cmd>noh<CR><Esc>"; + options.desc = "Disable the search highlighting and send Escape"; + } + { + key = "hh"; + mode = ["i"]; + action.__raw = '' + function() + local cmp = require('cmp'); + local luasnip = require('luasnip'); + + if cmp.visible() then + cmp.select_next_item() + elseif luasnip.expand_or_locally_jumpable() then + luasnip.expand_or_jump() + end + end + ''; + options.desc = "completion trigger/ forward in completen menu"; + } + { + key = "uu"; + mode = ["i"]; + action.__raw = '' + function() + local cmp = require('cmp'); + cmp.confirm() + end + ''; + options.desc = "confirm the selected item"; + } + + { + key = "<C-Tab>"; + action = "<cmd>tabnext<CR>"; + options.desc = "cycle to the next tab"; + } + { + key = "<S-C-Tab>"; + action = "<cmd>tabprevious<CR>"; + options.desc = "cycle to the previous tab"; + } + + # yank/ cut to the system clipboard + { + key = "<leader>y"; + action = "\"+y"; + options.desc = "yank to the system clipboard"; + } + { + key = "<leader>Y"; + action = "\"+Y"; + options.desc = "yank until the end of the line to the system clipboard"; + } + + # Unmap some old keys + #{key = "s"; action = "'<Nop>'";} + #{key = "t"; action = "'<Nop>'";} + { + key = "<Up>"; + action = "<Nop>"; + } + { + key = "<Down>"; + action = "<Nop>"; + } + { + key = "<Left>"; + action = "<Nop>"; + } + { + key = "<Right>"; + action = "<Nop>"; + } + + # Center the cursor vertically when moving to the next word during a search. + { + key = "l"; + action = "nzzzv"; + options.desc = "Center the cursor vertically when moving to the next word during a search."; + } + { + key = "L"; + action = "Nzzzv"; + options.desc = "Center the cursor vertically when moving to the next word during a search."; + } + # remap the other keys to dvorak + { + key = "k"; + action = "t"; + options.desc = "go the the right on char"; + } + { + key = "K"; + action = "T"; + options.desc = "go to the left on char"; + } + { + key = "j"; + action = "k"; + options.desc = "go to the right before the char"; + } + { + key = "J"; + action = "K"; + options.desc = "go to the left before the char"; + } + + # Change Vim-keys + { + key = "h"; + action = "<left>"; + options.desc = "go left"; + } + { + key = "t"; + action = "g<down>"; + options.desc = "go down, with displaylines"; + } + { + key = "n"; + action = "g<up>"; + options.desc = "go up, with displaylines"; + } + { + key = "s"; + action = "<right>"; + options.desc = "go right"; + } + + # Move display lines + { + key = "0"; + action = "g0"; + options.desc = "go to the leftmost character in the screen line"; + } + { + key = "$"; + action = "g$"; + options.desc = "go to the rightmost character in the screen line"; + } + { + mode = ["n"]; + key = "<Enter>"; + action = "gf"; + options.desc = "open file/url under cursor"; + } + { + mode = ["n"]; + key = "<Tab>"; + action = ":"; + options.desc = "jump to command line"; + } + + { + mode = ["n"]; + key = "\\f"; + action.__raw = "function() require('lf').start() end"; + options.desc = "open lf in a floating window"; + } + + # Splits + { + mode = ["n"]; + key = "<C-t>"; + action = "<C-w>p"; + options.desc = "go to previous split"; + } + { + mode = ["n"]; + key = "<C-n>"; + action = "<C-w>w"; + options.desc = "go to next split"; + } + { + mode = ["n"]; + key = "<leader>-"; + action = "<C-W>s"; + options.desc = "New horizontal split"; + } + { + mode = ["n"]; + key = "<leader>|"; + action = "<C-W>v"; + options.desc = "New vertical split"; + } + + { + mode = ["n"]; + key = "<leader>p"; + action = "\"_dP"; + options.desc = "keep the cut thing in the base register"; + } + { + mode = ["n"]; + key = "<leader>c"; + action = "\"_c"; + options.desc = "change without saving to register"; + } + + { + mode = ["n"]; + key = "<leader>d"; + action = "\"_d"; + options.desc = "delete without saving to register"; + } + { + key = "x"; + mode = ["n"]; + action.__raw = '' + function() + local col = vim.api.nvim_win_get_cursor(0)[2] + local char = vim.api.nvim_get_current_line():sub(col+1,col+1) + if char:match("%s") then + return '"_x' + else + return "x" + end + end + ''; + options = { + desc = "Pipe all space only deletions to the blackhole register"; + expr = true; + silent = true; + }; + } + { + key = "dd"; + mode = ["n"]; + action.__raw = '' + function() + if vim.api.nvim_get_current_line():match("^%s*$") then + return '"_dd' + else + return "dd" + end + end + ''; + options = { + desc = "Pipe all blank line deletions to the blackhole register"; + expr = true; + silent = true; + }; + } + + { + mode = ["n"]; + key = "<leader>s"; + action = ":%s/\\<<C-r><C-w>\\>/<C-r><C-w>/gI<Left><Left><Left>"; + options.desc = "replace for the word under the cursor"; + } + + { + mode = ["n"]; + key = "<C-s>"; + action = "<cmd>mksession! <CR>"; + options.desc = "overwrite/create a session"; + } + + { + mode = ["n"]; + key = "<leader>X"; + action = "!!$SHELL <CR>"; + options.desc = "Read the current line and execute that line in your $SHELL. The resulting output will replace the curent line that was being executed."; + } + { + mode = ["t"]; + key = "<Esc><Esc>"; + action = "<C-\\><C-n>"; + options.desc = "Exit terminal mode with <Esc><Esc>"; + } + + # move selected lines in visual mode + { + mode = ["v"]; + key = "T"; + action = ":m '>+1<CR>gv=gv"; + options.desc = "move selected lines in visual mode down"; + } + { + mode = ["v"]; + key = "N"; + action = ":m '<-2<CR>gv=gv"; + options.desc = "move selected lines in visual mode up"; + } + ]; + }; + }; +} diff --git a/modules/by-name/nv/nvim/module.nix b/modules/by-name/nv/nvim/module.nix new file mode 100644 index 00000000..829a9c2b --- /dev/null +++ b/modules/by-name/nv/nvim/module.nix @@ -0,0 +1,69 @@ +{ + pkgs, + lib, + config, + ... +}: let + cfg = config.soispha.programs.nvim; +in { + imports = [ + ./autocmds + ./clipboard + ./files + ./mappings + ./options + ./plgs + ]; + + options.soispha.programs.nvim = { + enable = lib.mkEnableOption "custom nvim config"; + shell = lib.mkOption { + type = lib.types.package; + description = "The package to use for the shell in :!"; + }; + }; + + config = lib.mkIf cfg.enable { + home-manager.users.soispha = { + home.sessionVariables = { + EDITOR = "nvim"; + VISUAL = "nvim"; + CODEEDITOR = "nvim"; + }; + programs.nixvim = { + enable = true; + + # source: https://www.patorjk.com/software/taag/#p=display&f=ANSI%20Shadow&t=Neovim + extraConfigLuaPre = lib.mkBefore '' + --------------------------------------------------------------------------- + -- + -- ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ + -- ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ + -- ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ + -- ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ + -- ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ + -- ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ + -- + --------------------------------------------------------------------------- + ''; + + extraPackages = with pkgs; [ + /* + These are mostly linters and formatters used for different file types. + Including them here is fine, as they are not necessarily-sync able to different people. + */ + # nix + alejandra + statix + + # yaml + yamllint + + # shell + shellcheck + shfmt + ]; + }; + }; + }; +} diff --git a/modules/home.legacy/conf/nvim/options/default.nix b/modules/by-name/nv/nvim/options/default.nix index f66b2181..72343b72 100644 --- a/modules/home.legacy/conf/nvim/options/default.nix +++ b/modules/by-name/nv/nvim/options/default.nix @@ -1,5 +1,11 @@ -{nixosConfig, ...}: { - programs.nixvim.opts = { +{ + config, + lib, + ... +}: let + cfg = config.soispha.programs.nvim; +in { + home-manager.users.soispha.programs.nixvim.opts = lib.mkIf cfg.enable { autoindent = true; # copy indent from previous line cindent = true; # use c like indenting rules breakindent = true; # continue indent visually @@ -61,7 +67,7 @@ # vim.opt.shada:append {'%'}; -- store buffers in the shada file and reopen them if nvim has been started without file name argument - shell = nixosConfig.users.users.soispha.shell.pname; # try to use default shell for the default user as a shell for ":!" + shell = "${cfg.shell}"; spell = true; # activate spell checking spelllang = "en_us,de_de"; # set spell languages diff --git a/modules/home.legacy/conf/nvim/plgs/colorscheme/default.nix b/modules/by-name/nv/nvim/plgs/colorscheme/default.nix index 11357f77..ebc26826 100644 --- a/modules/home.legacy/conf/nvim/plgs/colorscheme/default.nix +++ b/modules/by-name/nv/nvim/plgs/colorscheme/default.nix @@ -1,9 +1,12 @@ { pkgs, + config, lib, ... -}: { - programs.nixvim = { +}: let + cfg = config.soispha.programs.nvim; +in { + home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { # TODO: package nightfox though a module extraConfigLuaPost = '' ${lib.strings.fileContents ./lua/nightfox.lua} diff --git a/modules/home.legacy/conf/nvim/plgs/colorscheme/lua/mk_todos_readable.lua b/modules/by-name/nv/nvim/plgs/colorscheme/lua/mk_todos_readable.lua index d02171b5..d02171b5 100644 --- a/modules/home.legacy/conf/nvim/plgs/colorscheme/lua/mk_todos_readable.lua +++ b/modules/by-name/nv/nvim/plgs/colorscheme/lua/mk_todos_readable.lua diff --git a/modules/home.legacy/conf/nvim/plgs/colorscheme/lua/nightfox.lua b/modules/by-name/nv/nvim/plgs/colorscheme/lua/nightfox.lua index 4c502153..4c502153 100644 --- a/modules/home.legacy/conf/nvim/plgs/colorscheme/lua/nightfox.lua +++ b/modules/by-name/nv/nvim/plgs/colorscheme/lua/nightfox.lua diff --git a/modules/home.legacy/conf/nvim/plgs/comment-nvim/default.nix b/modules/by-name/nv/nvim/plgs/comment-nvim/default.nix index 2a73b8db..bd70c5c2 100644 --- a/modules/home.legacy/conf/nvim/plgs/comment-nvim/default.nix +++ b/modules/by-name/nv/nvim/plgs/comment-nvim/default.nix @@ -1,5 +1,11 @@ -{...}: { - programs.nixvim = { +{ + config, + lib, + ... +}: let + cfg = config.soispha.programs.nvim; +in { + home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { plugins.comment = { enable = true; settings = { diff --git a/modules/home.legacy/conf/nvim/plgs/debugprint/default.nix b/modules/by-name/nv/nvim/plgs/debugprint/default.nix index 3c591e9f..4a3af1c5 100644 --- a/modules/home.legacy/conf/nvim/plgs/debugprint/default.nix +++ b/modules/by-name/nv/nvim/plgs/debugprint/default.nix @@ -1,9 +1,12 @@ { pkgs, lib, + config, ... -}: { - programs.nixvim = { +}: let + cfg = config.soispha.programs.nvim; +in { + home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { # TODO: package debugprint though a module extraConfigLuaPost = '' ${lib.strings.fileContents ./lua/debugprint.lua} diff --git a/modules/home.legacy/conf/nvim/plgs/debugprint/lua/debugprint.lua b/modules/by-name/nv/nvim/plgs/debugprint/lua/debugprint.lua index da7e1735..da7e1735 100644 --- a/modules/home.legacy/conf/nvim/plgs/debugprint/lua/debugprint.lua +++ b/modules/by-name/nv/nvim/plgs/debugprint/lua/debugprint.lua diff --git a/modules/home.legacy/conf/nvim/plgs/default.nix b/modules/by-name/nv/nvim/plgs/default.nix index 991bc315..991bc315 100644 --- a/modules/home.legacy/conf/nvim/plgs/default.nix +++ b/modules/by-name/nv/nvim/plgs/default.nix diff --git a/modules/home.legacy/conf/nvim/plgs/femaco/default.nix b/modules/by-name/nv/nvim/plgs/femaco/default.nix index 6c4a7d89..adf0ba63 100644 --- a/modules/home.legacy/conf/nvim/plgs/femaco/default.nix +++ b/modules/by-name/nv/nvim/plgs/femaco/default.nix @@ -1,9 +1,12 @@ { pkgs, lib, + config, ... -}: { - programs.nixvim = { +}: let + cfg = config.soispha.programs.nvim; +in { + home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { # TODO: package femaco through a module extraConfigLuaPost = '' ${lib.strings.fileContents ./lua/femaco.lua} diff --git a/modules/home.legacy/conf/nvim/plgs/femaco/lua/femaco.lua b/modules/by-name/nv/nvim/plgs/femaco/lua/femaco.lua index c113e4c7..c113e4c7 100644 --- a/modules/home.legacy/conf/nvim/plgs/femaco/lua/femaco.lua +++ b/modules/by-name/nv/nvim/plgs/femaco/lua/femaco.lua diff --git a/modules/home.legacy/conf/nvim/plgs/flatten-nvim/default.nix b/modules/by-name/nv/nvim/plgs/flatten-nvim/default.nix index cd6f8bcc..c1ace4ac 100644 --- a/modules/home.legacy/conf/nvim/plgs/flatten-nvim/default.nix +++ b/modules/by-name/nv/nvim/plgs/flatten-nvim/default.nix @@ -1,9 +1,12 @@ { pkgs, lib, + config, ... -}: { - programs.nixvim = { +}: let + cfg = config.soispha.programs.nvim; +in { + home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { # TODO: package flatten-nvim though a module extraConfigLuaPre = '' diff --git a/modules/home.legacy/conf/nvim/plgs/flatten-nvim/lua/flatten-nvim.lua b/modules/by-name/nv/nvim/plgs/flatten-nvim/lua/flatten-nvim.lua index 2cdbcdde..2cdbcdde 100644 --- a/modules/home.legacy/conf/nvim/plgs/flatten-nvim/lua/flatten-nvim.lua +++ b/modules/by-name/nv/nvim/plgs/flatten-nvim/lua/flatten-nvim.lua diff --git a/modules/home.legacy/conf/nvim/plgs/goto-preview/default.nix b/modules/by-name/nv/nvim/plgs/goto-preview/default.nix index 3de28c68..5c56fe8c 100644 --- a/modules/home.legacy/conf/nvim/plgs/goto-preview/default.nix +++ b/modules/by-name/nv/nvim/plgs/goto-preview/default.nix @@ -1,9 +1,12 @@ { pkgs, lib, + config, ... -}: { - programs.nixvim = { +}: let + cfg = config.soispha.programs.nvim; +in { + home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { # TODO: package goto-preview though a module extraConfigLuaPost = '' ${lib.strings.fileContents ./lua/goto-preview.lua} diff --git a/modules/home.legacy/conf/nvim/plgs/goto-preview/lua/goto-preview.lua b/modules/by-name/nv/nvim/plgs/goto-preview/lua/goto-preview.lua index 9687a5a0..9687a5a0 100644 --- a/modules/home.legacy/conf/nvim/plgs/goto-preview/lua/goto-preview.lua +++ b/modules/by-name/nv/nvim/plgs/goto-preview/lua/goto-preview.lua diff --git a/modules/home.legacy/conf/nvim/plgs/harpoon/default.nix b/modules/by-name/nv/nvim/plgs/harpoon/default.nix index 465f24f0..05a40d9f 100644 --- a/modules/home.legacy/conf/nvim/plgs/harpoon/default.nix +++ b/modules/by-name/nv/nvim/plgs/harpoon/default.nix @@ -1,4 +1,9 @@ -{pkgs, ...}: let +{ + pkgs, + config, + lib, + ... +}: let numbers = ["0" "1" "2" "3" "4" "5" "6" "7" "8" "9"]; mkNumberedCommand = { command_template, @@ -29,8 +34,9 @@ gotoTerminalMappings = builtins.map mkGotoTerminalCommand numbers; gotoFileMappings = builtins.map mkGotoFileCommand numbers; + cfg = config.soispha.programs.nvim; in { - programs.nixvim = { + home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { plugins.harpoon = { enable = true; package = pkgs.vimPlugins.harpoon; diff --git a/modules/home.legacy/conf/nvim/plgs/leap/default.nix b/modules/by-name/nv/nvim/plgs/leap/default.nix index 4e7ae60c..57e78879 100644 --- a/modules/home.legacy/conf/nvim/plgs/leap/default.nix +++ b/modules/by-name/nv/nvim/plgs/leap/default.nix @@ -1,5 +1,11 @@ -{...}: { - programs.nixvim = { +{ + config, + lib, + ... +}: let + cfg = config.soispha.programs.nvim; +in { + home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { plugins.leap = { enable = true; addDefaultMappings = false; # They don't work with dvorak. diff --git a/modules/home.legacy/conf/nvim/plgs/lf-nvim/default.nix b/modules/by-name/nv/nvim/plgs/lf-nvim/default.nix index 11ad2807..5e2836b0 100644 --- a/modules/home.legacy/conf/nvim/plgs/lf-nvim/default.nix +++ b/modules/by-name/nv/nvim/plgs/lf-nvim/default.nix @@ -1,9 +1,12 @@ { pkgs, lib, + config, ... -}: { - programs.nixvim = { +}: let + cfg = config.soispha.programs.nvim; +in { + home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { # TODO: package lf-nvim though a module # FIXME: change the nvim path, when I change the path with lf extraConfigLuaPost = '' diff --git a/modules/home.legacy/conf/nvim/plgs/lf-nvim/lua/lf-nvim.lua b/modules/by-name/nv/nvim/plgs/lf-nvim/lua/lf-nvim.lua index 1eadf375..1eadf375 100644 --- a/modules/home.legacy/conf/nvim/plgs/lf-nvim/lua/lf-nvim.lua +++ b/modules/by-name/nv/nvim/plgs/lf-nvim/lua/lf-nvim.lua diff --git a/modules/home.legacy/conf/nvim/plgs/lsp-progress-nvim/default.nix b/modules/by-name/nv/nvim/plgs/lsp-progress-nvim/default.nix index 6602ceb6..1a2fb6eb 100644 --- a/modules/home.legacy/conf/nvim/plgs/lsp-progress-nvim/default.nix +++ b/modules/by-name/nv/nvim/plgs/lsp-progress-nvim/default.nix @@ -1,9 +1,12 @@ { lib, + config, pkgs, ... -}: { - programs.nixvim = { +}: let + cfg = config.soispha.programs.nvim; +in { + home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { # TODO: package lsp-progress-nvim though a module extraConfigLuaPost = '' ${lib.strings.fileContents ./lua/lsp-progress-nvim.lua} diff --git a/modules/home.legacy/conf/nvim/plgs/lsp-progress-nvim/lua/lsp-progress-nvim.lua b/modules/by-name/nv/nvim/plgs/lsp-progress-nvim/lua/lsp-progress-nvim.lua index 5a2cff26..5a2cff26 100644 --- a/modules/home.legacy/conf/nvim/plgs/lsp-progress-nvim/lua/lsp-progress-nvim.lua +++ b/modules/by-name/nv/nvim/plgs/lsp-progress-nvim/lua/lsp-progress-nvim.lua diff --git a/modules/home.legacy/conf/nvim/plgs/lsp/default.nix b/modules/by-name/nv/nvim/plgs/lsp/default.nix index b7c1e174..d97f2f0a 100644 --- a/modules/home.legacy/conf/nvim/plgs/lsp/default.nix +++ b/modules/by-name/nv/nvim/plgs/lsp/default.nix @@ -1,9 +1,15 @@ -{...}: { +{ + config, + lib, + ... +}: let + cfg = config.soispha.programs.nvim; +in { imports = [ ./keymaps ./servers ]; - programs.nixvim.plugins.lsp = { + home-manager.users.soispha.programs.nixvim.plugins.lsp = lib.mkIf cfg.enable { enable = true; onAttach = "" diff --git a/modules/home.legacy/conf/nvim/plgs/lsp/keymaps/default.nix b/modules/by-name/nv/nvim/plgs/lsp/keymaps/default.nix index b1276639..903e8c17 100644 --- a/modules/home.legacy/conf/nvim/plgs/lsp/keymaps/default.nix +++ b/modules/by-name/nv/nvim/plgs/lsp/keymaps/default.nix @@ -1,5 +1,11 @@ -{...}: { - programs.nixvim = { +{ + config, + lib, + ... +}: let + cfg = config.soispha.programs.nvim; +in { + home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { plugins.lsp.keymaps = { diagnostic = { "N" = { diff --git a/modules/home.legacy/conf/nvim/plgs/lsp/servers/default.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/default.nix index 605046d4..605046d4 100644 --- a/modules/home.legacy/conf/nvim/plgs/lsp/servers/default.nix +++ b/modules/by-name/nv/nvim/plgs/lsp/servers/default.nix diff --git a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/bashls.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/bashls.nix new file mode 100644 index 00000000..7d036a13 --- /dev/null +++ b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/bashls.nix @@ -0,0 +1,11 @@ +{ + lib, + config, + ... +}: let + cfg = config.soispha.programs.nvim; +in { + home-manager.users.soispha.programs.nixvim.plugins.lsp.servers = lib.mkIf cfg.enable { + bashls.enable = true; + }; +} diff --git a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ccls.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ccls.nix new file mode 100644 index 00000000..cd7229bc --- /dev/null +++ b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ccls.nix @@ -0,0 +1,11 @@ +{ + config, + lib, + ... +}: let + cfg = config.soispha.programs.nvim; +in { + home-manager.users.soispha.programs.nixvim.plugins.lsp.servers = lib.mkIf cfg.enable { + ccls.enable = true; + }; +} diff --git a/modules/home.legacy/conf/nvim/plgs/lsp/servers/servers/ltex.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ltex.nix index 3224bc41..c89e0790 100644 --- a/modules/home.legacy/conf/nvim/plgs/lsp/servers/servers/ltex.nix +++ b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ltex.nix @@ -1,5 +1,11 @@ -{...}: { - programs.nixvim.plugins.lsp.servers = { +{ + config, + lib, + ... +}: let + cfg = config.soispha.programs.nvim; +in { + home-manager.users.soispha.programs.nixvim.plugins.lsp.servers = lib.mkIf cfg.enable { ltex = let filetypes = [ "java" diff --git a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/lua-ls.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/lua-ls.nix new file mode 100644 index 00000000..f2e553f1 --- /dev/null +++ b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/lua-ls.nix @@ -0,0 +1,14 @@ +{ + config, + lib, + ... +}: let + cfg = config.soispha.programs.nvim; +in { + home-manager.users.soispha.programs.nixvim.plugins.lsp.servers = lib.mkIf cfg.enable { + lua_ls = { + enable = true; + settings.telemetry.enable = false; + }; + }; +} diff --git a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/nil-ls.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/nil-ls.nix new file mode 100644 index 00000000..9c760345 --- /dev/null +++ b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/nil-ls.nix @@ -0,0 +1,16 @@ +{ + config, + lib, + ... +}: let + cfg = config.soispha.programs.nvim; +in { + home-manager.users.soispha.programs.nixvim.plugins.lsp.servers = lib.mkIf cfg.enable { + nil_ls = { + enable = true; + settings = { + formatting.command = ["alejandra"]; + }; + }; + }; +} diff --git a/modules/home.legacy/conf/nvim/plgs/lsp/servers/servers/openscad.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/openscad.nix index a0221cc4..94f7b067 100644 --- a/modules/home.legacy/conf/nvim/plgs/lsp/servers/servers/openscad.nix +++ b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/openscad.nix @@ -1,5 +1,12 @@ -{pkgs, ...}: { - programs.nixvim = { +{ + config, + lib, + pkgs, + ... +}: let + cfg = config.soispha.programs.nvim; +in { + home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { extraConfigLuaPost = /* lua diff --git a/modules/home.legacy/conf/nvim/plgs/lsp/servers/servers/pylyzer.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/pylyzer.nix index b1042221..3ac66102 100644 --- a/modules/home.legacy/conf/nvim/plgs/lsp/servers/servers/pylyzer.nix +++ b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/pylyzer.nix @@ -1,5 +1,12 @@ -{pkgs, ...}: { - programs.nixvim = { +{ + config, + lib, + pkgs, + ... +}: let + cfg = config.soispha.programs.nvim; +in { + home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { extraConfigLuaPost = /* lua diff --git a/modules/home.legacy/conf/nvim/plgs/lsp/servers/servers/quick-lint-js.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/quick-lint-js.nix index 23c3054a..48a3a71c 100644 --- a/modules/home.legacy/conf/nvim/plgs/lsp/servers/servers/quick-lint-js.nix +++ b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/quick-lint-js.nix @@ -1,5 +1,12 @@ -{pkgs, ...}: { - programs.nixvim = { +{ + config, + lib, + pkgs, + ... +}: let + cfg = config.soispha.programs.nvim; +in { + home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { extraConfigLuaPost = /* lua diff --git a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ruff-lsp.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ruff-lsp.nix new file mode 100644 index 00000000..41b3118a --- /dev/null +++ b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ruff-lsp.nix @@ -0,0 +1,17 @@ +{ + pkgs, + config, + lib, + ... +}: let + cfg = config.soispha.programs.nvim; +in { + home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { + plugins.lsp.servers = { + ruff_lsp = { + enable = true; + }; + }; + extraPackages = with pkgs; [ruff]; + }; +} diff --git a/modules/home.legacy/conf/nvim/plgs/lsp/servers/servers/rust-analyzer.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/rust-analyzer.nix index 5da61a71..01cd11f4 100644 --- a/modules/home.legacy/conf/nvim/plgs/lsp/servers/servers/rust-analyzer.nix +++ b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/rust-analyzer.nix @@ -1,5 +1,11 @@ -{...}: { - programs.nixvim.plugins.lsp.servers = { +{ + config, + lib, + ... +}: let + cfg = config.soispha.programs.nvim; +in { + home-manager.users.soispha.programs.nixvim.plugins.lsp.servers = lib.mkIf cfg.enable { rust_analyzer = { enable = true; settings = { diff --git a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/texlab.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/texlab.nix new file mode 100644 index 00000000..3f91beb5 --- /dev/null +++ b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/texlab.nix @@ -0,0 +1,13 @@ +{ + config, + lib, + ... +}: let + cfg = config.soispha.programs.nvim; +in { + home-manager.users.soispha.programs.nixvim.plugins.lsp.servers = lib.mkIf cfg.enable { + texlab = { + enable = true; + }; + }; +} diff --git a/modules/by-name/nv/nvim/plgs/lspkind/default.nix b/modules/by-name/nv/nvim/plgs/lspkind/default.nix new file mode 100644 index 00000000..078d607d --- /dev/null +++ b/modules/by-name/nv/nvim/plgs/lspkind/default.nix @@ -0,0 +1,12 @@ +{ + config, + lib, + ... +}: let + cfg = config.soispha.programs.nvim; +in { + home-manager.users.soispha.programs.nixvim.plugins.lspkind = lib.mkIf cfg.enable { + enable = true; + preset = "default"; # "codicons" is only for a font patched with vscode-codeicons. + }; +} diff --git a/modules/home.legacy/conf/nvim/plgs/ltex_extra/default.nix b/modules/by-name/nv/nvim/plgs/ltex_extra/default.nix index af78c7a5..c37a7591 100644 --- a/modules/home.legacy/conf/nvim/plgs/ltex_extra/default.nix +++ b/modules/by-name/nv/nvim/plgs/ltex_extra/default.nix @@ -1,5 +1,12 @@ -{pkgs, ...}: { - programs.nixvim = { +{ + pkgs, + config, + lib, + ... +}: let + cfg = config.soispha.programs.nvim; +in { + home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { # TODO: package ltex_extra though a module extraPlugins = [ pkgs.vimPlugins.ltex_extra-nvim diff --git a/modules/home.legacy/conf/nvim/plgs/ltex_extra/lua/ltex_extra.lua b/modules/by-name/nv/nvim/plgs/ltex_extra/lua/ltex_extra.lua index d532428a..d532428a 100644 --- a/modules/home.legacy/conf/nvim/plgs/ltex_extra/lua/ltex_extra.lua +++ b/modules/by-name/nv/nvim/plgs/ltex_extra/lua/ltex_extra.lua diff --git a/modules/by-name/nv/nvim/plgs/lualine/default.nix b/modules/by-name/nv/nvim/plgs/lualine/default.nix new file mode 100644 index 00000000..2f3bb552 --- /dev/null +++ b/modules/by-name/nv/nvim/plgs/lualine/default.nix @@ -0,0 +1,128 @@ +{ + config, + lib, + ... +}: let + cfg = config.soispha.programs.nvim; +in { + home-manager.users.soispha.programs.nixvim.plugins.lualine = let + get_location_of_file = { + __raw = '' + function() + local file_lines = vim.fn.line('$'); + local file_current_cursor_positon = vim.fn.getcurpos(); + return file_current_cursor_positon[3] .. ":" .. file_current_cursor_positon[2] .. "/" .. file_lines + end + ''; + }; + + get_trailing_whitespace = { + __raw = '' + function() + local space = vim.fn.search([[\s\+$]], 'nwc') + return space ~= 0 and "TW:" .. space or "" + end + ''; + }; + get_mixed_indent = { + __raw = + /* + lua + */ + '' + function() + local space_pat = [[\v^ +]] + local tab_pat = [[\v^\t+]] + local space_indent = vim.fn.search(space_pat, 'nwc') + local tab_indent = vim.fn.search(tab_pat, 'nwc') + local mixed = (space_indent > 0 and tab_indent > 0) + local mixed_same_line + if not mixed then + mixed_same_line = vim.fn.search([[\v^(\t+ | +\t)]], 'nwc') + mixed = mixed_same_line > 0 + end + if not mixed then return "" end + if mixed_same_line ~= nil and mixed_same_line > 0 then + return 'MI:' .. mixed_same_line + end + local space_indent_cnt = vim.fn.searchcount({ pattern = space_pat, max_count = 1e3 }).total + local tab_indent_cnt = vim.fn.searchcount({ pattern = tab_pat, max_count = 1e3 }).total + if space_indent_cnt > tab_indent_cnt then + return 'MI:' .. tab_indent + else + return 'MI:' .. space_indent + end + end + ''; + }; + in + lib.mkIf cfg.enable { + enable = true; + + settings = { + options = { + iconsEnabled = true; + theme = "nightfox"; + }; + + # TODO: add all installed and supported extensions here + extensions = [ + "toggleterm" + #"fugitive" # TODO: maybe add this? + ]; + + componentSeparators = { + left = ""; + right = ""; + }; + sectionSeparators = { + left = ""; + right = ""; + }; + disabledFiletypes = { + statusline = []; + winbar = []; + }; + ignoreFocus = []; + alwaysDivideMiddle = true; + globalstatus = false; + refresh = { + statusline = 1000; + tabline = 1000; + winbar = 1000; + }; + sections = { + lualine_a = ["mode"]; + lualine_b = [ + { + __raw = '' + {'FugitiveHead', icon = ""} + ''; + } + "diff" + "diagnostics" + ]; + lualine_c = ["filename"]; + lualine_x = ["searchcount" "filetype"]; + lualine_y = [ + "encoding" + "fileformat" + get_mixed_indent + get_trailing_whitespace + ]; + lualine_z = [get_location_of_file]; + }; + inactiveSections = { + lualine_a = []; + lualine_b = []; + lualine_c = ["filename"]; + lualine_x = [get_location_of_file]; + lualine_y = []; + lualine_z = []; + }; + tabline = {}; + winbar = {}; + inactiveWinbar = {}; + }; + }; +} diff --git a/modules/home.legacy/conf/nvim/plgs/luasnip/default.nix b/modules/by-name/nv/nvim/plgs/luasnip/default.nix index 130fafee..f67c9899 100644 --- a/modules/home.legacy/conf/nvim/plgs/luasnip/default.nix +++ b/modules/by-name/nv/nvim/plgs/luasnip/default.nix @@ -1,9 +1,12 @@ { lib, + config, pkgs, ... -}: { - programs.nixvim = { +}: let + cfg = config.soispha.programs.nvim; +in { + home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { plugins.luasnip = { enable = true; }; diff --git a/modules/home.legacy/conf/nvim/plgs/luasnip/lua/luasnip.lua b/modules/by-name/nv/nvim/plgs/luasnip/lua/luasnip.lua index a05fa57f..a05fa57f 100644 --- a/modules/home.legacy/conf/nvim/plgs/luasnip/lua/luasnip.lua +++ b/modules/by-name/nv/nvim/plgs/luasnip/lua/luasnip.lua diff --git a/modules/home.legacy/conf/nvim/plgs/luasnip/lua/snippets/all.lua b/modules/by-name/nv/nvim/plgs/luasnip/lua/snippets/all.lua index 2b923f20..2b923f20 100644 --- a/modules/home.legacy/conf/nvim/plgs/luasnip/lua/snippets/all.lua +++ b/modules/by-name/nv/nvim/plgs/luasnip/lua/snippets/all.lua diff --git a/modules/home.legacy/conf/nvim/plgs/luasnip/lua/snippets/html/html.lua b/modules/by-name/nv/nvim/plgs/luasnip/lua/snippets/html/html.lua index 568c97ec..568c97ec 100644 --- a/modules/home.legacy/conf/nvim/plgs/luasnip/lua/snippets/html/html.lua +++ b/modules/by-name/nv/nvim/plgs/luasnip/lua/snippets/html/html.lua diff --git a/modules/home.legacy/conf/nvim/plgs/luasnip/lua/snippets/tex/delimiter.lua b/modules/by-name/nv/nvim/plgs/luasnip/lua/snippets/tex/delimiter.lua index ef453973..ef453973 100644 --- a/modules/home.legacy/conf/nvim/plgs/luasnip/lua/snippets/tex/delimiter.lua +++ b/modules/by-name/nv/nvim/plgs/luasnip/lua/snippets/tex/delimiter.lua diff --git a/modules/home.legacy/conf/nvim/plgs/luasnip/lua/snippets/tex/greek.lua b/modules/by-name/nv/nvim/plgs/luasnip/lua/snippets/tex/greek.lua index ebf4f9d7..ebf4f9d7 100644 --- a/modules/home.legacy/conf/nvim/plgs/luasnip/lua/snippets/tex/greek.lua +++ b/modules/by-name/nv/nvim/plgs/luasnip/lua/snippets/tex/greek.lua diff --git a/modules/by-name/nv/nvim/plgs/neorg/default.nix b/modules/by-name/nv/nvim/plgs/neorg/default.nix new file mode 100644 index 00000000..cf046e06 --- /dev/null +++ b/modules/by-name/nv/nvim/plgs/neorg/default.nix @@ -0,0 +1,70 @@ +{ + config, + lib, + pkgsStable, + ... +}: let + cfg = config.soispha.programs.nvim; +in { + home-manager.users.soispha.programs.nixvim.plugins = lib.mkIf cfg.enable { + cmp.settings.sources = [ + {name = "neorg";} + ]; + + neorg = { + package = pkgsStable.vimPlugins.neorg; + enable = true; + lazyLoading = true; + + modules = { + "core.defaults" = { + __empty = null; + }; + "core.esupports.metagen".config = { + type = "auto"; + }; + "core.journal".config = { + workspace = "journal"; + }; + "core.keybinds".config = { + hook = { + __raw = '' + function(keybinds) + -- remap the looking glas to the same key, femaco is also mapped to. + keybinds.remap_event("norg", "n", "<space>cc", "core.looking-glass.magnify-code-block") + + keybinds.remap_event("norg", "n", "<C-s>", "core.integrations.telescope.find_linkable") + keybinds.remap_event("norg", "i", "<C-i>", "core.integrations.telescope.insert_link") + end, + ''; + }; + }; + "core.completion".config = { + engine = "nvim-cmp"; + }; + "core.concealer".config = { + __empty = null; + }; + "core.dirman".config = { + workspaces = { + general = "~/repos/notes/general"; + journal = "~/repos/notes/journal"; + projects = "~/repos/notes/projects"; + }; + }; + "core.export".config = { + __empty = null; + }; + "core.integrations.telescope".config = { + __empty = null; + }; + + # TODO: Add this when the nvim version in nixpkgs is >= 0.10 <2023-08-29> + # + # "core.ui.calendar".config = { + # __empty = null; + # }; + }; + }; + }; +} diff --git a/modules/home.legacy/conf/nvim/plgs/nvim-cmp/default.nix b/modules/by-name/nv/nvim/plgs/nvim-cmp/default.nix index ed0e57c3..8d61dbd7 100644 --- a/modules/home.legacy/conf/nvim/plgs/nvim-cmp/default.nix +++ b/modules/by-name/nv/nvim/plgs/nvim-cmp/default.nix @@ -1,10 +1,11 @@ -{config, ...}: { - programs.nixvim.plugins.cmp = let - neorg_source = - if config.programs.nixvim.plugins.neorg.modules."core.completion".config.engine == "nvim-cmp" - then [{name = "neorg";}] - else []; - in { +{ + config, + lib, + ... +}: let + cfg = config.soispha.programs.nvim; +in { + home-manager.users.soispha.programs.nixvim.plugins.cmp = lib.mkIf cfg.enable { /* TODO: integrate this: ```lua @@ -36,19 +37,17 @@ snippet.expand = "function(args) require('luasnip').lsp_expand(args.body) end"; - sources = - [ - {name = "nvim_lsp";} - {name = "luasnip";} - {name = "path";} - {name = "git";} # TODO: I might want to add config to allow all issues/prs <2023-10-16> - # {name = "convertionalcommits";} # TODO: Useless without commitlint [https://commitlint.js.org/] <2023-10-16> - # {name = "rg";} # TODO: This might really RIP-grep my system <2023-10-16> - # {name = "buffer";} - # {name = "digraphs";} - {name = "calc";} - ] - ++ neorg_source; + sources = [ + {name = "nvim_lsp";} + {name = "luasnip";} + {name = "path";} + {name = "git";} # TODO: I might want to add config to allow all issues/prs <2023-10-16> + # {name = "convertionalcommits";} # TODO: Useless without commitlint [https://commitlint.js.org/] <2023-10-16> + # {name = "rg";} # TODO: This might really RIP-grep my system <2023-10-16> + # {name = "buffer";} + # {name = "digraphs";} + {name = "calc";} + ]; }; }; } diff --git a/modules/home.legacy/conf/nvim/plgs/nvim-lint/default.nix b/modules/by-name/nv/nvim/plgs/nvim-lint/default.nix index f5cb9acf..ee057a9b 100644 --- a/modules/home.legacy/conf/nvim/plgs/nvim-lint/default.nix +++ b/modules/by-name/nv/nvim/plgs/nvim-lint/default.nix @@ -1,9 +1,12 @@ { pkgs, + config, lib, ... -}: { - programs.nixvim = { +}: let + cfg = config.soispha.programs.nvim; +in { + home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { # TODO: package nvim-lint though a module extraConfigLuaPost = '' ${lib.strings.fileContents ./lua/nvim-lint.lua} diff --git a/modules/home.legacy/conf/nvim/plgs/nvim-lint/lua/nvim-lint.lua b/modules/by-name/nv/nvim/plgs/nvim-lint/lua/nvim-lint.lua index 770c3bb5..770c3bb5 100644 --- a/modules/home.legacy/conf/nvim/plgs/nvim-lint/lua/nvim-lint.lua +++ b/modules/by-name/nv/nvim/plgs/nvim-lint/lua/nvim-lint.lua diff --git a/modules/home.legacy/conf/nvim/plgs/raw_plugins/default.nix b/modules/by-name/nv/nvim/plgs/raw_plugins/default.nix index 941cb7cb..e5d401a0 100644 --- a/modules/home.legacy/conf/nvim/plgs/raw_plugins/default.nix +++ b/modules/by-name/nv/nvim/plgs/raw_plugins/default.nix @@ -1,5 +1,11 @@ -{...}: { - programs.nixvim = { +{ + config, + lib, + ... +}: let + cfg = config.soispha.programs.nvim; +in { + home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { # Not all plugins have own modules # You can add missing plugins here # `pkgs.vimExtraPlugins` is added by the overlay you added at the beginning diff --git a/modules/home.legacy/conf/nvim/plgs/telescope/default.nix b/modules/by-name/nv/nvim/plgs/telescope/default.nix index c32e139c..193ee1ac 100644 --- a/modules/home.legacy/conf/nvim/plgs/telescope/default.nix +++ b/modules/by-name/nv/nvim/plgs/telescope/default.nix @@ -1,10 +1,16 @@ -{...}: { +{ + config, + lib, + ... +}: let + cfg = config.soispha.programs.nvim; +in { imports = [ ./defaults ./keymaps ./extensions ]; - programs.nixvim.plugins = { + home-manager.users.soispha.programs.nixvim.plugins = lib.mkIf cfg.enable { telescope = { enable = true; }; diff --git a/modules/home.legacy/conf/nvim/plgs/telescope/defaults/default.nix b/modules/by-name/nv/nvim/plgs/telescope/defaults/default.nix index 933089ef..11d04304 100644 --- a/modules/home.legacy/conf/nvim/plgs/telescope/defaults/default.nix +++ b/modules/by-name/nv/nvim/plgs/telescope/defaults/default.nix @@ -1,5 +1,11 @@ -{...}: { - programs.nixvim.plugins.telescope.settings.defaults = { +{ + config, + lib, + ... +}: let + cfg = config.soispha.programs.nvim; +in { + home-manager.users.soispha.programs.nixvim.plugins.telescope.settings.defaults = lib.mkIf cfg.enable { mappings = let insert_and_normal_mappings = { # map actions.which_key to <c-h> (default: <c-/>) diff --git a/modules/home.legacy/conf/nvim/plgs/telescope/extensions/bibtex/default.nix b/modules/by-name/nv/nvim/plgs/telescope/extensions/bibtex/default.nix index 6f3cc2ea..e263cfdc 100644 --- a/modules/home.legacy/conf/nvim/plgs/telescope/extensions/bibtex/default.nix +++ b/modules/by-name/nv/nvim/plgs/telescope/extensions/bibtex/default.nix @@ -1,6 +1,13 @@ -{pkgs, ...}: { +{ + pkgs, + config, + lib, + ... +}: let + cfg = config.soispha.programs.nvim; +in { # WARNING: This is only activated in tex files via the ftplugin. - programs.nixvim = { + home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { extraPlugins = [ pkgs.vimExtraPlugins.telescope-bibtex-nvim ]; diff --git a/modules/home.legacy/conf/nvim/plgs/telescope/extensions/default.nix b/modules/by-name/nv/nvim/plgs/telescope/extensions/default.nix index 0b1e033a..0b1e033a 100644 --- a/modules/home.legacy/conf/nvim/plgs/telescope/extensions/default.nix +++ b/modules/by-name/nv/nvim/plgs/telescope/extensions/default.nix diff --git a/modules/home.legacy/conf/nvim/plgs/telescope/extensions/frecency/default.nix b/modules/by-name/nv/nvim/plgs/telescope/extensions/frecency/default.nix index 0e007b80..f4e3d116 100644 --- a/modules/home.legacy/conf/nvim/plgs/telescope/extensions/frecency/default.nix +++ b/modules/by-name/nv/nvim/plgs/telescope/extensions/frecency/default.nix @@ -1,5 +1,11 @@ -{...}: { - programs.nixvim = { +{ + lib, + config, + ... +}: let + cfg = config.soispha.programs.nvim; +in { + home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { keymaps = [ { key = "gff"; diff --git a/modules/by-name/nv/nvim/plgs/telescope/extensions/fzy-native/default.nix b/modules/by-name/nv/nvim/plgs/telescope/extensions/fzy-native/default.nix new file mode 100644 index 00000000..4194e688 --- /dev/null +++ b/modules/by-name/nv/nvim/plgs/telescope/extensions/fzy-native/default.nix @@ -0,0 +1,11 @@ +{ + config, + lib, + ... +}: let + cfg = config.soispha.programs.nvim; +in { + home-manager.users.soispha.programs.nixvim.plugins.telescope.extensions.fzy-native = lib.mkIf cfg.enable { + enable = true; + }; +} diff --git a/modules/by-name/nv/nvim/plgs/telescope/extensions/rooter/default.nix b/modules/by-name/nv/nvim/plgs/telescope/extensions/rooter/default.nix new file mode 100644 index 00000000..6153b063 --- /dev/null +++ b/modules/by-name/nv/nvim/plgs/telescope/extensions/rooter/default.nix @@ -0,0 +1,13 @@ +{ + lib, + config, + ... +}: let + cfg = config.soispha.programs.nvim; +in { + home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { + extraConfigLuaPost = '' + ${lib.strings.fileContents ./lua/rooter.lua} + ''; + }; +} diff --git a/modules/home.legacy/conf/nvim/plgs/telescope/extensions/rooter/lua/rooter.lua b/modules/by-name/nv/nvim/plgs/telescope/extensions/rooter/lua/rooter.lua index 48a8588d..48a8588d 100644 --- a/modules/home.legacy/conf/nvim/plgs/telescope/extensions/rooter/lua/rooter.lua +++ b/modules/by-name/nv/nvim/plgs/telescope/extensions/rooter/lua/rooter.lua diff --git a/modules/home.legacy/conf/nvim/plgs/telescope/extensions/symbols/default.nix b/modules/by-name/nv/nvim/plgs/telescope/extensions/symbols/default.nix index 05b4a4f2..adbb466a 100644 --- a/modules/home.legacy/conf/nvim/plgs/telescope/extensions/symbols/default.nix +++ b/modules/by-name/nv/nvim/plgs/telescope/extensions/symbols/default.nix @@ -1,5 +1,12 @@ -{pkgs, ...}: { - programs.nixvim = { +{ + pkgs, + config, + lib, + ... +}: let + cfg = config.soispha.programs.nvim; +in { + home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { extraPlugins = [ # Source of symbols for telescope symbols pkgs.vimPlugins.telescope-symbols-nvim diff --git a/modules/by-name/nv/nvim/plgs/telescope/keymaps/default.nix b/modules/by-name/nv/nvim/plgs/telescope/keymaps/default.nix new file mode 100644 index 00000000..a474f097 --- /dev/null +++ b/modules/by-name/nv/nvim/plgs/telescope/keymaps/default.nix @@ -0,0 +1,16 @@ +{ + config, + lib, + ... +}: let + cfg = config.soispha.programs.nvim; +in { + home-manager.users.soispha.programs.nixvim.plugins.telescope.keymaps = lib.mkIf cfg.enable { + "<space>rg" = { + action = "live_grep"; + options = { + desc = "[rg] in a live session"; + }; + }; + }; +} diff --git a/modules/home.legacy/conf/nvim/plgs/todo-comments/default.nix b/modules/by-name/nv/nvim/plgs/todo-comments/default.nix index e33f961b..ddbe367d 100644 --- a/modules/home.legacy/conf/nvim/plgs/todo-comments/default.nix +++ b/modules/by-name/nv/nvim/plgs/todo-comments/default.nix @@ -1,5 +1,11 @@ -{...}: { - programs.nixvim.plugins.todo-comments = { +{ + config, + lib, + ... +}: let + cfg = config.soispha.programs.nvim; +in { + home-manager.users.soispha.programs.nixvim.plugins.todo-comments = lib.mkIf cfg.enable { enable = true; settings = { guiStyle = { diff --git a/modules/home.legacy/conf/nvim/plgs/treesitter/default.nix b/modules/by-name/nv/nvim/plgs/treesitter/default.nix index b4b20388..02088d0a 100644 --- a/modules/home.legacy/conf/nvim/plgs/treesitter/default.nix +++ b/modules/by-name/nv/nvim/plgs/treesitter/default.nix @@ -3,8 +3,10 @@ pkgs, lib, ... -}: { - programs.nixvim = { +}: let + cfg = config.soispha.programs.nvim; +in { + home-manager.users.soispha. programs.nixvim = lib.mkIf cfg.enable { plugins.treesitter = { enable = true; @@ -18,7 +20,9 @@ nixGrammars = true; grammarPackages = - config.programs.nixvim.plugins.treesitter.package.passthru.allGrammars + # Append the `tree-sitter-yts` grammar to all the other grammars. + # TODO: Find a better way to do this. <2024-11-08> + config.home-manager.users.soispha.programs.nixvim.plugins.treesitter.package.passthru.allGrammars ++ [pkgs.tree-sitter-yts]; settings = { diff --git a/modules/home.legacy/conf/nvim/plgs/vim-tex/default.nix b/modules/by-name/nv/nvim/plgs/vim-tex/default.nix index 0b92c429..680f169a 100644 --- a/modules/home.legacy/conf/nvim/plgs/vim-tex/default.nix +++ b/modules/by-name/nv/nvim/plgs/vim-tex/default.nix @@ -1,5 +1,11 @@ -{...}: { - programs.nixvim = { +{ + config, + lib, + ... +}: let + cfg = config.soispha.programs.nvim; +in { + home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { opts.conceallevel = 0; plugins.vimtex = { diff --git a/modules/by-name/nv/nvim/plgs/which-key/default.nix b/modules/by-name/nv/nvim/plgs/which-key/default.nix new file mode 100644 index 00000000..20004bb1 --- /dev/null +++ b/modules/by-name/nv/nvim/plgs/which-key/default.nix @@ -0,0 +1,11 @@ +{ + config, + lib, + ... +}: let + cfg = config.soispha.programs.nvim; +in { + home-manager.users.soispha.programs.nixvim.plugins.which-key = lib.mkIf cfg.enable { + enable = true; + }; +} diff --git a/modules/home.legacy/conf/default.nix b/modules/home.legacy/conf/default.nix index 138e2080..e943f7b6 100644 --- a/modules/home.legacy/conf/default.nix +++ b/modules/home.legacy/conf/default.nix @@ -23,7 +23,6 @@ ./neomutt ./nix-index ./npm - ./nvim ./prusa_slicer ./python ./rclone diff --git a/modules/home.legacy/conf/nvim/autocmds/default.nix b/modules/home.legacy/conf/nvim/autocmds/default.nix deleted file mode 100644 index a8f00bdc..00000000 --- a/modules/home.legacy/conf/nvim/autocmds/default.nix +++ /dev/null @@ -1,124 +0,0 @@ -{config, ...}: { - programs.nixvim = { - autoGroups = { - cursor_off = {clear = true;}; - colorcolumn_toggle = {clear = true;}; - numbertoggle = {clear = true;}; - coloroverride = {clear = true;}; - highlight_on_yank = {clear = true;}; - create_dir = {clear = true;}; - }; - autoCmd = [ - { - # Taken from: https://github.com/jghauser/mkdir.nvim - event = ["BufWritePre"]; - pattern = ["*"]; - callback = { - __raw = '' - function() - -- Get current filename, get full path (:p) and leave only the head (:h) - local dir = vim.fn.expand('<afile>:p:h') - - -- This handles URLs using netrw. See ':help netrw-transparent' for details. - if dir:find('%l+://') == 1 then - return - end - - if vim.fn.isdirectory(dir) == 0 then - vim.fn.mkdir(dir, 'p') - end - end - ''; - }; - group = "create_dir"; - desc = "Create the directory of the target file on write"; - } - { - event = ["TextYankPost"]; - pattern = ["*"]; - callback = { - __raw = '' - function() - vim.highlight.on_yank() - end - ''; - }; - group = "highlight_on_yank"; - desc = "Highlight the yanked text"; - } - { - event = ["BufWritePre"]; - pattern = ["*"]; - command = '' - ks | if search("\\s\\+$", 'n') != 0 | :%s/\s\+$// | endif | 's - ''; - desc = '' - Remove trailing whitespace on safe - :%s/\s\+$\| \+\ze\t//g >> For trailing spaces and spaces before tabstops - ''; - } - - { - event = ["WinLeave"]; - pattern = ["*"]; - command = "set nocursorline"; # TODO: possible also nocursorcolumn - group = "cursor_off"; - desc = "Display cursorline and cursorcolumn ONLY in active window."; - } - { - event = ["WinEnter"]; - pattern = ["*"]; - command = "set cursorline"; # TODO: possible also cursorcolumn - group = "cursor_off"; - desc = "Display cursorline and cursorcolumn ONLY in active window."; - } - - { - event = ["InsertEnter"]; - pattern = ["*"]; - command = "set colorcolumn=${config.programs.nixvim.opts.colorcolumn}"; - group = "colorcolumn_toggle"; - desc = "Only activate the colorcolumn when focused"; - } - { - event = ["BufLeave" "FocusLost" "InsertLeave" "WinLeave"]; - pattern = ["*"]; - command = "set colorcolumn=0"; - group = "colorcolumn_toggle"; - desc = "Only activate the colorcolumn when focused"; - } - - { - event = ["BufEnter" "FocusGained" "InsertLeave" "WinEnter"]; - pattern = ["*"]; - command = "if &nu && mode() != \"i\" | set rnu | endif"; - group = "numbertoggle"; - desc = "Change line numbers, when not focused"; - } - { - event = ["BufLeave" "FocusLost" "InsertEnter" "WinLeave"]; - pattern = ["*"]; - command = "if &nu | set nornu | endif"; - group = "numbertoggle"; - desc = "Change line numbers, when not focused"; - } - - { - # Override LineNr - event = ["ColorScheme"]; - pattern = ["*"]; - command = "highlight LineNr ctermfg=DarkGrey guifg=DarkGrey "; - group = "coloroverride"; - desc = "Changes Line number colors"; - } - { - # Override CursorLineNr - event = ["ColorScheme"]; - pattern = ["*"]; - command = "highlight CursorLineNr ctermfg=White guifg=White "; - group = "coloroverride"; - desc = "Changes Line number colors"; - } - ]; - }; -} diff --git a/modules/home.legacy/conf/nvim/clipboard/default.nix b/modules/home.legacy/conf/nvim/clipboard/default.nix deleted file mode 100644 index 0a686190..00000000 --- a/modules/home.legacy/conf/nvim/clipboard/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{...}: { - programs.nixvim = { - clipboard.providers = { - wl-copy.enable = true; - }; - }; -} diff --git a/modules/home.legacy/conf/nvim/default.nix b/modules/home.legacy/conf/nvim/default.nix deleted file mode 100644 index 2da80c22..00000000 --- a/modules/home.legacy/conf/nvim/default.nix +++ /dev/null @@ -1,55 +0,0 @@ -{pkgs, ...}: { - imports = [ - ./autocmds - ./clipboard - ./files - ./mappings - ./options - ./plgs - ]; - home.sessionVariables = { - EDITOR = "nvim"; - VISUAL = "nvim"; - CODEEDITOR = "nvim"; - }; - programs.nixvim = { - enable = true; - - # source: https://www.patorjk.com/software/taag/#p=display&f=ANSI%20Shadow&t=Neovim - extraConfigLuaPre = - /* - FIXME: Update the merge function to support that: <2023-08-29> - - lib.mkBefore - */ - '' - --------------------------------------------------------------------------- - -- - -- ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ - -- ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ - -- ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ - -- ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ - -- ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ - -- ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ - -- - --------------------------------------------------------------------------- - ''; - - extraPackages = with pkgs; [ - /* - These are mostly linters and formatters used for different file types. - Including them here is fine, as they are not necessarily sync able to different people. - */ - # nix - alejandra - statix - - # yaml - yamllint - - # shell - shellcheck - shfmt - ]; - }; -} diff --git a/modules/home.legacy/conf/nvim/files/default.nix b/modules/home.legacy/conf/nvim/files/default.nix deleted file mode 100644 index f935ac7b..00000000 --- a/modules/home.legacy/conf/nvim/files/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{lib, ...}: { - programs.nixvim = { - extraFiles = { - "ftplugin/tex.lua".text = '' - ${lib.strings.fileContents ./ftplugin/tex.lua} - ''; - }; - }; -} diff --git a/modules/home.legacy/conf/nvim/mappings/default.nix b/modules/home.legacy/conf/nvim/mappings/default.nix deleted file mode 100644 index d422abf7..00000000 --- a/modules/home.legacy/conf/nvim/mappings/default.nix +++ /dev/null @@ -1,298 +0,0 @@ -{lib, ...}: { - programs.nixvim = { - globals = { - mapleader = " "; - maplocalleader = " "; - }; - keymaps = [ - { - mode = ["n" "i"]; - key = "<Esc>"; - action = "<cmd>noh<CR><Esc>"; - options.desc = "Disable the search highlighting and send Escape"; - } - { - key = "hh"; - mode = ["i"]; - action.__raw = '' - function() - local cmp = require('cmp'); - local luasnip = require('luasnip'); - - if cmp.visible() then - cmp.select_next_item() - elseif luasnip.expand_or_locally_jumpable() then - luasnip.expand_or_jump() - end - end - ''; - options.desc = "completion trigger/ forward in completen menu"; - } - { - key = "uu"; - mode = ["i"]; - action.__raw = '' - function() - local cmp = require('cmp'); - cmp.confirm() - end - ''; - options.desc = "confirm the selected item"; - } - - { - key = "<C-Tab>"; - action = "<cmd>tabnext<CR>"; - options.desc = "cycle to the next tab"; - } - { - key = "<S-C-Tab>"; - action = "<cmd>tabprevious<CR>"; - options.desc = "cycle to the previous tab"; - } - - # yank/ cut to the system clipboard - { - key = "<leader>y"; - action = "\"+y"; - options.desc = "yank to the system clipboard"; - } - { - key = "<leader>Y"; - action = "\"+Y"; - options.desc = "yank until the end of the line to the system clipboard"; - } - - # Unmap some old keys - #{key = "s"; action = "'<Nop>'";} - #{key = "t"; action = "'<Nop>'";} - { - key = "<Up>"; - action = "<Nop>"; - } - { - key = "<Down>"; - action = "<Nop>"; - } - { - key = "<Left>"; - action = "<Nop>"; - } - { - key = "<Right>"; - action = "<Nop>"; - } - - # Center the cursor vertically when moving to the next word during a search. - { - key = "l"; - action = "nzzzv"; - options.desc = "Center the cursor vertically when moving to the next word during a search."; - } - { - key = "L"; - action = "Nzzzv"; - options.desc = "Center the cursor vertically when moving to the next word during a search."; - } - # remap the other keys to dvorak - { - key = "k"; - action = "t"; - options.desc = "go the the right on char"; - } - { - key = "K"; - action = "T"; - options.desc = "go to the left on char"; - } - { - key = "j"; - action = "k"; - options.desc = "go to the right before the char"; - } - { - key = "J"; - action = "K"; - options.desc = "go to the left before the char"; - } - - # Change Vim-keys - { - key = "h"; - action = "<left>"; - options.desc = "go left"; - } - { - key = "t"; - action = "g<down>"; - options.desc = "go down, with displaylines"; - } - { - key = "n"; - action = "g<up>"; - options.desc = "go up, with displaylines"; - } - { - key = "s"; - action = "<right>"; - options.desc = "go right"; - } - - # Move display lines - { - key = "0"; - action = "g0"; - options.desc = "go to the leftmost character in the screen line"; - } - { - key = "$"; - action = "g$"; - options.desc = "go to the rightmost character in the screen line"; - } - { - mode = ["n"]; - key = "<Enter>"; - action = "gf"; - options.desc = "open file/url under cursor"; - } - { - mode = ["n"]; - key = "<Tab>"; - action = ":"; - options.desc = "jump to command line"; - } - - { - mode = ["n"]; - key = "\\f"; - action.__raw = "function() require('lf').start() end"; - options.desc = "open lf in a floating window"; - } - - # Splits - { - mode = ["n"]; - key = "<C-t>"; - action = "<C-w>p"; - options.desc = "go to previous split"; - } - { - mode = ["n"]; - key = "<C-n>"; - action = "<C-w>w"; - options.desc = "go to next split"; - } - { - mode = ["n"]; - key = "<leader>-"; - action = "<C-W>s"; - options.desc = "New horizontal split"; - } - { - mode = ["n"]; - key = "<leader>|"; - action = "<C-W>v"; - options.desc = "New vertical split"; - } - - { - mode = ["n"]; - key = "<leader>p"; - action = "\"_dP"; - options.desc = "keep the cut thing in the base register"; - } - { - mode = ["n"]; - key = "<leader>c"; - action = "\"_c"; - options.desc = "change without saving to register"; - } - - { - mode = ["n"]; - key = "<leader>d"; - action = "\"_d"; - options.desc = "delete without saving to register"; - } - { - key = "x"; - mode = ["n"]; - action.__raw = '' - function() - local col = vim.api.nvim_win_get_cursor(0)[2] - local char = vim.api.nvim_get_current_line():sub(col+1,col+1) - if char:match("%s") then - return '"_x' - else - return "x" - end - end - ''; - options = { - desc = "Pipe all space only deletions to the blackhole register"; - expr = true; - silent = true; - }; - } - { - key = "dd"; - mode = ["n"]; - action.__raw = '' - function() - if vim.api.nvim_get_current_line():match("^%s*$") then - return '"_dd' - else - return "dd" - end - end - ''; - options = { - desc = "Pipe all blank line deletions to the blackhole register"; - expr = true; - silent = true; - }; - } - - { - mode = ["n"]; - key = "<leader>s"; - action = ":%s/\\<<C-r><C-w>\\>/<C-r><C-w>/gI<Left><Left><Left>"; - options.desc = "replace for the word under the cursor"; - } - - { - mode = ["n"]; - key = "<C-s>"; - action = "<cmd>mksession! <CR>"; - options.desc = "overwrite/create a session"; - } - - { - mode = ["n"]; - key = "<leader>X"; - action = "!!$SHELL <CR>"; - options.desc = "Read the current line and execute that line in your $SHELL. The resulting output will replace the curent line that was being executed."; - } - { - mode = ["t"]; - key = "<Esc><Esc>"; - action = "<C-\\><C-n>"; - options.desc = "Exit terminal mode with <Esc><Esc>"; - } - - # move selected lines in visual mode - { - mode = ["v"]; - key = "T"; - action = ":m '>+1<CR>gv=gv"; - options.desc = "move selected lines in visual mode down"; - } - { - mode = ["v"]; - key = "N"; - action = ":m '<-2<CR>gv=gv"; - options.desc = "move selected lines in visual mode up"; - } - ]; - }; -} diff --git a/modules/home.legacy/conf/nvim/plgs/lsp/servers/servers/bashls.nix b/modules/home.legacy/conf/nvim/plgs/lsp/servers/servers/bashls.nix deleted file mode 100644 index 0577a335..00000000 --- a/modules/home.legacy/conf/nvim/plgs/lsp/servers/servers/bashls.nix +++ /dev/null @@ -1,5 +0,0 @@ -{...}: { - programs.nixvim.plugins.lsp.servers = { - bashls.enable = true; - }; -} diff --git a/modules/home.legacy/conf/nvim/plgs/lsp/servers/servers/ccls.nix b/modules/home.legacy/conf/nvim/plgs/lsp/servers/servers/ccls.nix deleted file mode 100644 index 0698bcce..00000000 --- a/modules/home.legacy/conf/nvim/plgs/lsp/servers/servers/ccls.nix +++ /dev/null @@ -1,5 +0,0 @@ -{...}: { - programs.nixvim.plugins.lsp.servers = { - ccls.enable = true; - }; -} diff --git a/modules/home.legacy/conf/nvim/plgs/lsp/servers/servers/lua-ls.nix b/modules/home.legacy/conf/nvim/plgs/lsp/servers/servers/lua-ls.nix deleted file mode 100644 index 4f20558c..00000000 --- a/modules/home.legacy/conf/nvim/plgs/lsp/servers/servers/lua-ls.nix +++ /dev/null @@ -1,8 +0,0 @@ -{...}: { - programs.nixvim.plugins.lsp.servers = { - lua_ls = { - enable = true; - settings.telemetry.enable = false; - }; - }; -} diff --git a/modules/home.legacy/conf/nvim/plgs/lsp/servers/servers/nil-ls.nix b/modules/home.legacy/conf/nvim/plgs/lsp/servers/servers/nil-ls.nix deleted file mode 100644 index f0cccbdc..00000000 --- a/modules/home.legacy/conf/nvim/plgs/lsp/servers/servers/nil-ls.nix +++ /dev/null @@ -1,10 +0,0 @@ -{...}: { - programs.nixvim.plugins.lsp.servers = { - nil_ls = { - enable = true; - settings = { - formatting.command = ["alejandra"]; - }; - }; - }; -} diff --git a/modules/home.legacy/conf/nvim/plgs/lsp/servers/servers/ruff-lsp.nix b/modules/home.legacy/conf/nvim/plgs/lsp/servers/servers/ruff-lsp.nix deleted file mode 100644 index 6fbdc998..00000000 --- a/modules/home.legacy/conf/nvim/plgs/lsp/servers/servers/ruff-lsp.nix +++ /dev/null @@ -1,10 +0,0 @@ -{pkgs, ...}: { - programs.nixvim = { - plugins.lsp.servers = { - ruff_lsp = { - enable = true; - }; - }; - extraPackages = with pkgs; [ruff]; - }; -} diff --git a/modules/home.legacy/conf/nvim/plgs/lsp/servers/servers/texlab.nix b/modules/home.legacy/conf/nvim/plgs/lsp/servers/servers/texlab.nix deleted file mode 100644 index 59af8d39..00000000 --- a/modules/home.legacy/conf/nvim/plgs/lsp/servers/servers/texlab.nix +++ /dev/null @@ -1,7 +0,0 @@ -{...}: { - programs.nixvim.plugins.lsp.servers = { - texlab = { - enable = true; - }; - }; -} diff --git a/modules/home.legacy/conf/nvim/plgs/lspkind/default.nix b/modules/home.legacy/conf/nvim/plgs/lspkind/default.nix deleted file mode 100644 index ed7d411b..00000000 --- a/modules/home.legacy/conf/nvim/plgs/lspkind/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{...}: { - programs.nixvim.plugins.lspkind = { - enable = true; - preset = "default"; # "codicons" is only for a font patched with vscode-codeicons. - }; -} diff --git a/modules/home.legacy/conf/nvim/plgs/lualine/default.nix b/modules/home.legacy/conf/nvim/plgs/lualine/default.nix deleted file mode 100644 index 54d20380..00000000 --- a/modules/home.legacy/conf/nvim/plgs/lualine/default.nix +++ /dev/null @@ -1,121 +0,0 @@ -{...}: { - programs.nixvim.plugins.lualine = let - get_location_of_file = { - __raw = '' - function() - local file_lines = vim.fn.line('$'); - local file_current_cursor_positon = vim.fn.getcurpos(); - return file_current_cursor_positon[3] .. ":" .. file_current_cursor_positon[2] .. "/" .. file_lines - end - ''; - }; - - get_trailing_whitespace = { - __raw = '' - function() - local space = vim.fn.search([[\s\+$]], 'nwc') - return space ~= 0 and "TW:" .. space or "" - end - ''; - }; - get_mixed_indent = { - __raw = - /* - lua - */ - '' - function() - local space_pat = [[\v^ +]] - local tab_pat = [[\v^\t+]] - local space_indent = vim.fn.search(space_pat, 'nwc') - local tab_indent = vim.fn.search(tab_pat, 'nwc') - local mixed = (space_indent > 0 and tab_indent > 0) - local mixed_same_line - if not mixed then - mixed_same_line = vim.fn.search([[\v^(\t+ | +\t)]], 'nwc') - mixed = mixed_same_line > 0 - end - if not mixed then return "" end - if mixed_same_line ~= nil and mixed_same_line > 0 then - return 'MI:' .. mixed_same_line - end - local space_indent_cnt = vim.fn.searchcount({ pattern = space_pat, max_count = 1e3 }).total - local tab_indent_cnt = vim.fn.searchcount({ pattern = tab_pat, max_count = 1e3 }).total - if space_indent_cnt > tab_indent_cnt then - return 'MI:' .. tab_indent - else - return 'MI:' .. space_indent - end - end - ''; - }; - in { - enable = true; - - settings = { - options = { - iconsEnabled = true; - theme = "nightfox"; - }; - - # TODO: add all installed and supported extensions here - extensions = [ - "toggleterm" - #"fugitive" # TODO: maybe add this? - ]; - - componentSeparators = { - left = ""; - right = ""; - }; - sectionSeparators = { - left = ""; - right = ""; - }; - disabledFiletypes = { - statusline = []; - winbar = []; - }; - ignoreFocus = []; - alwaysDivideMiddle = true; - globalstatus = false; - refresh = { - statusline = 1000; - tabline = 1000; - winbar = 1000; - }; - sections = { - lualine_a = ["mode"]; - lualine_b = [ - { - __raw = '' - {'FugitiveHead', icon = ""} - ''; - } - "diff" - "diagnostics" - ]; - lualine_c = ["filename"]; - lualine_x = ["searchcount" "filetype"]; - lualine_y = [ - "encoding" - "fileformat" - get_mixed_indent - get_trailing_whitespace - ]; - lualine_z = [get_location_of_file]; - }; - inactiveSections = { - lualine_a = []; - lualine_b = []; - lualine_c = ["filename"]; - lualine_x = [get_location_of_file]; - lualine_y = []; - lualine_z = []; - }; - tabline = {}; - winbar = {}; - inactiveWinbar = {}; - }; - }; -} diff --git a/modules/home.legacy/conf/nvim/plgs/neorg/default.nix b/modules/home.legacy/conf/nvim/plgs/neorg/default.nix deleted file mode 100644 index 7d61ce09..00000000 --- a/modules/home.legacy/conf/nvim/plgs/neorg/default.nix +++ /dev/null @@ -1,57 +0,0 @@ -{pkgsStable, ...}: { - programs.nixvim.plugins.neorg = { - package = pkgsStable.vimPlugins.neorg; - enable = true; - lazyLoading = true; - - modules = { - "core.defaults" = { - __empty = null; - }; - "core.esupports.metagen".config = { - type = "auto"; - }; - "core.journal".config = { - workspace = "journal"; - }; - "core.keybinds".config = { - hook = { - __raw = '' - function(keybinds) - -- remap the looking glas to the same key, femaco is also mapped to. - keybinds.remap_event("norg", "n", "<space>cc", "core.looking-glass.magnify-code-block") - - keybinds.remap_event("norg", "n", "<C-s>", "core.integrations.telescope.find_linkable") - keybinds.remap_event("norg", "i", "<C-i>", "core.integrations.telescope.insert_link") - end, - ''; - }; - }; - "core.completion".config = { - engine = "nvim-cmp"; - }; - "core.concealer".config = { - __empty = null; - }; - "core.dirman".config = { - workspaces = { - general = "~/repos/notes/general"; - journal = "~/repos/notes/journal"; - projects = "~/repos/notes/projects"; - }; - }; - "core.export".config = { - __empty = null; - }; - "core.integrations.telescope".config = { - __empty = null; - }; - - # TODO: Add this when the nvim version in nixpkgs is >= 0.10 <2023-08-29> - # - # "core.ui.calendar".config = { - # __empty = null; - # }; - }; - }; -} diff --git a/modules/home.legacy/conf/nvim/plgs/telescope/extensions/fzy-native/default.nix b/modules/home.legacy/conf/nvim/plgs/telescope/extensions/fzy-native/default.nix deleted file mode 100644 index ce0bdccc..00000000 --- a/modules/home.legacy/conf/nvim/plgs/telescope/extensions/fzy-native/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{...}: { - programs.nixvim.plugins.telescope.extensions.fzy-native = { - enable = true; - }; -} diff --git a/modules/home.legacy/conf/nvim/plgs/telescope/extensions/rooter/default.nix b/modules/home.legacy/conf/nvim/plgs/telescope/extensions/rooter/default.nix deleted file mode 100644 index 779448cc..00000000 --- a/modules/home.legacy/conf/nvim/plgs/telescope/extensions/rooter/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{lib, ...}: { - programs.nixvim = { - extraConfigLuaPost = '' - ${lib.strings.fileContents ./lua/rooter.lua} - ''; - }; -} diff --git a/modules/home.legacy/conf/nvim/plgs/telescope/keymaps/default.nix b/modules/home.legacy/conf/nvim/plgs/telescope/keymaps/default.nix deleted file mode 100644 index e551cc5a..00000000 --- a/modules/home.legacy/conf/nvim/plgs/telescope/keymaps/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{...}: { - programs.nixvim.plugins.telescope.keymaps = { - "<space>rg" = { - action = "live_grep"; - options = { - desc = "[rg] in a live session"; - }; - }; - }; -} diff --git a/modules/home.legacy/conf/nvim/plgs/which-key/default.nix b/modules/home.legacy/conf/nvim/plgs/which-key/default.nix deleted file mode 100644 index be63f7ac..00000000 --- a/modules/home.legacy/conf/nvim/plgs/which-key/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{...}: { - programs.nixvim.plugins.which-key = { - enable = true; - }; -} |