diff --git a/home/programs/nixvim-old/default.nix b/home/programs/nixvim-old/default.nix new file mode 100644 index 0000000..02ef072 --- /dev/null +++ b/home/programs/nixvim-old/default.nix @@ -0,0 +1,21 @@ +{ inputs, pkgs, ... }: + +{ + imports = [ + ./plugins + ]; + + programs.nixvim = { + extraPackages = with pkgs; [ + texliveFull + texlivePackages.standalone + texlivePackages.relsize # needed for BA + # papis-nvim + ]; + extraConfigVim = '' + filetype plugin on + set nocompatible + syntax on + ''; + }; +} diff --git a/home/programs/nixvim/plugins/aerial.nix b/home/programs/nixvim-old/plugins/aerial.nix similarity index 100% rename from home/programs/nixvim/plugins/aerial.nix rename to home/programs/nixvim-old/plugins/aerial.nix diff --git a/home/programs/nixvim/plugins/autopairs.nix b/home/programs/nixvim-old/plugins/autopairs.nix similarity index 100% rename from home/programs/nixvim/plugins/autopairs.nix rename to home/programs/nixvim-old/plugins/autopairs.nix diff --git a/home/programs/nixvim/plugins/barbar.nix b/home/programs/nixvim-old/plugins/barbar.nix similarity index 100% rename from home/programs/nixvim/plugins/barbar.nix rename to home/programs/nixvim-old/plugins/barbar.nix diff --git a/home/programs/nixvim/plugins/bullets.nix b/home/programs/nixvim-old/plugins/bullets.nix similarity index 100% rename from home/programs/nixvim/plugins/bullets.nix rename to home/programs/nixvim-old/plugins/bullets.nix diff --git a/home/programs/nixvim/plugins/cmp.nix b/home/programs/nixvim-old/plugins/cmp.nix similarity index 100% rename from home/programs/nixvim/plugins/cmp.nix rename to home/programs/nixvim-old/plugins/cmp.nix diff --git a/home/programs/nixvim/plugins/comment-box.nix b/home/programs/nixvim-old/plugins/comment-box.nix similarity index 100% rename from home/programs/nixvim/plugins/comment-box.nix rename to home/programs/nixvim-old/plugins/comment-box.nix diff --git a/home/programs/nixvim/plugins/comment.nix b/home/programs/nixvim-old/plugins/comment.nix similarity index 100% rename from home/programs/nixvim/plugins/comment.nix rename to home/programs/nixvim-old/plugins/comment.nix diff --git a/home/programs/nixvim/plugins/conform.nix b/home/programs/nixvim-old/plugins/conform.nix similarity index 100% rename from home/programs/nixvim/plugins/conform.nix rename to home/programs/nixvim-old/plugins/conform.nix diff --git a/home/programs/nixvim/plugins/dap.nix b/home/programs/nixvim-old/plugins/dap.nix similarity index 100% rename from home/programs/nixvim/plugins/dap.nix rename to home/programs/nixvim-old/plugins/dap.nix diff --git a/home/programs/nixvim-old/plugins/default.nix b/home/programs/nixvim-old/plugins/default.nix new file mode 100644 index 0000000..56f491c --- /dev/null +++ b/home/programs/nixvim-old/plugins/default.nix @@ -0,0 +1,54 @@ +{ + imports = [ + ./aerial.nix + ./autopairs.nix + ./barbar.nix + ./bullets.nix + ./cmp.nix + ./comment-box.nix + ./comment.nix + ./conform.nix + ./dap.nix + ./diffview.nix + ./dynomark.nix + ./edgy.nix + ./gitsigns.nix + ./haskell-tools.nix + ./knap.nix + ./leap.nix + ./lsp.nix + ./ltex-extra.nix + ./lualine.nix + ./markdown-preview.nix + ./mkdnflow.nix + ./neoscroll.nix + ./neotree.nix + ./noice.nix + ./notify.nix + ./oil.nix + ./openscad.nix + ./otter.nix + ./papis.nix + ./peek.nix + ./markdown-preview.nix + ./smart-splits.nix + ./snippets.nix + ./sniprun.nix + ./startup.nix + ./surround.nix + ./telescope.nix + ./texpresso.nix + ./todo-comments.nix + ./toggleterm.nix + ./treesitter.nix + ./trouble.nix + ./typst-preview.nix + ./typst-vim.nix + ./undotree.nix + ./vimtex.nix + ./web-devicons.nix + ./which-key.nix + ./yanky.nix + ./zk.nix + ]; +} diff --git a/home/programs/nixvim/plugins/dynomark.nix b/home/programs/nixvim-old/plugins/dynomark.nix similarity index 100% rename from home/programs/nixvim/plugins/dynomark.nix rename to home/programs/nixvim-old/plugins/dynomark.nix diff --git a/home/programs/nixvim/plugins/edgy.nix b/home/programs/nixvim-old/plugins/edgy.nix similarity index 100% rename from home/programs/nixvim/plugins/edgy.nix rename to home/programs/nixvim-old/plugins/edgy.nix diff --git a/home/programs/nixvim/plugins/gitsigns.nix b/home/programs/nixvim-old/plugins/gitsigns.nix similarity index 100% rename from home/programs/nixvim/plugins/gitsigns.nix rename to home/programs/nixvim-old/plugins/gitsigns.nix diff --git a/home/programs/nixvim/plugins/haskell-tools.nix b/home/programs/nixvim-old/plugins/haskell-tools.nix similarity index 100% rename from home/programs/nixvim/plugins/haskell-tools.nix rename to home/programs/nixvim-old/plugins/haskell-tools.nix diff --git a/home/programs/nixvim/plugins/knap.nix b/home/programs/nixvim-old/plugins/knap.nix similarity index 100% rename from home/programs/nixvim/plugins/knap.nix rename to home/programs/nixvim-old/plugins/knap.nix diff --git a/home/programs/nixvim/plugins/leap.nix b/home/programs/nixvim-old/plugins/leap.nix similarity index 100% rename from home/programs/nixvim/plugins/leap.nix rename to home/programs/nixvim-old/plugins/leap.nix diff --git a/home/programs/nixvim/plugins/lsp.nix b/home/programs/nixvim-old/plugins/lsp.nix similarity index 100% rename from home/programs/nixvim/plugins/lsp.nix rename to home/programs/nixvim-old/plugins/lsp.nix diff --git a/home/programs/nixvim/plugins/ltex-extra.nix b/home/programs/nixvim-old/plugins/ltex-extra.nix similarity index 100% rename from home/programs/nixvim/plugins/ltex-extra.nix rename to home/programs/nixvim-old/plugins/ltex-extra.nix diff --git a/home/programs/nixvim/plugins/lualine.nix b/home/programs/nixvim-old/plugins/lualine.nix similarity index 100% rename from home/programs/nixvim/plugins/lualine.nix rename to home/programs/nixvim-old/plugins/lualine.nix diff --git a/home/programs/nixvim/plugins/markdown-preview.nix b/home/programs/nixvim-old/plugins/markdown-preview.nix similarity index 100% rename from home/programs/nixvim/plugins/markdown-preview.nix rename to home/programs/nixvim-old/plugins/markdown-preview.nix diff --git a/home/programs/nixvim/plugins/mkdnflow.nix b/home/programs/nixvim-old/plugins/mkdnflow.nix similarity index 100% rename from home/programs/nixvim/plugins/mkdnflow.nix rename to home/programs/nixvim-old/plugins/mkdnflow.nix diff --git a/home/programs/nixvim/plugins/neoscroll.nix b/home/programs/nixvim-old/plugins/neoscroll.nix similarity index 100% rename from home/programs/nixvim/plugins/neoscroll.nix rename to home/programs/nixvim-old/plugins/neoscroll.nix diff --git a/home/programs/nixvim/plugins/neotree.nix b/home/programs/nixvim-old/plugins/neotree.nix similarity index 100% rename from home/programs/nixvim/plugins/neotree.nix rename to home/programs/nixvim-old/plugins/neotree.nix diff --git a/home/programs/nixvim/plugins/noice.nix b/home/programs/nixvim-old/plugins/noice.nix similarity index 100% rename from home/programs/nixvim/plugins/noice.nix rename to home/programs/nixvim-old/plugins/noice.nix diff --git a/home/programs/nixvim/plugins/notify.nix b/home/programs/nixvim-old/plugins/notify.nix similarity index 100% rename from home/programs/nixvim/plugins/notify.nix rename to home/programs/nixvim-old/plugins/notify.nix diff --git a/home/programs/nixvim/plugins/oil.nix b/home/programs/nixvim-old/plugins/oil.nix similarity index 100% rename from home/programs/nixvim/plugins/oil.nix rename to home/programs/nixvim-old/plugins/oil.nix diff --git a/home/programs/nixvim/plugins/openscad.nix b/home/programs/nixvim-old/plugins/openscad.nix similarity index 100% rename from home/programs/nixvim/plugins/openscad.nix rename to home/programs/nixvim-old/plugins/openscad.nix diff --git a/home/programs/nixvim/plugins/otter.nix b/home/programs/nixvim-old/plugins/otter.nix similarity index 100% rename from home/programs/nixvim/plugins/otter.nix rename to home/programs/nixvim-old/plugins/otter.nix diff --git a/home/programs/nixvim/plugins/papis.nix b/home/programs/nixvim-old/plugins/papis.nix similarity index 100% rename from home/programs/nixvim/plugins/papis.nix rename to home/programs/nixvim-old/plugins/papis.nix diff --git a/home/programs/nixvim-old/plugins/render-markdown.nix b/home/programs/nixvim-old/plugins/render-markdown.nix new file mode 100644 index 0000000..4ab73d4 --- /dev/null +++ b/home/programs/nixvim-old/plugins/render-markdown.nix @@ -0,0 +1,29 @@ +{ pkgs, ... }: + +{ + home.packages = with pkgs; [ python312Packages.pylatexenc ]; + + programs.nixvim.plugins = { + render-markdown = { + enable = true; + settings = { + ft = [ + "markdown" + "quarto" + ]; + latex = { + enabled = false; + }; + completions = { + lsp = { + enabled = true; + }; + }; + }; + }; + + web-devicons = { + enable = true; + }; + }; +} diff --git a/home/programs/nixvim/plugins/smart-splits.nix b/home/programs/nixvim-old/plugins/smart-splits.nix similarity index 100% rename from home/programs/nixvim/plugins/smart-splits.nix rename to home/programs/nixvim-old/plugins/smart-splits.nix diff --git a/home/programs/nixvim/plugins/snippets.nix b/home/programs/nixvim-old/plugins/snippets.nix similarity index 100% rename from home/programs/nixvim/plugins/snippets.nix rename to home/programs/nixvim-old/plugins/snippets.nix diff --git a/home/programs/nixvim/plugins/sniprun.nix b/home/programs/nixvim-old/plugins/sniprun.nix similarity index 100% rename from home/programs/nixvim/plugins/sniprun.nix rename to home/programs/nixvim-old/plugins/sniprun.nix diff --git a/home/programs/nixvim/plugins/startup.nix b/home/programs/nixvim-old/plugins/startup.nix similarity index 100% rename from home/programs/nixvim/plugins/startup.nix rename to home/programs/nixvim-old/plugins/startup.nix diff --git a/home/programs/nixvim/plugins/surround.nix b/home/programs/nixvim-old/plugins/surround.nix similarity index 100% rename from home/programs/nixvim/plugins/surround.nix rename to home/programs/nixvim-old/plugins/surround.nix diff --git a/home/programs/nixvim/plugins/telescope.nix b/home/programs/nixvim-old/plugins/telescope.nix similarity index 100% rename from home/programs/nixvim/plugins/telescope.nix rename to home/programs/nixvim-old/plugins/telescope.nix diff --git a/home/programs/nixvim/plugins/texpresso.nix b/home/programs/nixvim-old/plugins/texpresso.nix similarity index 100% rename from home/programs/nixvim/plugins/texpresso.nix rename to home/programs/nixvim-old/plugins/texpresso.nix diff --git a/home/programs/nixvim/plugins/todo-comments.nix b/home/programs/nixvim-old/plugins/todo-comments.nix similarity index 100% rename from home/programs/nixvim/plugins/todo-comments.nix rename to home/programs/nixvim-old/plugins/todo-comments.nix diff --git a/home/programs/nixvim/plugins/treesitter.nix b/home/programs/nixvim-old/plugins/treesitter.nix similarity index 100% rename from home/programs/nixvim/plugins/treesitter.nix rename to home/programs/nixvim-old/plugins/treesitter.nix diff --git a/home/programs/nixvim/plugins/typst-preview.nix b/home/programs/nixvim-old/plugins/typst-preview.nix similarity index 100% rename from home/programs/nixvim/plugins/typst-preview.nix rename to home/programs/nixvim-old/plugins/typst-preview.nix diff --git a/home/programs/nixvim/plugins/typst-vim.nix b/home/programs/nixvim-old/plugins/typst-vim.nix similarity index 100% rename from home/programs/nixvim/plugins/typst-vim.nix rename to home/programs/nixvim-old/plugins/typst-vim.nix diff --git a/home/programs/nixvim-old/plugins/vimtex.nix b/home/programs/nixvim-old/plugins/vimtex.nix new file mode 100644 index 0000000..d5b38fe --- /dev/null +++ b/home/programs/nixvim-old/plugins/vimtex.nix @@ -0,0 +1,40 @@ +{ ... }: + +{ + programs.nixvim = { + plugins = { + vimtex = { + enable = true; + settings = { + view_automatic = false; + mappings_disable = { + "n" = [ "K" ]; + }; + }; + }; + }; + + autoGroups = { + "lazyvim_vimtex_conceal" = { + clear = true; + }; + }; + + autoCmd = [ + { + event = [ "FileType" ]; + group = "lazyvim_vimtex_conceal"; + pattern = [ + "bib" + "tex" + ]; + callback.__raw = # lua + '' + function () + vim.wo.conceallevel = 2 + end + ''; + } + ]; + }; +} diff --git a/home/programs/nixvim/default.nix b/home/programs/nixvim/default.nix index b005886..f3cfd11 100644 --- a/home/programs/nixvim/default.nix +++ b/home/programs/nixvim/default.nix @@ -1,4 +1,4 @@ -{ inputs, pkgs, ... }: +{ pkgs, inputs, ... }: { imports = [ @@ -6,38 +6,38 @@ ./plugins ]; - home.sessionVariables = { - EDITOR = "nvim"; - }; + home.sessionVariables.EDITOR = "nvim"; programs.nixvim = { enable = true; defaultEditor = true; - - nixpkgs.useGlobalPackages = false; - - clipboard = { - providers = { - wl-copy.enable = true; - }; - }; - - viAlias = true; - vimAlias = true; - - lualoader.enable = true; - - extraPackages = with pkgs; [ + extraPackages = with pkgs; [ # TODO: texliveFull texlivePackages.standalone texlivePackages.relsize # needed for BA # papis-nvim ]; - extraConfigVim = '' - filetype plugin on - set nocompatible - syntax on - ''; + + nixpkgs.useGlobalPackages = false; + + clipboard.providers.wl-copy.enable = true; + keymaps = [ + { + key = "Y"; + action = ''"+y''; + options.silent = true; + } + { + key = "P"; + action = ''"+p''; + options.silent = true; + } + ]; + + viAlias = true; + vimAlias = true; + + lualoader.enable = true; globals = { mapleader = " "; diff --git a/home/programs/nixvim/plugins/css-color.nix b/home/programs/nixvim/plugins/css-color.nix new file mode 100644 index 0000000..1f5eb12 --- /dev/null +++ b/home/programs/nixvim/plugins/css-color.nix @@ -0,0 +1,8 @@ +{ ... }: + +{ + programs.nixvim.plugins.vim-css-color = { + enable = true; + lazyLoad.settings.filetypes = [ "css" ]; + }; +} diff --git a/home/programs/nixvim/plugins/default.nix b/home/programs/nixvim/plugins/default.nix index 56f491c..aad20b5 100644 --- a/home/programs/nixvim/plugins/default.nix +++ b/home/programs/nixvim/plugins/default.nix @@ -1,54 +1,21 @@ { imports = [ - ./aerial.nix - ./autopairs.nix - ./barbar.nix - ./bullets.nix - ./cmp.nix - ./comment-box.nix - ./comment.nix - ./conform.nix - ./dap.nix - ./diffview.nix - ./dynomark.nix - ./edgy.nix - ./gitsigns.nix - ./haskell-tools.nix - ./knap.nix - ./leap.nix - ./lsp.nix - ./ltex-extra.nix - ./lualine.nix - ./markdown-preview.nix - ./mkdnflow.nix - ./neoscroll.nix - ./neotree.nix - ./noice.nix - ./notify.nix - ./oil.nix - ./openscad.nix - ./otter.nix - ./papis.nix - ./peek.nix - ./markdown-preview.nix - ./smart-splits.nix - ./snippets.nix - ./sniprun.nix - ./startup.nix - ./surround.nix - ./telescope.nix - ./texpresso.nix - ./todo-comments.nix + ./css-color.nix + ./img-clip.nix + ./lz-n.nix + ./rainbow.nix + ./render-markdown.nix + ./rustaceanvim.nix ./toggleterm.nix - ./treesitter.nix ./trouble.nix - ./typst-preview.nix - ./typst-vim.nix ./undotree.nix - ./vimtex.nix + ./unified.nix ./web-devicons.nix ./which-key.nix - ./yanky.nix - ./zk.nix + ./wilder.nix + ./yazi.nix + ./yuck.nix + + ./vimtex.nix ]; } diff --git a/home/programs/nixvim/plugins/diffview.nix b/home/programs/nixvim/plugins/diffview.nix deleted file mode 100644 index 2b7bc78..0000000 --- a/home/programs/nixvim/plugins/diffview.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ pkgs, ... }: - -{ - programs.nixvim = { - plugins = { - diffview = { - enable = true; - }; - }; - }; -} - diff --git a/home/programs/nixvim/plugins/img-clip.nix b/home/programs/nixvim/plugins/img-clip.nix new file mode 100644 index 0000000..139153a --- /dev/null +++ b/home/programs/nixvim/plugins/img-clip.nix @@ -0,0 +1,22 @@ +{ ... }: + +{ + programs.nixvim = { + plugins.img-clip = { + enable = true; + lazyLoad.settings.filetypes = [ + "md" + "tex" + "typ" + ]; + }; + + keymaps = [ + { + key = "p"; + action = "PasteImage"; + options.desc = "Paste image"; + } + ]; + }; +} diff --git a/home/programs/nixvim/plugins/lz-n.nix b/home/programs/nixvim/plugins/lz-n.nix new file mode 100644 index 0000000..ceac461 --- /dev/null +++ b/home/programs/nixvim/plugins/lz-n.nix @@ -0,0 +1,7 @@ +{ ... }: + +{ + programs.nixvim.plugins.lz-n = { + enable = true; + }; +} diff --git a/home/programs/nixvim/plugins/peek.nix b/home/programs/nixvim/plugins/peek.nix deleted file mode 100644 index fa9f229..0000000 --- a/home/programs/nixvim/plugins/peek.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ ... }: - -{ - programs.nixvim.plugins = { - peek = { - enable = true; - settings = { - app = "firefox"; - }; - }; - }; -} diff --git a/home/programs/nixvim/plugins/rainbow.nix b/home/programs/nixvim/plugins/rainbow.nix new file mode 100644 index 0000000..24b06e8 --- /dev/null +++ b/home/programs/nixvim/plugins/rainbow.nix @@ -0,0 +1,100 @@ +{ pkgs, ... }: + +{ + programs.nixvim = { + plugins = { + rainbow = { + enable = true; + lazyLoad.settings.event = [ + "BufReadPost" + "BufNewFile" + ]; + + settings = { + active = 1; + conf = { + guifgs = [ + "#f5c2e7" + "#eba0ac" + "#a6e3a1" + "#74c7ec" + "#f5e0dc" + "#cba6f7" + "#fab387" + "#94e2d5" + "#89b4fa" + "#f2cdcd" + "#f38ba8" + "#f9e2af" + "#89dceb" + "#b4befe" + ]; + operators = "_,_"; + parentheses = [ + "start=/(/ end=/)/ fold" + "start=/{/ end=/}/ fold" + "start=/\\[/ end=/\\]/ fold" + "start=/\\begin/ end=/\\end/ fold" + ]; + separately = { + "*" = { + parentheses = [ + "start=/(/ end=/)/ fold" + "start=/{/ end=/}/ fold" + "start=/\\[/ end=/\\]/ fold" + ]; + }; + css = 0; + haskell = { + parentheses = [ + "start=/(/ end=/)/ fold" + "start=/\[/ end=/\]/ fold" + "start=/\v\{\ze[^-]/ end=/}/ fold" + ]; + }; + lisp = { + guifgs = [ + "#f5c2e7" + "#eba0ac" + "#a6e3a1" + "#74c7ec" + "#f5e0dc" + "#cba6f7" + "#fab387" + "#94e2d5" + "#89b4fa" + "#f2cdcd" + "#f38ba8" + "#f9e2af" + "#89dceb" + "#b4befe" + ]; + }; + markdown = { + parentheses_options = "containedin=markdownCode contained"; + }; + nerdtree = 0; + perl = { + syn_name_prefix = "perlBlockFoldRainbow"; + }; + stylus = { + parentheses = [ "start=/{/ end=/}/ fold contains=@colorableGroup" ]; + }; + tex = { + parentheses = [ + "start=/(/ end=/)/ fold" + "start=/{/ end=/}/ fold" + "start=/\\[/ end=/\\]/ fold" + "start=/\\begin/ end=/\\end/ fold" + ]; + }; + vim = { + parentheses_options = "containedin=vimFuncBody"; + }; + }; + }; + }; + }; + }; + }; +} diff --git a/home/programs/nixvim/plugins/render-markdown.nix b/home/programs/nixvim/plugins/render-markdown.nix index 4ab73d4..5aef979 100644 --- a/home/programs/nixvim/plugins/render-markdown.nix +++ b/home/programs/nixvim/plugins/render-markdown.nix @@ -3,27 +3,37 @@ { home.packages = with pkgs; [ python312Packages.pylatexenc ]; - programs.nixvim.plugins = { - render-markdown = { - enable = true; - settings = { - ft = [ - "markdown" - "quarto" - ]; - latex = { - enabled = false; - }; - completions = { - lsp = { - enabled = true; - }; + programs.nixvim = { + plugins = { + render-markdown = { + enable = true; + lazyLoad.settings.filetypes = [ "md" ]; + + settings = { + ft = [ "markdown" ]; + latex.enabled = false; + completions.lsp.enabled = true; }; }; + + which-key.settings.spec = [ + { + __unkeyed-1 = "m"; + group = "Markdown"; + icon = " "; + } + ]; }; - web-devicons = { - enable = true; - }; + keymaps = [ + { + action = "RenderMarkdown toggle"; + key = "mp"; + mode = "n"; + options = { + desc = "Toggle markdown preview"; + }; + } + ]; }; } diff --git a/home/programs/nixvim/plugins/rustaceanvim.nix b/home/programs/nixvim/plugins/rustaceanvim.nix new file mode 100644 index 0000000..649658e --- /dev/null +++ b/home/programs/nixvim/plugins/rustaceanvim.nix @@ -0,0 +1,52 @@ +{ pkgs, ... }: + +{ + programs.nixvim = { + extraPackages = with pkgs; [ rust-analyzer ]; + + plugins = { + rustaceanvim = { + enable = true; + lazyload.settings.filetype = "rs"; + }; + }; + + files = { + "ftplugin/rust.lua" = { + keymaps = [ + { + action.__raw = '' + function() + vim.cmd.RustAnalyzer('codeAction') + end + ''; + key = "a"; + mode = [ + "n" + ]; + options = { + desc = "Code action"; + silent = true; + buffer.__raw = "vim.api.nvim_get_current_buf()"; + }; + } + { + action.__raw = '' + function() + vim.cmd.RustAnalyzer({'hover', 'actions'}) + end + ''; + key = "K"; + mode = [ + "n" + ]; + options = { + silent = true; + buffer.__raw = "vim.api.nvim_get_current_buf()"; + }; + } + ]; + }; + }; + }; +} diff --git a/home/programs/nixvim/plugins/toggleterm.nix b/home/programs/nixvim/plugins/toggleterm.nix index e8c606c..696e114 100644 --- a/home/programs/nixvim/plugins/toggleterm.nix +++ b/home/programs/nixvim/plugins/toggleterm.nix @@ -5,18 +5,32 @@ plugins = { toggleterm = { enable = true; + lazyLoad.settings.cmd = [ + "ToggleTermSendCurrentLine" + "ToggleTermSendVisualLines" + "ToggleTermSendVisualSelection" + ]; + settings = { open_mapping.__raw = "[[]]"; insert_mappings = true; shade_terminals = false; }; }; + + which-key.settings.spec = [ + { + __unkeyed-1 = "c"; + group = "Terminal"; + icon = " "; + } + ]; }; keymaps = [ { action = "ToggleTermSendCurrentLine"; - key = "sts"; + key = "cl"; mode = "n"; options = { desc = "Send Current Line"; @@ -24,7 +38,7 @@ } { action = "ToggleTermSendVisualLines"; - key = "stv"; + key = "cv"; mode = "x"; options = { desc = "Send all the (whole) lines in selection"; @@ -32,7 +46,7 @@ } { action = "ToggleTermSendVisualSelection"; - key = "sts"; + key = "cs"; mode = "x"; options = { desc = "Send selection"; diff --git a/home/programs/nixvim/plugins/trouble.nix b/home/programs/nixvim/plugins/trouble.nix index aef0736..ca829fc 100644 --- a/home/programs/nixvim/plugins/trouble.nix +++ b/home/programs/nixvim/plugins/trouble.nix @@ -5,6 +5,8 @@ plugins = { trouble = { enable = true; + lazyLoad.settings.cmd = "Trouble"; + settings = { modes = { diagnostics = { diff --git a/home/programs/nixvim/plugins/undotree.nix b/home/programs/nixvim/plugins/undotree.nix index ea56afa..ee90d3c 100644 --- a/home/programs/nixvim/plugins/undotree.nix +++ b/home/programs/nixvim/plugins/undotree.nix @@ -5,7 +5,38 @@ plugins = { undotree = { enable = true; + lazyLoad.settings.cmd = "UndotreeShow"; }; + + which-key.settings.spec = [ + { + __unkeyed-1 = "t"; + group = "Undotree"; + icon = " "; + } + ]; }; + keymaps = [ + { + key = "th"; + action = "UndotreeHide"; + options.desc = "Hide undotree"; + } + { + key = "tf"; + action = "UndotreeFocus"; + options.desc = "Focus undotree"; + } + { + key = "tp"; + action = "UndotreePersistUndo"; + options.desc = "Persist undo"; + } + { + key = "ts"; + action = "UndotreeShow"; + options.desc = "Show undotree"; + } + ]; }; } diff --git a/home/programs/nixvim/plugins/unified.nix b/home/programs/nixvim/plugins/unified.nix new file mode 100644 index 0000000..28cbead --- /dev/null +++ b/home/programs/nixvim/plugins/unified.nix @@ -0,0 +1,32 @@ +{ ... }: + +{ + programs.nixvim = { + plugins = { + unified = { + enable = true; + lazyLoad.settings.cmd = "Unified"; + }; + + which-key.settings.spec = [ + { + __unkeyed-1 = "u"; + group = "Unified"; + icon = " "; + } + ]; + }; + keymaps = [ + { + key = "us"; + action = "Unified"; + options.desc = "Start Unified"; + } + { + key = "uq"; + action = "Unified resetUnified reset"; + options.desc = "Stop Unified"; + } + ]; + }; +} diff --git a/home/programs/nixvim/plugins/web-devicons.nix b/home/programs/nixvim/plugins/web-devicons.nix index d577745..ec55149 100644 --- a/home/programs/nixvim/plugins/web-devicons.nix +++ b/home/programs/nixvim/plugins/web-devicons.nix @@ -1,9 +1,11 @@ { ... }: { - programs.nixvim = { - plugins = { - web-devicons.enable = true; - }; + programs.nixvim.plugins.web-devicons = { + enable = true; + lazyLoad.settings.event = [ + "BufReadPost" + "BufNewFile" + ]; }; } diff --git a/home/programs/nixvim/plugins/which-key.nix b/home/programs/nixvim/plugins/which-key.nix index a2da0cf..3495e3f 100644 --- a/home/programs/nixvim/plugins/which-key.nix +++ b/home/programs/nixvim/plugins/which-key.nix @@ -1,9 +1,11 @@ { ... }: { - programs.nixvim.plugins = { - which-key = { - enable = true; - }; + programs.nixvim.plugins.which-key = { + enable = true; + lazyLoad.settings.event = [ + "BufReadPost" + "BufNewFile" + ]; }; } diff --git a/home/programs/nixvim/plugins/wilder.nix b/home/programs/nixvim/plugins/wilder.nix new file mode 100644 index 0000000..3df495d --- /dev/null +++ b/home/programs/nixvim/plugins/wilder.nix @@ -0,0 +1,51 @@ +{ ... }: + +{ + programs.nixvim.plugins.wilder = { + enable = true; + lazyLoad.settings.event = [ + "BufReadPost" + "BufNewFile" + ]; + + settings.modes = [ + ":" + "/" + "?" + ]; + + # Configure the wilder engine + options = { + pipeline.__raw = '' + wilder.branch( + wilder.cmdline_pipeline({ + fuzzy = 1, + set_device = 1, + }), + wilder.vim_search_pipeline() + ) + ''; + renderer.__raw = '' + wilder.popupmenu_renderer( + wilder.popupmenu_border_theme({ + highlighter = wilder.basic_highlighter(), + highlights = { + accent = "WilderAccent", + }, + border = "rounded", + left = { " ", wilder.popupmenu_devicons() }, + right = { " ", wilder.popupmenu_scrollbar() }, + }) + ) + ''; + }; + }; + + # Define the custom highlight group for the accent color + programs.nixvim.highlight = { + WilderAccent = { + fg = "#f5c2e7"; + bold = true; + }; + }; +} diff --git a/home/programs/nixvim/plugins/yanky.nix b/home/programs/nixvim/plugins/yanky.nix deleted file mode 100644 index 022ea31..0000000 --- a/home/programs/nixvim/plugins/yanky.nix +++ /dev/null @@ -1,69 +0,0 @@ -{ ... }: - -{ - programs.nixvim = { - plugins = { - yanky = { - enable = true; - settings = { - ring = { - storage = "sqlite"; - }; - }; - }; - - sqlite-lua = { - enable = true; - }; - }; - - keymaps = [ - { - key = "p"; - action = "(YankyPutAfter)"; - mode = [ - "n" - "x" - ]; - } - { - key = "P"; - action = "(YankyPutBefore)"; - mode = [ - "n" - "x" - ]; - } - { - key = "gp"; - action = "(YankyGPutAfter)"; - mode = [ - "n" - "x" - ]; - } - { - key = "gP"; - action = "(YankyGPutBefore)"; - mode = [ - "n" - "x" - ]; - } - { - key = ""; - action = "(YankyPreviousEntry)"; - mode = [ - "n" - ]; - } - { - key = ""; - action = "(YankyNextEntry)"; - mode = [ - "n" - ]; - } - ]; - }; -} diff --git a/home/programs/nixvim/plugins/yazi.nix b/home/programs/nixvim/plugins/yazi.nix new file mode 100644 index 0000000..ff13518 --- /dev/null +++ b/home/programs/nixvim/plugins/yazi.nix @@ -0,0 +1,40 @@ +{ ... }: + +{ + programs.nixvim = { + plugins = { + yazi = { + enable = true; + lazyLoad.settings.event = [ + "BufReadPost" + "BufNewFile" + ]; + }; + + which-key.settings.spec = [ + { + __unkeyed-1 = "y"; + group = "Yazi"; + icon = " "; + } + ]; + }; + keymaps = [ + { + key = "yf"; + action = "Yazi"; + options.desc = "Open yazi at the current file"; + } + { + key = "yw"; + action = "Yazi cwd"; + options.desc = "Open yazi at the current working directory"; + } + { + key = "yl"; + action = "Yazi toggle"; + options.desc = "Resume the last session"; + } + ]; + }; +} diff --git a/home/programs/nixvim/plugins/yuck.nix b/home/programs/nixvim/plugins/yuck.nix new file mode 100644 index 0000000..fffd712 --- /dev/null +++ b/home/programs/nixvim/plugins/yuck.nix @@ -0,0 +1,10 @@ +{ ... }: + +{ + programs.nixvim.plugins.yuck = { + enable = true; + lazyLoad.settings.filetypes = [ + "yuck" + ]; + }; +} diff --git a/home/programs/nixvim/plugins/zk.nix b/home/programs/nixvim/plugins/zk.nix deleted file mode 100644 index 00665a2..0000000 --- a/home/programs/nixvim/plugins/zk.nix +++ /dev/null @@ -1,95 +0,0 @@ -{ ... }: - -{ - programs.nixvim = { - plugins = { - zk = { - enable = true; - settings = { - picker = "telescope"; - }; - }; - which-key.settings.spec = [ - { - __unkeyed-1 = "z"; - group = "Zettelkasten"; - icon = "󰝰 "; - } - ]; - }; - keymaps = [ - { - key = "zn"; - action = "ZkNew { title = vim.fn.input('Title: ') }"; - mode = [ "n" ]; - options = { - desc = "Create"; - }; - } - { - key = "zo"; - action = "ZkNotes { sort = { 'modified' } }"; - mode = [ "n" ]; - options = { - desc = "Open"; - }; - } - { - key = "zt"; - action = "ZkTags"; - mode = [ "n" ]; - options = { - desc = "Open Tags"; - }; - } - { - key = "zf"; - action = "ZkNotes { sort = { 'modified' }, match = { vim.fn.input('Search: ') } }"; - mode = [ "n" ]; - options = { - desc = "Search"; - }; - } - { - key = "zf"; - action = ":'<,'>ZkMatch"; - mode = [ "v" ]; - options = { - desc = "Search (Matching the Selection)"; - }; - } - ]; - files = { - # TODO: Add descriptions - # TODO: Did the sytnax change? - "ftplugin/markdown.lua" = { - extraConfigLua = # lua - '' - -- Add the key mappings only for Markdown files in a zk notebook. - if require("zk.util").notebook_root(vim.fn.expand('%:p')) ~= nil then - local function map(...) vim.api.nvim_buf_set_keymap(0, ...) end - local opts = { noremap=true, silent=false } - - -- Create a new note after asking for its title. - -- This overrides the global `zn` mapping to create the note in the same directory as the current buffer. - map("n", "zn", "ZkNew { dir = vim.fn.expand('%:p:h'), title = vim.fn.input('Title: ') }", opts) - -- Create a new note in the same directory as the current buffer, using the current selection for title. - map("v", "znt", ":'<,'>ZkNewFromTitleSelection { dir = vim.fn.expand('%:p:h') }", opts) - -- Create a new note in the same directory as the current buffer, using the current selection for note content and asking for its title. - map("v", "znc", ":'<,'>ZkNewFromContentSelection { dir = vim.fn.expand('%:p:h'), title = vim.fn.input('Title: ') }", opts) - - -- Open notes linking to the current buffer. - map("n", "zb", "ZkBacklinks", opts) - -- Open notes linked by the current buffer. - map("n", "zl", "ZkLinks", opts) - - -- Preview a linked note. - map("n", "K", "lua vim.lsp.buf.hover()", opts) - -- Open the code actions for a visual selection. - map("v", "za", ":'<,'>lua vim.lsp.buf.range_code_action()", opts) - end - ''; - }; - }; - }; -}