From dffdbb158159a0e0713dba3fa38a9be4c4182b84 Mon Sep 17 00:00:00 2001 From: cnst Date: Mon, 19 Aug 2024 21:24:21 +0200 Subject: [PATCH 1/2] big changes to neovim, might streamline later, also some term environment settings --- .../neovim/{autocommands.nix => autocmd.nix} | 0 home/modules/devtools/neovim/default.nix | 47 +++++- .../neovim/{keymappings.nix => keymap.nix} | 0 home/modules/devtools/neovim/plugins/ai.nix | 59 +++++++ .../devtools/neovim/plugins/barbar.nix | 26 ++- .../devtools/neovim/plugins/comment.nix | 24 ++- .../devtools/neovim/plugins/conform.nix | 54 ++++--- .../devtools/neovim/plugins/default.nix | 76 +++------ home/modules/devtools/neovim/plugins/efm.nix | 46 ++++-- .../devtools/neovim/plugins/floaterm.nix | 26 ++- .../devtools/neovim/plugins/harpoon.nix | 16 +- home/modules/devtools/neovim/plugins/lsp.nix | 151 +++++++++--------- .../devtools/neovim/plugins/lualine.nix | 88 +++++----- .../neovim/plugins/markdown-preview.nix | 42 +++-- .../devtools/neovim/plugins/neo-tree.nix | 44 +++-- .../devtools/neovim/plugins/nonels.nix | 86 +++++----- .../devtools/neovim/plugins/startify.nix | 55 ++++--- .../devtools/neovim/plugins/tagbar.nix | 40 +++-- .../devtools/neovim/plugins/telescope.nix | 18 ++- .../devtools/neovim/plugins/treesitter.nix | 51 +++--- .../devtools/neovim/plugins/vimtex.nix | 142 ++++++++-------- .../modules/devtools/neovim/plugins/yanky.nix | 18 ++- .../devtools/neovim/pluginsbak/barbar.nix | 10 ++ .../{plugins => pluginsbak}/chatgpt.nix | 0 .../devtools/neovim/pluginsbak/comment.nix | 10 ++ .../devtools/neovim/pluginsbak/conform.nix | 24 +++ .../devtools/neovim/pluginsbak/default.nix | 93 +++++++++++ .../devtools/neovim/pluginsbak/efm.nix | 22 +++ .../devtools/neovim/pluginsbak/floaterm.nix | 12 ++ .../devtools/neovim/pluginsbak/harpoon.nix | 20 +++ .../devtools/neovim/pluginsbak/lsp.nix | 91 +++++++++++ .../devtools/neovim/pluginsbak/lualine.nix | 47 ++++++ .../neovim/pluginsbak/markdown-preview.nix | 20 +++ .../devtools/neovim/pluginsbak/neo-tree.nix | 22 +++ .../devtools/neovim/pluginsbak/nonels.nix | 44 +++++ .../devtools/neovim/pluginsbak/startify.nix | 32 ++++ .../devtools/neovim/pluginsbak/tagbar.nix | 17 ++ .../devtools/neovim/pluginsbak/telescope.nix | 33 ++++ .../devtools/neovim/pluginsbak/treesitter.nix | 26 +++ .../devtools/neovim/pluginsbak/vimtex.nix | 77 +++++++++ .../devtools/neovim/pluginsbak/yanky.nix | 5 + home/modules/wm/hyprland/toothpick/inputs.nix | 19 +-- home/users/adam/default.nix | 2 +- home/users/adam/modules.nix | 46 +++++- home/users/cnst/default.nix | 2 +- home/users/cnst/modules.nix | 46 +++++- home/users/toothpick/default.nix | 2 +- home/users/toothpick/modules.nix | 46 +++++- hosts/cnix/modules.nix | 2 + system/modules/default.nix | 2 + system/modules/utils/misc/default.nix | 20 +++ system/modules/utils/npm/default.nix | 17 ++ 52 files changed, 1471 insertions(+), 447 deletions(-) rename home/modules/devtools/neovim/{autocommands.nix => autocmd.nix} (100%) rename home/modules/devtools/neovim/{keymappings.nix => keymap.nix} (100%) create mode 100644 home/modules/devtools/neovim/plugins/ai.nix create mode 100644 home/modules/devtools/neovim/pluginsbak/barbar.nix rename home/modules/devtools/neovim/{plugins => pluginsbak}/chatgpt.nix (100%) create mode 100644 home/modules/devtools/neovim/pluginsbak/comment.nix create mode 100644 home/modules/devtools/neovim/pluginsbak/conform.nix create mode 100644 home/modules/devtools/neovim/pluginsbak/default.nix create mode 100644 home/modules/devtools/neovim/pluginsbak/efm.nix create mode 100644 home/modules/devtools/neovim/pluginsbak/floaterm.nix create mode 100644 home/modules/devtools/neovim/pluginsbak/harpoon.nix create mode 100644 home/modules/devtools/neovim/pluginsbak/lsp.nix create mode 100644 home/modules/devtools/neovim/pluginsbak/lualine.nix create mode 100644 home/modules/devtools/neovim/pluginsbak/markdown-preview.nix create mode 100644 home/modules/devtools/neovim/pluginsbak/neo-tree.nix create mode 100644 home/modules/devtools/neovim/pluginsbak/nonels.nix create mode 100644 home/modules/devtools/neovim/pluginsbak/startify.nix create mode 100644 home/modules/devtools/neovim/pluginsbak/tagbar.nix create mode 100644 home/modules/devtools/neovim/pluginsbak/telescope.nix create mode 100644 home/modules/devtools/neovim/pluginsbak/treesitter.nix create mode 100644 home/modules/devtools/neovim/pluginsbak/vimtex.nix create mode 100644 home/modules/devtools/neovim/pluginsbak/yanky.nix create mode 100644 system/modules/utils/misc/default.nix create mode 100644 system/modules/utils/npm/default.nix diff --git a/home/modules/devtools/neovim/autocommands.nix b/home/modules/devtools/neovim/autocmd.nix similarity index 100% rename from home/modules/devtools/neovim/autocommands.nix rename to home/modules/devtools/neovim/autocmd.nix diff --git a/home/modules/devtools/neovim/default.nix b/home/modules/devtools/neovim/default.nix index f8530b9c..7fd72a80 100644 --- a/home/modules/devtools/neovim/default.nix +++ b/home/modules/devtools/neovim/default.nix @@ -1,7 +1,8 @@ { - inputs, config, lib, + inputs, + pkgs, ... }: let inherit (lib) mkIf mkEnableOption; @@ -9,25 +10,55 @@ in { imports = [ inputs.nixvim.homeManagerModules.nixvim - ./autocommands.nix - ./completion.nix - ./keymappings.nix - ./options.nix ./plugins + ./autocmd.nix + ./completion.nix + ./keymap.nix + ./options.nix ./todo.nix ]; + options = { - modules.devtools.neovim.enable = mkEnableOption "Enables neovim"; + modules.devtools.neovim.enable = mkEnableOption "Enable Neovim"; }; + config = mkIf cfg.enable { programs.nixvim = { + extraPlugins = [pkgs.vimPlugins.gruvbox-material]; + colorscheme = "gruvbox-material"; enable = true; defaultEditor = true; - viAlias = true; vimAlias = true; - luaLoader.enable = true; + plugins = { + gitsigns = { + enable = true; + settings.signs = { + add.text = "+"; + change.text = "~"; + }; + }; + nvim-autopairs.enable = true; + nvim-colorizer = { + enable = true; + userDefaultOptions.names = false; + }; + oil.enable = true; + trim = { + enable = true; + settings = { + highlight = false; + ft_blocklist = [ + "checkhealth" + "floaterm" + "lspinfo" + "neo-tree" + "TelescopePrompt" + ]; + }; + }; + }; }; }; } diff --git a/home/modules/devtools/neovim/keymappings.nix b/home/modules/devtools/neovim/keymap.nix similarity index 100% rename from home/modules/devtools/neovim/keymappings.nix rename to home/modules/devtools/neovim/keymap.nix diff --git a/home/modules/devtools/neovim/plugins/ai.nix b/home/modules/devtools/neovim/plugins/ai.nix new file mode 100644 index 00000000..17071d96 --- /dev/null +++ b/home/modules/devtools/neovim/plugins/ai.nix @@ -0,0 +1,59 @@ +{ lib +, config +, ... +}: +let + inherit (lib) mkEnableOption mkIf; + cfg = config.modules.devtools.neovim.plugins.ai; +in +{ + options = { + modules.devtools.neovim.plugins.ai.enable = mkEnableOption "Enables AI tools for Neovim"; + }; + + config = mkIf cfg.enable { + programs.nixvim = { + plugins = { + chatgpt = { + enable = true; + settings = { + api_key_cmd = "cat ${config.sops.secrets.openai_api_key.path}"; + }; + }; + copilot-chat.enable = true; + + copilot-lua = { + enable = true; + suggestion = { + enabled = true; + autoTrigger = true; + keymap.accept = ""; + }; + panel.enabled = false; + }; + }; + keymaps = [ + { + action = "CopilotChatToggle"; + key = "ac"; + options = { + desc = "Toggle Coilot chat"; + }; + mode = [ + "n" + ]; + } + { + action = "ChatGPT"; + key = "ag"; + options = { + desc = "Toggle ChatGPT"; + }; + mode = [ + "n" + ]; + } + ]; + }; + }; +} diff --git a/home/modules/devtools/neovim/plugins/barbar.nix b/home/modules/devtools/neovim/plugins/barbar.nix index aa95f803..86d3284b 100644 --- a/home/modules/devtools/neovim/plugins/barbar.nix +++ b/home/modules/devtools/neovim/plugins/barbar.nix @@ -1,10 +1,24 @@ +{ lib +, config +, ... +}: +let + inherit (lib) mkEnableOption mkIf; + cfg = config.modules.devtools.neovim.plugins.barbar; +in { - programs.nixvim.plugins.barbar = { - enable = true; - keymaps = { - next.key = ""; - previous.key = ""; - close.key = ""; + options = { + modules.devtools.neovim.plugins.barbar.enable = mkEnableOption "Enables Barbar plugin for Neovim"; + }; + + config = mkIf cfg.enable { + programs.nixvim.plugins.barbar = { + enable = true; + keymaps = { + next.key = ""; + previous.key = ""; + close.key = ""; + }; }; }; } diff --git a/home/modules/devtools/neovim/plugins/comment.nix b/home/modules/devtools/neovim/plugins/comment.nix index edf65367..7e9d6588 100644 --- a/home/modules/devtools/neovim/plugins/comment.nix +++ b/home/modules/devtools/neovim/plugins/comment.nix @@ -1,10 +1,24 @@ +{ lib +, config +, ... +}: +let + inherit (lib) mkEnableOption mkIf; + cfg = config.modules.devtools.neovim.plugins.comment; +in { - programs.nixvim.plugins.comment = { - enable = true; + options = { + modules.devtools.neovim.plugins.comment.enable = mkEnableOption "Enables Comment plugin for Neovim"; + }; - settings = { - opleader.line = ""; - toggler.line = ""; + config = mkIf cfg.enable { + programs.nixvim.plugins.comment = { + enable = true; + + settings = { + opleader.line = ""; + toggler.line = ""; + }; }; }; } diff --git a/home/modules/devtools/neovim/plugins/conform.nix b/home/modules/devtools/neovim/plugins/conform.nix index 98e1e6b4..6d1da249 100644 --- a/home/modules/devtools/neovim/plugins/conform.nix +++ b/home/modules/devtools/neovim/plugins/conform.nix @@ -1,24 +1,38 @@ +{ lib +, config +, ... +}: +let + inherit (lib) mkEnableOption mkIf; + cfg = config.modules.devtools.neovim.plugins.conform-nvim; +in { - programs.nixvim.plugins.conform-nvim = { - enable = true; - formatOnSave = { - lspFallback = true; - timeoutMs = 500; - }; - notifyOnError = true; - formattersByFt = { - liquidsoap = [ "liquidsoap-prettier" ]; - html = [ [ "prettierd" "prettier" ] ]; - css = [ [ "prettierd" "prettier" ] ]; - javascript = [ [ "prettierd" "prettier" ] ]; - javascriptreact = [ [ "prettierd" "prettier" ] ]; - typescript = [ [ "prettierd" "prettier" ] ]; - typescriptreact = [ [ "prettierd" "prettier" ] ]; - python = [ "black" ]; - lua = [ "stylua" ]; - nix = [ "alejandra" ]; - markdown = [ [ "prettierd" "prettier" ] ]; - yaml = [ "yamllint" "yamlfmt" ]; + options = { + modules.devtools.neovim.plugins.conform-nvim.enable = mkEnableOption "Enables Conform plugin for Neovim"; + }; + + config = mkIf cfg.enable { + programs.nixvim.plugins.conform-nvim = { + enable = true; + formatOnSave = { + lspFallback = true; + timeoutMs = 500; + }; + notifyOnError = true; + formattersByFt = { + liquidsoap = [ "liquidsoap-prettier" ]; + html = [ [ "prettierd" "prettier" ] ]; + css = [ [ "prettierd" "prettier" ] ]; + javascript = [ [ "prettierd" "prettier" ] ]; + javascriptreact = [ [ "prettierd" "prettier" ] ]; + typescript = [ [ "prettierd" "prettier" ] ]; + typescriptreact = [ [ "prettierd" "prettier" ] ]; + python = [ "black" ]; + lua = [ "stylua" ]; + nix = [ "alejandra" ]; + markdown = [ [ "prettierd" "prettier" ] ]; + yaml = [ "yamllint" "yamlfmt" ]; + }; }; }; } diff --git a/home/modules/devtools/neovim/plugins/default.nix b/home/modules/devtools/neovim/plugins/default.nix index c9973405..a364486c 100644 --- a/home/modules/devtools/neovim/plugins/default.nix +++ b/home/modules/devtools/neovim/plugins/default.nix @@ -1,60 +1,22 @@ -{pkgs, ...}: { +{ userModules, ... }: { imports = [ - ./barbar.nix - ./comment.nix - ./efm.nix - # ./floaterm.nix - # ./harpoon.nix - ./lsp.nix - ./lualine.nix - ./markdown-preview.nix - ./neo-tree.nix - ./startify.nix - ./tagbar.nix - ./telescope.nix - ./treesitter.nix - # ./chatgpt.nix - # ./vimtex.nix - ./nonels.nix - ./conform.nix - # ./yanky.nix + "${userModules}/devtools/neovim/plugins/ai.nix" + "${userModules}/devtools/neovim/plugins/barbar.nix" + "${userModules}/devtools/neovim/plugins/comment.nix" + "${userModules}/devtools/neovim/plugins/conform.nix" + "${userModules}/devtools/neovim/plugins/efm.nix" + "${userModules}/devtools/neovim/plugins/floaterm.nix" + "${userModules}/devtools/neovim/plugins/harpoon.nix" + "${userModules}/devtools/neovim/plugins/lsp.nix" + "${userModules}/devtools/neovim/plugins/lualine.nix" + "${userModules}/devtools/neovim/plugins/markdown-preview.nix" + "${userModules}/devtools/neovim/plugins/neo-tree.nix" + "${userModules}/devtools/neovim/plugins/nonels.nix" + "${userModules}/devtools/neovim/plugins/startify.nix" + "${userModules}/devtools/neovim/plugins/tagbar.nix" + "${userModules}/devtools/neovim/plugins/telescope.nix" + "${userModules}/devtools/neovim/plugins/treesitter.nix" + "${userModules}/devtools/neovim/plugins/vimtex.nix" + "${userModules}/devtools/neovim/plugins/yanky.nix" ]; - - programs.nixvim = { - extraPlugins = [pkgs.vimPlugins.gruvbox-material]; - colorscheme = "gruvbox-material"; - - plugins = { - gitsigns = { - enable = true; - settings.signs = { - add.text = "+"; - change.text = "~"; - }; - }; - - nvim-autopairs.enable = true; - - nvim-colorizer = { - enable = true; - userDefaultOptions.names = false; - }; - - oil.enable = true; - - trim = { - enable = true; - settings = { - highlight = false; - ft_blocklist = [ - "checkhealth" - "floaterm" - "lspinfo" - "neo-tree" - "TelescopePrompt" - ]; - }; - }; - }; - }; } diff --git a/home/modules/devtools/neovim/plugins/efm.nix b/home/modules/devtools/neovim/plugins/efm.nix index f2da424a..326c99da 100644 --- a/home/modules/devtools/neovim/plugins/efm.nix +++ b/home/modules/devtools/neovim/plugins/efm.nix @@ -1,22 +1,36 @@ +{ lib +, config +, ... +}: +let + inherit (lib) mkEnableOption mkIf; + cfg = config.modules.devtools.neovim.plugins.efm; +in { - programs.nixvim.plugins = { - lsp.servers.efm = { - enable = true; - extraOptions.init_options = { - documentFormatting = true; - documentRangeFormatting = true; - hover = true; - documentSymbol = true; - codeAction = true; - completion = true; + options = { + modules.devtools.neovim.plugins.efm.enable = mkEnableOption "Enables EFM LSP support for Neovim"; + }; + + config = mkIf cfg.enable { + programs.nixvim.plugins = { + lsp.servers.efm = { + enable = true; + extraOptions.init_options = { + documentFormatting = true; + documentRangeFormatting = true; + hover = true; + documentSymbol = true; + codeAction = true; + completion = true; + }; }; - }; - lsp-format = { - enable = true; - lspServersToEnable = ["efm"]; - }; + lsp-format = { + enable = true; + lspServersToEnable = [ "efm" ]; + }; - efmls-configs.enable = true; + efmls-configs.enable = true; + }; }; } diff --git a/home/modules/devtools/neovim/plugins/floaterm.nix b/home/modules/devtools/neovim/plugins/floaterm.nix index 6ef22e65..c35644f5 100644 --- a/home/modules/devtools/neovim/plugins/floaterm.nix +++ b/home/modules/devtools/neovim/plugins/floaterm.nix @@ -1,12 +1,24 @@ +{ lib +, config +, ... +}: +let + inherit (lib) mkEnableOption mkIf; + cfg = config.modules.devtools.neovim.plugins.floaterm; +in { - programs.nixvim.plugins.floaterm = { - enable = true; + options = { + modules.devtools.neovim.plugins.floaterm.enable = mkEnableOption "Enables Floaterm plugin for Neovim"; + }; - width = 0.8; - height = 0.8; + config = mkIf cfg.enable { + programs.nixvim.plugins.floaterm = { + enable = true; + width = 0.8; + height = 0.8; + title = ""; - title = ""; - - keymaps.toggle = ","; + keymaps.toggle = ","; + }; }; } diff --git a/home/modules/devtools/neovim/plugins/harpoon.nix b/home/modules/devtools/neovim/plugins/harpoon.nix index c7ad0f3b..1ab4cc32 100644 --- a/home/modules/devtools/neovim/plugins/harpoon.nix +++ b/home/modules/devtools/neovim/plugins/harpoon.nix @@ -1,6 +1,18 @@ +{ lib +, config +, ... +}: +let + inherit (lib) mkEnableOption mkIf; + cfg = config.modules.devtools.neovim.plugins.harpoon; +in { - programs.nixvim = { - plugins.harpoon = { + options = { + modules.devtools.neovim.plugins.harpoon.enable = mkEnableOption "Enables Harpoon plugin for Neovim"; + }; + + config = mkIf cfg.enable { + programs.nixvim.plugins.harpoon = { enable = true; keymapsSilent = true; diff --git a/home/modules/devtools/neovim/plugins/lsp.nix b/home/modules/devtools/neovim/plugins/lsp.nix index afff343f..beb34bd8 100644 --- a/home/modules/devtools/neovim/plugins/lsp.nix +++ b/home/modules/devtools/neovim/plugins/lsp.nix @@ -1,84 +1,85 @@ { - programs.nixvim = { - plugins = { - lsp = { - enable = true; + lib, + config, + ... +}: let + inherit (lib) mkEnableOption mkIf; + cfg = config.modules.devtools.neovim.plugins.lsp; +in { + options = { + modules.devtools.neovim.plugins.lsp = { + enable = mkEnableOption "Enables LSP support for Neovim"; + servers = { + cssls.enable = mkEnableOption "Enable CSS LSP"; + tailwindcss.enable = mkEnableOption "Enable TailwindCSS LSP"; + html.enable = mkEnableOption "Enable HTML LSP"; + astro.enable = mkEnableOption "Enable AstroJS LSP"; + phpactor.enable = mkEnableOption "Enable PHP LSP"; + svelte.enable = mkEnableOption "Enable Svelte LSP"; + vuels.enable = mkEnableOption "Enable Vue LSP"; + pyright.enable = mkEnableOption "Enable Python LSP"; + marksman.enable = mkEnableOption "Enable Markdown LSP"; + nixd.enable = mkEnableOption "Enable Nix LSP"; + dockerls.enable = mkEnableOption "Enable Docker LSP"; + bashls.enable = mkEnableOption "Enable Bash LSP"; + clangd.enable = mkEnableOption "Enable C/C++ LSP"; + csharp-ls.enable = mkEnableOption "Enable C# LSP"; + yamlls.enable = mkEnableOption "Enable YAML LSP"; + lua-ls.enable = mkEnableOption "Enable Lua LSP"; + tsserver.enable = mkEnableOption "Enable TypeScript/JavaScript LSP"; + rust-analyzer.enable = mkEnableOption "Enable Rust LSP"; + }; + }; + }; - keymaps = { - silent = true; - diagnostic = { - # Navigate in diagnostics - "k" = "goto_prev"; - "j" = "goto_next"; - }; + config = mkIf cfg.enable { + programs.nixvim.plugins.lsp = { + enable = true; - lspBuf = { - gd = "definition"; - gD = "references"; - gt = "type_definition"; - gi = "implementation"; - K = "hover"; - "" = "rename"; - }; + keymaps = { + silent = true; + diagnostic = { + "k" = "goto_prev"; + "j" = "goto_next"; }; - # Language server - servers = { - # Average webdev LSPs - cssls.enable = true; # CSS - tailwindcss.enable = true; # TailwindCSS - html.enable = true; # HTML - astro.enable = false; # AstroJS - phpactor.enable = true; # PHP - svelte.enable = false; # Svelte - vuels.enable = false; # Vue + lspBuf = { + gd = "definition"; + gD = "references"; + gt = "type_definition"; + gi = "implementation"; + K = "hover"; + "" = "rename"; + }; + }; - # Python - pyright.enable = true; - - # Markdown - marksman.enable = true; - - # Nix - nixd.enable = true; - - # Docker - dockerls.enable = true; - - # Bash - bashls.enable = true; - - # C/C++ - clangd.enable = true; - - # C# - csharp-ls.enable = true; - - # Yaml - yamlls.enable = true; - - # Lua - lua-ls = { - enable = true; - settings.telemetry.enable = false; - settings.diagnostics = { - globals = ["vim"]; - }; - }; - tsserver = { - enable = false; # TS/JS - }; - # Rust - rust-analyzer = { - enable = true; - installRustc = true; - installCargo = true; - settings = { - checkOnSave = true; - check = { - command = "clippy"; - }; - }; + servers = { + cssls = mkIf cfg.servers.cssls.enable {}; + tailwindcss = mkIf cfg.servers.tailwindcss.enable {}; + html = mkIf cfg.servers.html.enable {}; + astro = mkIf cfg.servers.astro.enable {}; + phpactor = mkIf cfg.servers.phpactor.enable {}; + svelte = mkIf cfg.servers.svelte.enable {}; + vuels = mkIf cfg.servers.vuels.enable {}; + pyright = mkIf cfg.servers.pyright.enable {}; + marksman = mkIf cfg.servers.marksman.enable {}; + nixd = mkIf cfg.servers.nixd.enable {}; + dockerls = mkIf cfg.servers.dockerls.enable {}; + bashls = mkIf cfg.servers.bashls.enable {}; + clangd = mkIf cfg.servers.clangd.enable {}; + csharp-ls = mkIf cfg.servers.csharp-ls.enable {}; + yamlls = mkIf cfg.servers.yamlls.enable {}; + lua-ls = mkIf cfg.servers.lua-ls.enable { + settings.telemetry.enable = false; + settings.diagnostics.globals = ["vim"]; + }; + tsserver = mkIf cfg.servers.tsserver.enable {}; + rust-analyzer = mkIf cfg.servers.rust-analyzer.enable { + installRustc = true; + installCargo = true; + settings = { + checkOnSave = true; + check.command = "clippy"; }; }; }; diff --git a/home/modules/devtools/neovim/plugins/lualine.nix b/home/modules/devtools/neovim/plugins/lualine.nix index efed05cd..38df8f72 100644 --- a/home/modules/devtools/neovim/plugins/lualine.nix +++ b/home/modules/devtools/neovim/plugins/lualine.nix @@ -1,47 +1,57 @@ +{ lib +, config +, ... +}: +let + inherit (lib) mkEnableOption mkIf; + cfg = config.modules.devtools.neovim.plugins.lualine; +in { - programs.nixvim.plugins.lualine = { - enable = true; - theme = "gruvbox-material"; + options = { + modules.devtools.neovim.plugins.lualine.enable = mkEnableOption "Enables Lualine plugin for Neovim"; + }; - globalstatus = true; + config = mkIf cfg.enable { + programs.nixvim.plugins.lualine = { + enable = true; + theme = "gruvbox-material"; + globalstatus = true; - # +-------------------------------------------------+ - # | A | B | C X | Y | Z | - # +-------------------------------------------------+ - sections = { - lualine_a = ["mode"]; - lualine_b = ["branch"]; - lualine_c = ["filename" "diff"]; + sections = { + lualine_a = [ "mode" ]; + lualine_b = [ "branch" ]; + lualine_c = [ "filename" "diff" ]; - lualine_x = [ - "diagnostics" + lualine_x = [ + "diagnostics" - # Show active language server - { - name.__raw = '' - function() - local msg = "" - local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype') - local clients = vim.lsp.get_active_clients() - if next(clients) == nil then - return msg - end - for _, client in ipairs(clients) do - local filetypes = client.config.filetypes - if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then - return client.name - end - end - return msg - end - ''; - icon = ""; - color.fg = "#ffffff"; - } - "encoding" - "fileformat" - "filetype" - ]; + # Show active language server + { + name.__raw = '' + function() + local msg = "" + local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype') + local clients = vim.lsp.get_active_clients() + if next(clients) == nil then + return msg + end + for _, client in ipairs(clients) do + local filetypes = client.config.filetypes + if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then + return client.name + end + end + return msg + end + ''; + icon = ""; + color.fg = "#ffffff"; + } + "encoding" + "fileformat" + "filetype" + ]; + }; }; }; } diff --git a/home/modules/devtools/neovim/plugins/markdown-preview.nix b/home/modules/devtools/neovim/plugins/markdown-preview.nix index 17b8f970..f2806b69 100644 --- a/home/modules/devtools/neovim/plugins/markdown-preview.nix +++ b/home/modules/devtools/neovim/plugins/markdown-preview.nix @@ -1,20 +1,34 @@ +{ lib +, config +, ... +}: +let + inherit (lib) mkEnableOption mkIf; + cfg = config.modules.devtools.neovim.plugins.markdown-preview; +in { - programs.nixvim = { - plugins.markdown-preview = { - enable = true; + options = { + modules.devtools.neovim.plugins.markdown-preview.enable = mkEnableOption "Enables Markdown Preview plugin for Neovim"; + }; - settings = { - auto_close = false; - theme = "dark"; + config = mkIf cfg.enable { + programs.nixvim = { + plugins.markdown-preview = { + enable = true; + + settings = { + auto_close = false; + theme = "dark"; + }; }; - }; - files."after/ftplugin/markdown.lua".keymaps = [ - { - mode = "n"; - key = "m"; - action = ":MarkdownPreview"; - } - ]; + files."after/ftplugin/markdown.lua".keymaps = [ + { + mode = "n"; + key = "m"; + action = ":MarkdownPreview"; + } + ]; + }; }; } diff --git a/home/modules/devtools/neovim/plugins/neo-tree.nix b/home/modules/devtools/neovim/plugins/neo-tree.nix index 560e7f81..2fa53673 100644 --- a/home/modules/devtools/neovim/plugins/neo-tree.nix +++ b/home/modules/devtools/neovim/plugins/neo-tree.nix @@ -1,22 +1,36 @@ +{ lib +, config +, ... +}: +let + inherit (lib) mkEnableOption mkIf; + cfg = config.modules.devtools.neovim.plugins.neo-tree; +in { - programs.nixvim = { - keymaps = [ - { - mode = "n"; - key = "n"; - action = ":Neotree action=focus reveal toggle"; - options.silent = true; - } - ]; + options = { + modules.devtools.neovim.plugins.neo-tree.enable = mkEnableOption "Enables Neo-tree plugin for Neovim"; + }; - plugins.neo-tree = { - enable = true; + config = mkIf cfg.enable { + programs.nixvim = { + plugins.neo-tree = { + enable = true; - closeIfLastWindow = true; - window = { - width = 30; - autoExpandWidth = true; + closeIfLastWindow = true; + window = { + width = 30; + autoExpandWidth = true; + }; }; + + keymaps = [ + { + mode = "n"; + key = "n"; + action = ":Neotree action=focus reveal toggle"; + options.silent = true; + } + ]; }; }; } diff --git a/home/modules/devtools/neovim/plugins/nonels.nix b/home/modules/devtools/neovim/plugins/nonels.nix index f042bdbb..11ff2307 100644 --- a/home/modules/devtools/neovim/plugins/nonels.nix +++ b/home/modules/devtools/neovim/plugins/nonels.nix @@ -1,43 +1,57 @@ +{ lib +, config +, ... +}: +let + inherit (lib) mkEnableOption mkIf; + cfg = config.modules.devtools.neovim.plugins.none-ls; +in { - programs.nixvim.plugins.none-ls = { - enable = true; - settings = { - cmd = ["bash -c nvim"]; - debug = true; - }; - sources = { - code_actions = { - statix.enable = true; - gitsigns.enable = true; + options = { + modules.devtools.neovim.plugins.none-ls.enable = mkEnableOption "Enables None-LS plugin for Neovim"; + }; + + config = mkIf cfg.enable { + programs.nixvim.plugins.none-ls = { + enable = true; + settings = { + cmd = [ "bash -c nvim" ]; + debug = true; }; - diagnostics = { - statix.enable = true; - deadnix.enable = true; - pylint.enable = true; - checkstyle.enable = true; - }; - formatting = { - alejandra.enable = true; - stylua.enable = true; - shfmt.enable = true; - nixpkgs_fmt.enable = true; - google_java_format.enable = false; - prettier = { - enable = true; - disableTsServerFormatter = true; + sources = { + code_actions = { + statix.enable = true; + gitsigns.enable = true; }; - black = { - enable = true; - settings = '' - { - extra_args = { "--fast" }, - } - ''; + diagnostics = { + statix.enable = true; + deadnix.enable = true; + pylint.enable = true; + checkstyle.enable = true; + }; + formatting = { + alejandra.enable = true; + stylua.enable = true; + shfmt.enable = true; + nixpkgs_fmt.enable = true; + google_java_format.enable = false; + prettier = { + enable = true; + disableTsServerFormatter = true; + }; + black = { + enable = true; + settings = '' + { + extra_args = { "--fast" }; + } + ''; + }; + }; + completion = { + luasnip.enable = true; + spell.enable = true; }; - }; - completion = { - luasnip.enable = true; - spell.enable = true; }; }; }; diff --git a/home/modules/devtools/neovim/plugins/startify.nix b/home/modules/devtools/neovim/plugins/startify.nix index 28352a14..974f588a 100644 --- a/home/modules/devtools/neovim/plugins/startify.nix +++ b/home/modules/devtools/neovim/plugins/startify.nix @@ -1,32 +1,37 @@ +{ lib +, config +, ... +}: +let + inherit (lib) mkEnableOption mkIf; + cfg = config.modules.devtools.neovim.plugins.startify; +in { - programs.nixvim.plugins.startify = { - enable = true; + options = { + modules.devtools.neovim.plugins.startify.enable = mkEnableOption "Enables Startify plugin for Neovim"; + }; - settings = { - custom_header = [ - "" - " ███╗ ██╗██╗██╗ ██╗██╗ ██╗██╗███╗ ███╗" - " ████╗ ██║██║╚██╗██╔╝██║ ██║██║████╗ ████║" - " ██╔██╗ ██║██║ ╚███╔╝ ██║ ██║██║██╔████╔██║" - " ██║╚██╗██║██║ ██╔██╗ ╚██╗ ██╔╝██║██║╚██╔╝██║" - " ██║ ╚████║██║██╔╝ ██╗ ╚████╔╝ ██║██║ ╚═╝ ██║" - " ╚═╝ ╚═══╝╚═╝╚═╝ ╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═╝" - ]; + config = mkIf cfg.enable { + programs.nixvim.plugins.startify = { + enable = true; - # When opening a file or bookmark, change to its directory. - change_to_dir = false; + settings = { + custom_header = [ + "" + " ███╗ ██╗██╗██╗ ██╗██╗ ██╗██╗███╗ ███╗" + " ████╗ ██║██║╚██╗██╔╝██║ ██║██║████╗ ████║" + " ██╔██╗ ██║██║ ╚███╔╝ ██║ ██║██║██╔████╔██║" + " ██║╚██╗██║██║ ██╔██╗ ╚██╗ ██╔╝██║██║╚██╔╝██║" + " ██║ ╚████║██║██╔╝ ██╗ ╚████╔╝ ██║██║ ╚═╝ ██║" + " ╚═╝ ╚═══╝╚═╝╚═╝ ╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═╝" + ]; - # By default, the fortune header uses ASCII characters, because they work for everyone. - # If you set this option to 1 and your 'encoding' is "utf-8", Unicode box-drawing characters will - # be used instead. - use_unicode = true; - - lists = [{type = "dir";}]; - files_number = 30; - - skiplist = [ - "flake.lock" - ]; + change_to_dir = false; + use_unicode = true; + lists = [{ type = "dir"; }]; + files_number = 30; + skiplist = [ "flake.lock" ]; + }; }; }; } diff --git a/home/modules/devtools/neovim/plugins/tagbar.nix b/home/modules/devtools/neovim/plugins/tagbar.nix index 1478e9a7..d862fcc3 100644 --- a/home/modules/devtools/neovim/plugins/tagbar.nix +++ b/home/modules/devtools/neovim/plugins/tagbar.nix @@ -1,17 +1,31 @@ +{ lib +, config +, ... +}: +let + inherit (lib) mkEnableOption mkIf; + cfg = config.modules.devtools.neovim.plugins.tagbar; +in { - programs.nixvim = { - plugins.tagbar = { - enable = true; - settings.width = 50; - }; + options = { + modules.devtools.neovim.plugins.tagbar.enable = mkEnableOption "Enables Tagbar plugin for Neovim"; + }; - keymaps = [ - { - mode = "n"; - key = ""; - action = ":TagbarToggle"; - options.silent = true; - } - ]; + config = mkIf cfg.enable { + programs.nixvim = { + plugins.tagbar = { + enable = true; + settings.width = 50; + }; + + keymaps = [ + { + mode = "n"; + key = ""; + action = ":TagbarToggle"; + options.silent = true; + } + ]; + }; }; } diff --git a/home/modules/devtools/neovim/plugins/telescope.nix b/home/modules/devtools/neovim/plugins/telescope.nix index 70d05762..c3008474 100644 --- a/home/modules/devtools/neovim/plugins/telescope.nix +++ b/home/modules/devtools/neovim/plugins/telescope.nix @@ -1,17 +1,27 @@ +{ lib +, config +, ... +}: +let + inherit (lib) mkEnableOption mkIf; + cfg = config.modules.devtools.neovim.plugins.telescope; +in { - programs.nixvim = { - plugins.telescope = { + options = { + modules.devtools.neovim.plugins.telescope.enable = mkEnableOption "Enables Telescope plugin for Neovim"; + }; + + config = mkIf cfg.enable { + programs.nixvim.plugins.telescope = { enable = true; keymaps = { - # Find files using Telescope command-line sugar. "ff" = "find_files"; "fg" = "live_grep"; "b" = "buffers"; "fh" = "help_tags"; "fd" = "diagnostics"; - # FZF like bindings "" = "git_files"; "p" = "oldfiles"; "" = "live_grep"; diff --git a/home/modules/devtools/neovim/plugins/treesitter.nix b/home/modules/devtools/neovim/plugins/treesitter.nix index c5e8d7ab..d7c1ffda 100644 --- a/home/modules/devtools/neovim/plugins/treesitter.nix +++ b/home/modules/devtools/neovim/plugins/treesitter.nix @@ -1,26 +1,41 @@ +{ lib +, config +, ... +}: +let + inherit (lib) mkEnableOption mkIf; + cfg = config.modules.devtools.neovim.plugins.treesitter; +in { - programs.nixvim.plugins = { - treesitter = { - enable = true; - - nixvimInjections = true; - - settings = { - highlight.enable = true; - indent.enable = true; - }; - folding = true; + options = { + modules.devtools.neovim.plugins = { + treesitter.enable = mkEnableOption "Enables Treesitter plugin for Neovim"; }; + }; - treesitter-refactor = { - enable = true; - highlightDefinitions = { + config = mkIf cfg.enable { + programs.nixvim.plugins = { + treesitter = { + enable = true; + nixvimInjections = true; + settings = { + highlight.enable = true; + indent.enable = true; + }; + folding = true; + }; + + treesitter-refactor = mkIf cfg.enable { + enable = true; + highlightDefinitions = { + enable = true; + clearOnCursorMove = false; + }; + }; + + hmts = mkIf cfg.enable { enable = true; - # Set to false if you have an `updatetime` of ~100. - clearOnCursorMove = false; }; }; - - hmts.enable = true; }; } diff --git a/home/modules/devtools/neovim/plugins/vimtex.nix b/home/modules/devtools/neovim/plugins/vimtex.nix index 2cfbc803..331b5753 100644 --- a/home/modules/devtools/neovim/plugins/vimtex.nix +++ b/home/modules/devtools/neovim/plugins/vimtex.nix @@ -1,77 +1,79 @@ +{ lib +, config +, ... +}: +let + inherit (lib) mkEnableOption mkIf; + cfg = config.modules.devtools.neovim.plugins.vimtex; +in { - programs.nixvim = { - plugins.vimtex = { - enable = true; + options = { + modules.devtools.neovim.plugins.vimtex.enable = mkEnableOption "Enables VimTeX plugin for Neovim"; + }; - settings = { - view_method = "zathura"; - - quickfix_enabled = true; - quickfix_open_on_warning = false; - - # Ignore undesired errors and warnings - quickfix_ignore_filters = [ - "Underfull" - "Overfull" - "specifier changed to" - "Token not allowed in a PDF string" - ]; - - # TOC settings - toc_config = { - name = "TOC"; - layers = ["content" "todo"]; - resize = true; - split_width = 50; - todo_sorted = false; - show_help = true; - show_numbers = true; - mode = 2; + config = mkIf cfg.enable { + programs.nixvim = { + plugins.vimtex = { + enable = true; + settings = { + view_method = "zathura"; + quickfix_enabled = true; + quickfix_open_on_warning = false; + quickfix_ignore_filters = [ + "Underfull" + "Overfull" + "specifier changed to" + "Token not allowed in a PDF string" + ]; + toc_config = { + name = "TOC"; + layers = [ "content" "todo" ]; + resize = true; + split_width = 50; + todo_sorted = false; + show_help = true; + show_numbers = true; + mode = 2; + }; }; }; + + files."after/ftplugin/tex.lua".keymaps = [ + { + mode = "n"; + key = "m"; + action = ":VimtexView"; + } + ]; + + autoCmd = [ + { + event = [ "BufEnter" "BufWinEnter" ]; + pattern = "*.tex"; + command = "set filetype=tex \"| VimtexTocOpen"; + } + { + event = "FileType"; + pattern = [ "tex" "latex" ]; + callback = '' + function () + vim.o.foldmethod = 'expr' + vim.o.foldexpr = 'vimtex#fold#level(v:lnum)' + vim.o.foldtext = 'vimtex#fold#text()' + end + ''; + } + { + event = "User"; + pattern = "VimtexEventInitPost"; + callback = "vimtex#compiler#compile"; + } + { + event = "User"; + pattern = "VimtexEventQuit"; + command = "call vimtex#compiler#clean(0)"; + } + ]; }; - - files."after/ftplugin/tex.lua".keymaps = [ - { - mode = "n"; - key = "m"; - action = ":VimtexView"; - } - ]; - - autoCmd = [ - { - event = ["BufEnter" "BufWinEnter"]; - pattern = "*.tex"; - command = "set filetype=tex \"| VimtexTocOpen"; - } - - # Folding - { - event = "FileType"; - pattern = ["tex" "latex"]; - callback.__raw = '' - function () - vim.o.foldmethod = 'expr' - vim.o.foldexpr = 'vimtex#fold#level(v:lnum)' - vim.o.foldtext = 'vimtex#fold#text()' - end - ''; - } - - # Compile on initialization - { - event = "User"; - pattern = "VimtexEventInitPost"; - callback = "vimtex#compiler#compile"; - } - - # Cleanup on exit - { - event = "User"; - pattern = "VimtexEventQuit"; - command = "call vimtex#compiler#clean(0)"; - } - ]; }; } diff --git a/home/modules/devtools/neovim/plugins/yanky.nix b/home/modules/devtools/neovim/plugins/yanky.nix index 31437cf2..f18ad02a 100644 --- a/home/modules/devtools/neovim/plugins/yanky.nix +++ b/home/modules/devtools/neovim/plugins/yanky.nix @@ -1,5 +1,19 @@ +{ lib +, config +, ... +}: +let + inherit (lib) mkEnableOption mkIf; + cfg = config.modules.devtools.neovim.plugins.yanky; +in { - programs.nixvim.plugins.yanky = { - enable = true; + options = { + modules.devtools.neovim.plugins.yanky.enable = mkEnableOption "Enables Yanky plugin for Neovim"; + }; + + config = mkIf cfg.enable { + programs.nixvim.plugins.yanky = { + enable = true; + }; }; } diff --git a/home/modules/devtools/neovim/pluginsbak/barbar.nix b/home/modules/devtools/neovim/pluginsbak/barbar.nix new file mode 100644 index 00000000..aa95f803 --- /dev/null +++ b/home/modules/devtools/neovim/pluginsbak/barbar.nix @@ -0,0 +1,10 @@ +{ + programs.nixvim.plugins.barbar = { + enable = true; + keymaps = { + next.key = ""; + previous.key = ""; + close.key = ""; + }; + }; +} diff --git a/home/modules/devtools/neovim/plugins/chatgpt.nix b/home/modules/devtools/neovim/pluginsbak/chatgpt.nix similarity index 100% rename from home/modules/devtools/neovim/plugins/chatgpt.nix rename to home/modules/devtools/neovim/pluginsbak/chatgpt.nix diff --git a/home/modules/devtools/neovim/pluginsbak/comment.nix b/home/modules/devtools/neovim/pluginsbak/comment.nix new file mode 100644 index 00000000..edf65367 --- /dev/null +++ b/home/modules/devtools/neovim/pluginsbak/comment.nix @@ -0,0 +1,10 @@ +{ + programs.nixvim.plugins.comment = { + enable = true; + + settings = { + opleader.line = ""; + toggler.line = ""; + }; + }; +} diff --git a/home/modules/devtools/neovim/pluginsbak/conform.nix b/home/modules/devtools/neovim/pluginsbak/conform.nix new file mode 100644 index 00000000..98e1e6b4 --- /dev/null +++ b/home/modules/devtools/neovim/pluginsbak/conform.nix @@ -0,0 +1,24 @@ +{ + programs.nixvim.plugins.conform-nvim = { + enable = true; + formatOnSave = { + lspFallback = true; + timeoutMs = 500; + }; + notifyOnError = true; + formattersByFt = { + liquidsoap = [ "liquidsoap-prettier" ]; + html = [ [ "prettierd" "prettier" ] ]; + css = [ [ "prettierd" "prettier" ] ]; + javascript = [ [ "prettierd" "prettier" ] ]; + javascriptreact = [ [ "prettierd" "prettier" ] ]; + typescript = [ [ "prettierd" "prettier" ] ]; + typescriptreact = [ [ "prettierd" "prettier" ] ]; + python = [ "black" ]; + lua = [ "stylua" ]; + nix = [ "alejandra" ]; + markdown = [ [ "prettierd" "prettier" ] ]; + yaml = [ "yamllint" "yamlfmt" ]; + }; + }; +} diff --git a/home/modules/devtools/neovim/pluginsbak/default.nix b/home/modules/devtools/neovim/pluginsbak/default.nix new file mode 100644 index 00000000..db6120ef --- /dev/null +++ b/home/modules/devtools/neovim/pluginsbak/default.nix @@ -0,0 +1,93 @@ +{ + pkgs, + config, + lib, + concatLists, + ... +}: let + inherit (lib) mkIf; + cfg = config.modules.devtools.neovim; +in { + imports = concatLists [ + mkIf + (cfg.barbar.enable or true) + [./barbar.nix] + mkIf + (cfg.chatgpt.enable or true) + [./chatgpt.nix] + mkIf + (cfg.comment.enable or true) + [./comment.nix] + mkIf + (cfg.conform.enable or true) + [./conform.nix] + mkIf + (cfg.efm.enable or true) + [./efm.nix] + mkIf + (cfg.lsp.enable or true) + [./lsp.nix] + mkIf + (cfg.lualine.enable or true) + [./lualine.nix] + mkIf + (cfg.markdown-preview.enable or true) + [./markdown-preview.nix] + mkIf + (cfg.neo-tree.enable or true) + [./neo-tree.nix] + mkIf + (cfg.nonels.enable or true) + [./nonels.nix] + mkIf + (cfg.startify.enable or true) + [./startify.nix] + mkIf + (cfg.tagbar.enable or true) + [./tagbar.nix] + mkIf + (cfg.telescope.enable or true) + [./telescope.nix] + mkIf + (cfg.treesitter.enable or true) + [./treesitter.nix] + ]; + + programs.nixvim = { + extraPlugins = [pkgs.vimPlugins.gruvbox-material]; + colorscheme = "gruvbox-material"; + + plugins = { + gitsigns = { + enable = true; + settings.signs = { + add.text = "+"; + change.text = "~"; + }; + }; + + nvim-autopairs.enable = true; + + nvim-colorizer = { + enable = true; + userDefaultOptions.names = false; + }; + + oil.enable = true; + + trim = { + enable = true; + settings = { + highlight = false; + ft_blocklist = [ + "checkhealth" + "floaterm" + "lspinfo" + "neo-tree" + "TelescopePrompt" + ]; + }; + }; + }; + }; +} diff --git a/home/modules/devtools/neovim/pluginsbak/efm.nix b/home/modules/devtools/neovim/pluginsbak/efm.nix new file mode 100644 index 00000000..f2da424a --- /dev/null +++ b/home/modules/devtools/neovim/pluginsbak/efm.nix @@ -0,0 +1,22 @@ +{ + programs.nixvim.plugins = { + lsp.servers.efm = { + enable = true; + extraOptions.init_options = { + documentFormatting = true; + documentRangeFormatting = true; + hover = true; + documentSymbol = true; + codeAction = true; + completion = true; + }; + }; + + lsp-format = { + enable = true; + lspServersToEnable = ["efm"]; + }; + + efmls-configs.enable = true; + }; +} diff --git a/home/modules/devtools/neovim/pluginsbak/floaterm.nix b/home/modules/devtools/neovim/pluginsbak/floaterm.nix new file mode 100644 index 00000000..6ef22e65 --- /dev/null +++ b/home/modules/devtools/neovim/pluginsbak/floaterm.nix @@ -0,0 +1,12 @@ +{ + programs.nixvim.plugins.floaterm = { + enable = true; + + width = 0.8; + height = 0.8; + + title = ""; + + keymaps.toggle = ","; + }; +} diff --git a/home/modules/devtools/neovim/pluginsbak/harpoon.nix b/home/modules/devtools/neovim/pluginsbak/harpoon.nix new file mode 100644 index 00000000..c7ad0f3b --- /dev/null +++ b/home/modules/devtools/neovim/pluginsbak/harpoon.nix @@ -0,0 +1,20 @@ +{ + programs.nixvim = { + plugins.harpoon = { + enable = true; + + keymapsSilent = true; + + keymaps = { + addFile = "a"; + toggleQuickMenu = ""; + navFile = { + "1" = ""; + "2" = ""; + "3" = ""; + "4" = ""; + }; + }; + }; + }; +} diff --git a/home/modules/devtools/neovim/pluginsbak/lsp.nix b/home/modules/devtools/neovim/pluginsbak/lsp.nix new file mode 100644 index 00000000..ab54cd52 --- /dev/null +++ b/home/modules/devtools/neovim/pluginsbak/lsp.nix @@ -0,0 +1,91 @@ +{ + config, + lib, + ... +}: let + inherit (lib) mkEnableOption mkIf; + cfg = config.modules.devtools.neovim.plugins.lsp; +in { + options = { + modules.devtools.neovim.plugins.lsp.enable = mkEnableOption "Enables LSP support for Neovim"; + + modules.devtools.neovim.plugins.lsp.servers = { + cssls.enable = mkEnableOption "Enable CSS LSP"; + tailwindcss.enable = mkEnableOption "Enable TailwindCSS LSP"; + html.enable = mkEnableOption "Enable HTML LSP"; + astro.enable = mkEnableOption "Enable AstroJS LSP"; + phpactor.enable = mkEnableOption "Enable PHP LSP"; + svelte.enable = mkEnableOption "Enable Svelte LSP"; + vuels.enable = mkEnableOption "Enable Vue LSP"; + pyright.enable = mkEnableOption "Enable Python LSP"; + marksman.enable = mkEnableOption "Enable Markdown LSP"; + nixd.enable = mkEnableOption "Enable Nix LSP"; + dockerls.enable = mkEnableOption "Enable Docker LSP"; + bashls.enable = mkEnableOption "Enable Bash LSP"; + clangd.enable = mkEnableOption "Enable C/C++ LSP"; + csharp-ls.enable = mkEnableOption "Enable C# LSP"; + yamlls.enable = mkEnableOption "Enable YAML LSP"; + lua-ls.enable = mkEnableOption "Enable Lua LSP"; + tsserver.enable = mkEnableOption "Enable TypeScript/JavaScript LSP"; + rust-analyzer.enable = mkEnableOption "Enable Rust LSP"; + }; + }; + + config = mkIf cfg.enable { + programs.nixvim = { + plugins = { + lsp = { + enable = true; + + keymaps = { + silent = true; + diagnostic = { + "k" = "goto_prev"; + "j" = "goto_next"; + }; + + lspBuf = { + gd = "definition"; + gD = "references"; + gt = "type_definition"; + gi = "implementation"; + K = "hover"; + "" = "rename"; + }; + }; + + servers = { + cssls = mkIf cfg.servers.cssls.enable {}; + tailwindcss = mkIf cfg.servers.tailwindcss.enable {}; + html = mkIf cfg.servers.html.enable {}; + astro = mkIf cfg.servers.astro.enable {}; + phpactor = mkIf cfg.servers.phpactor.enable {}; + svelte = mkIf cfg.servers.svelte.enable {}; + vuels = mkIf cfg.servers.vuels.enable {}; + pyright = mkIf cfg.servers.pyright.enable {}; + marksman = mkIf cfg.servers.marksman.enable {}; + nixd = mkIf cfg.servers.nixd.enable {}; + dockerls = mkIf cfg.servers.dockerls.enable {}; + bashls = mkIf cfg.servers.bashls.enable {}; + clangd = mkIf cfg.servers.clangd.enable {}; + csharp-ls = mkIf cfg.servers.csharp-ls.enable {}; + yamlls = mkIf cfg.servers.yamlls.enable {}; + lua-ls = mkIf cfg.servers.lua-ls.enable { + settings.telemetry.enable = false; + settings.diagnostics.globals = ["vim"]; + }; + tsserver = mkIf cfg.servers.tsserver.enable {}; + rust-analyzer = mkIf cfg.servers.rust-analyzer.enable { + installRustc = true; + installCargo = true; + settings = { + checkOnSave = true; + check.command = "clippy"; + }; + }; + }; + }; + }; + }; + }; +} diff --git a/home/modules/devtools/neovim/pluginsbak/lualine.nix b/home/modules/devtools/neovim/pluginsbak/lualine.nix new file mode 100644 index 00000000..efed05cd --- /dev/null +++ b/home/modules/devtools/neovim/pluginsbak/lualine.nix @@ -0,0 +1,47 @@ +{ + programs.nixvim.plugins.lualine = { + enable = true; + theme = "gruvbox-material"; + + globalstatus = true; + + # +-------------------------------------------------+ + # | A | B | C X | Y | Z | + # +-------------------------------------------------+ + sections = { + lualine_a = ["mode"]; + lualine_b = ["branch"]; + lualine_c = ["filename" "diff"]; + + lualine_x = [ + "diagnostics" + + # Show active language server + { + name.__raw = '' + function() + local msg = "" + local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype') + local clients = vim.lsp.get_active_clients() + if next(clients) == nil then + return msg + end + for _, client in ipairs(clients) do + local filetypes = client.config.filetypes + if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then + return client.name + end + end + return msg + end + ''; + icon = ""; + color.fg = "#ffffff"; + } + "encoding" + "fileformat" + "filetype" + ]; + }; + }; +} diff --git a/home/modules/devtools/neovim/pluginsbak/markdown-preview.nix b/home/modules/devtools/neovim/pluginsbak/markdown-preview.nix new file mode 100644 index 00000000..17b8f970 --- /dev/null +++ b/home/modules/devtools/neovim/pluginsbak/markdown-preview.nix @@ -0,0 +1,20 @@ +{ + programs.nixvim = { + plugins.markdown-preview = { + enable = true; + + settings = { + auto_close = false; + theme = "dark"; + }; + }; + + files."after/ftplugin/markdown.lua".keymaps = [ + { + mode = "n"; + key = "m"; + action = ":MarkdownPreview"; + } + ]; + }; +} diff --git a/home/modules/devtools/neovim/pluginsbak/neo-tree.nix b/home/modules/devtools/neovim/pluginsbak/neo-tree.nix new file mode 100644 index 00000000..560e7f81 --- /dev/null +++ b/home/modules/devtools/neovim/pluginsbak/neo-tree.nix @@ -0,0 +1,22 @@ +{ + programs.nixvim = { + keymaps = [ + { + mode = "n"; + key = "n"; + action = ":Neotree action=focus reveal toggle"; + options.silent = true; + } + ]; + + plugins.neo-tree = { + enable = true; + + closeIfLastWindow = true; + window = { + width = 30; + autoExpandWidth = true; + }; + }; + }; +} diff --git a/home/modules/devtools/neovim/pluginsbak/nonels.nix b/home/modules/devtools/neovim/pluginsbak/nonels.nix new file mode 100644 index 00000000..f042bdbb --- /dev/null +++ b/home/modules/devtools/neovim/pluginsbak/nonels.nix @@ -0,0 +1,44 @@ +{ + programs.nixvim.plugins.none-ls = { + enable = true; + settings = { + cmd = ["bash -c nvim"]; + debug = true; + }; + sources = { + code_actions = { + statix.enable = true; + gitsigns.enable = true; + }; + diagnostics = { + statix.enable = true; + deadnix.enable = true; + pylint.enable = true; + checkstyle.enable = true; + }; + formatting = { + alejandra.enable = true; + stylua.enable = true; + shfmt.enable = true; + nixpkgs_fmt.enable = true; + google_java_format.enable = false; + prettier = { + enable = true; + disableTsServerFormatter = true; + }; + black = { + enable = true; + settings = '' + { + extra_args = { "--fast" }, + } + ''; + }; + }; + completion = { + luasnip.enable = true; + spell.enable = true; + }; + }; + }; +} diff --git a/home/modules/devtools/neovim/pluginsbak/startify.nix b/home/modules/devtools/neovim/pluginsbak/startify.nix new file mode 100644 index 00000000..28352a14 --- /dev/null +++ b/home/modules/devtools/neovim/pluginsbak/startify.nix @@ -0,0 +1,32 @@ +{ + programs.nixvim.plugins.startify = { + enable = true; + + settings = { + custom_header = [ + "" + " ███╗ ██╗██╗██╗ ██╗██╗ ██╗██╗███╗ ███╗" + " ████╗ ██║██║╚██╗██╔╝██║ ██║██║████╗ ████║" + " ██╔██╗ ██║██║ ╚███╔╝ ██║ ██║██║██╔████╔██║" + " ██║╚██╗██║██║ ██╔██╗ ╚██╗ ██╔╝██║██║╚██╔╝██║" + " ██║ ╚████║██║██╔╝ ██╗ ╚████╔╝ ██║██║ ╚═╝ ██║" + " ╚═╝ ╚═══╝╚═╝╚═╝ ╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═╝" + ]; + + # When opening a file or bookmark, change to its directory. + change_to_dir = false; + + # By default, the fortune header uses ASCII characters, because they work for everyone. + # If you set this option to 1 and your 'encoding' is "utf-8", Unicode box-drawing characters will + # be used instead. + use_unicode = true; + + lists = [{type = "dir";}]; + files_number = 30; + + skiplist = [ + "flake.lock" + ]; + }; + }; +} diff --git a/home/modules/devtools/neovim/pluginsbak/tagbar.nix b/home/modules/devtools/neovim/pluginsbak/tagbar.nix new file mode 100644 index 00000000..1478e9a7 --- /dev/null +++ b/home/modules/devtools/neovim/pluginsbak/tagbar.nix @@ -0,0 +1,17 @@ +{ + programs.nixvim = { + plugins.tagbar = { + enable = true; + settings.width = 50; + }; + + keymaps = [ + { + mode = "n"; + key = ""; + action = ":TagbarToggle"; + options.silent = true; + } + ]; + }; +} diff --git a/home/modules/devtools/neovim/pluginsbak/telescope.nix b/home/modules/devtools/neovim/pluginsbak/telescope.nix new file mode 100644 index 00000000..70d05762 --- /dev/null +++ b/home/modules/devtools/neovim/pluginsbak/telescope.nix @@ -0,0 +1,33 @@ +{ + programs.nixvim = { + plugins.telescope = { + enable = true; + + keymaps = { + # Find files using Telescope command-line sugar. + "ff" = "find_files"; + "fg" = "live_grep"; + "b" = "buffers"; + "fh" = "help_tags"; + "fd" = "diagnostics"; + + # FZF like bindings + "" = "git_files"; + "p" = "oldfiles"; + "" = "live_grep"; + }; + + settings.defaults = { + file_ignore_patterns = [ + "^.git/" + "^.mypy_cache/" + "^__pycache__/" + "^output/" + "^data/" + "%.ipynb" + ]; + set_env.COLORTERM = "truecolor"; + }; + }; + }; +} diff --git a/home/modules/devtools/neovim/pluginsbak/treesitter.nix b/home/modules/devtools/neovim/pluginsbak/treesitter.nix new file mode 100644 index 00000000..c5e8d7ab --- /dev/null +++ b/home/modules/devtools/neovim/pluginsbak/treesitter.nix @@ -0,0 +1,26 @@ +{ + programs.nixvim.plugins = { + treesitter = { + enable = true; + + nixvimInjections = true; + + settings = { + highlight.enable = true; + indent.enable = true; + }; + folding = true; + }; + + treesitter-refactor = { + enable = true; + highlightDefinitions = { + enable = true; + # Set to false if you have an `updatetime` of ~100. + clearOnCursorMove = false; + }; + }; + + hmts.enable = true; + }; +} diff --git a/home/modules/devtools/neovim/pluginsbak/vimtex.nix b/home/modules/devtools/neovim/pluginsbak/vimtex.nix new file mode 100644 index 00000000..2cfbc803 --- /dev/null +++ b/home/modules/devtools/neovim/pluginsbak/vimtex.nix @@ -0,0 +1,77 @@ +{ + programs.nixvim = { + plugins.vimtex = { + enable = true; + + settings = { + view_method = "zathura"; + + quickfix_enabled = true; + quickfix_open_on_warning = false; + + # Ignore undesired errors and warnings + quickfix_ignore_filters = [ + "Underfull" + "Overfull" + "specifier changed to" + "Token not allowed in a PDF string" + ]; + + # TOC settings + toc_config = { + name = "TOC"; + layers = ["content" "todo"]; + resize = true; + split_width = 50; + todo_sorted = false; + show_help = true; + show_numbers = true; + mode = 2; + }; + }; + }; + + files."after/ftplugin/tex.lua".keymaps = [ + { + mode = "n"; + key = "m"; + action = ":VimtexView"; + } + ]; + + autoCmd = [ + { + event = ["BufEnter" "BufWinEnter"]; + pattern = "*.tex"; + command = "set filetype=tex \"| VimtexTocOpen"; + } + + # Folding + { + event = "FileType"; + pattern = ["tex" "latex"]; + callback.__raw = '' + function () + vim.o.foldmethod = 'expr' + vim.o.foldexpr = 'vimtex#fold#level(v:lnum)' + vim.o.foldtext = 'vimtex#fold#text()' + end + ''; + } + + # Compile on initialization + { + event = "User"; + pattern = "VimtexEventInitPost"; + callback = "vimtex#compiler#compile"; + } + + # Cleanup on exit + { + event = "User"; + pattern = "VimtexEventQuit"; + command = "call vimtex#compiler#clean(0)"; + } + ]; + }; +} diff --git a/home/modules/devtools/neovim/pluginsbak/yanky.nix b/home/modules/devtools/neovim/pluginsbak/yanky.nix new file mode 100644 index 00000000..31437cf2 --- /dev/null +++ b/home/modules/devtools/neovim/pluginsbak/yanky.nix @@ -0,0 +1,5 @@ +{ + programs.nixvim.plugins.yanky = { + enable = true; + }; +} diff --git a/home/modules/wm/hyprland/toothpick/inputs.nix b/home/modules/wm/hyprland/toothpick/inputs.nix index f5401b76..82752393 100644 --- a/home/modules/wm/hyprland/toothpick/inputs.nix +++ b/home/modules/wm/hyprland/toothpick/inputs.nix @@ -1,11 +1,12 @@ -{ - lib, - config, - ... -}: let +{ lib +, config +, ... +}: +let inherit (lib) mkIf mkEnableOption; cfg = config.modules.wm.hyprland.toothpick.inputs; -in { +in +{ options = { modules.wm.hyprland.toothpick.inputs.enable = mkEnableOption "Enables input settings in Hyprland"; }; @@ -48,7 +49,7 @@ in { workspace_swipe_create_new = true; }; misc = { - vrr = 2; + vrr = 0; mouse_move_enables_dpms = 1; key_press_enables_dpms = 0; force_default_wallpaper = 0; @@ -59,8 +60,8 @@ in { force_zero_scaling = false; }; render = { - explicit_sync = 2; - explicit_sync_kms = 2; + explicit_sync = 0; + explicit_sync_kms = 0; direct_scanout = false; }; cursor = { diff --git a/home/users/adam/default.nix b/home/users/adam/default.nix index fe3c3bab..743fc90a 100644 --- a/home/users/adam/default.nix +++ b/home/users/adam/default.nix @@ -18,7 +18,7 @@ sessionVariables = { BROWSER = "firefox"; EDITOR = "nvim"; - TERM = "foot"; + TERM = "xterm-256color"; QT_QPA_PLATFORM = "wayland"; SDL_VIDEODRIVER = "wayland"; diff --git a/home/users/adam/modules.nix b/home/users/adam/modules.nix index d5e961f1..46dc3237 100644 --- a/home/users/adam/modules.nix +++ b/home/users/adam/modules.nix @@ -8,7 +8,51 @@ discord.enable = true; }; devtools = { - neovim.enable = true; + neovim = { + enable = true; + plugins = { + ai.enable = true; + barbar.enable = true; + comment.enable = true; + conform-nvim.enable = true; + efm.enable = true; + lualine.enable = true; + markdown-preview.enable = true; + neo-tree.enable = true; + none-ls.enable = true; + startify.enable = true; + telescope.enable = true; + treesitter.enable = true; + floaterm.enable = false; + harpoon.enable = false; + tagbar.enable = false; + vimtex.enable = false; + yanky.enable = false; + lsp = { + enable = true; + servers = { + cssls.enable = true; + tailwindcss.enable = true; + html.enable = true; + astro.enable = false; + phpactor.enable = true; + svelte.enable = false; + vuels.enable = false; + pyright.enable = true; + marksman.enable = true; + nixd.enable = true; + dockerls.enable = true; + bashls.enable = true; + clangd.enable = true; + csharp-ls.enable = true; + yamlls.enable = true; + lua-ls.enable = true; + tsserver.enable = false; + rust-analyzer.enable = true; + }; + }; + }; + }; vscode.enable = false; }; gaming = { diff --git a/home/users/cnst/default.nix b/home/users/cnst/default.nix index ee606916..eb823595 100644 --- a/home/users/cnst/default.nix +++ b/home/users/cnst/default.nix @@ -16,7 +16,7 @@ sessionVariables = { BROWSER = "firefox"; EDITOR = "nvim"; - TERM = "kitty"; + TERM = "xterm-256color"; STEAM_EXTRA_COMPAT_TOOLS_PATHS = "/home/cnst/.steam/root/compatibilitytools.d"; # proton and steam compat QT_QPA_PLATFORM = "wayland"; diff --git a/home/users/cnst/modules.nix b/home/users/cnst/modules.nix index b244741f..a19867f1 100644 --- a/home/users/cnst/modules.nix +++ b/home/users/cnst/modules.nix @@ -8,7 +8,51 @@ discord.enable = true; }; devtools = { - neovim.enable = true; + neovim = { + enable = true; + plugins = { + ai.enable = true; + barbar.enable = true; + comment.enable = true; + conform-nvim.enable = true; + efm.enable = true; + lualine.enable = true; + markdown-preview.enable = true; + neo-tree.enable = true; + none-ls.enable = true; + startify.enable = true; + telescope.enable = true; + treesitter.enable = true; + floaterm.enable = false; + harpoon.enable = false; + tagbar.enable = false; + vimtex.enable = false; + yanky.enable = false; + lsp = { + enable = true; + servers = { + cssls.enable = true; + tailwindcss.enable = true; + html.enable = true; + astro.enable = false; + phpactor.enable = true; + svelte.enable = false; + vuels.enable = false; + pyright.enable = true; + marksman.enable = true; + nixd.enable = true; + dockerls.enable = true; + bashls.enable = true; + clangd.enable = true; + csharp-ls.enable = true; + yamlls.enable = true; + lua-ls.enable = true; + tsserver.enable = false; + rust-analyzer.enable = true; + }; + }; + }; + }; vscode.enable = false; }; gaming = { diff --git a/home/users/toothpick/default.nix b/home/users/toothpick/default.nix index 8a0211d7..3bffd666 100644 --- a/home/users/toothpick/default.nix +++ b/home/users/toothpick/default.nix @@ -17,7 +17,7 @@ sessionVariables = { BROWSER = "firefox"; EDITOR = "nvim"; - TERM = "foot"; + TERM = "xterm-256color"; STEAM_EXTRA_COMPAT_TOOLS_PATHS = "/home/toothpick/.steam/root/compatibilitytools.d"; # proton and steam compat LIBVA_DRIVER_NAME = "nvidia"; diff --git a/home/users/toothpick/modules.nix b/home/users/toothpick/modules.nix index bb001e3f..e0c32e12 100644 --- a/home/users/toothpick/modules.nix +++ b/home/users/toothpick/modules.nix @@ -8,7 +8,51 @@ discord.enable = true; }; devtools = { - neovim.enable = true; + neovim = { + enable = true; + plugins = { + ai.enable = false; + barbar.enable = true; + comment.enable = true; + conform-nvim.enable = true; + efm.enable = true; + lualine.enable = true; + markdown-preview.enable = true; + neo-tree.enable = true; + none-ls.enable = true; + startify.enable = true; + telescope.enable = true; + treesitter.enable = true; + floaterm.enable = false; + harpoon.enable = false; + tagbar.enable = false; + vimtex.enable = false; + yanky.enable = false; + lsp = { + enable = true; + servers = { + cssls.enable = true; + tailwindcss.enable = true; + html.enable = true; + astro.enable = false; + phpactor.enable = true; + svelte.enable = false; + vuels.enable = false; + pyright.enable = true; + marksman.enable = true; + nixd.enable = true; + dockerls.enable = true; + bashls.enable = true; + clangd.enable = true; + csharp-ls.enable = true; + yamlls.enable = true; + lua-ls.enable = true; + tsserver.enable = false; + rust-analyzer.enable = true; + }; + }; + }; + }; vscode.enable = true; }; gaming = { diff --git a/hosts/cnix/modules.nix b/hosts/cnix/modules.nix index de580a7d..b2730583 100644 --- a/hosts/cnix/modules.nix +++ b/hosts/cnix/modules.nix @@ -64,6 +64,8 @@ corectrl.enable = true; microfetch.enable = true; nix-ld.enable = false; + misc.enable = true; + npm.enable = true; }; }; } diff --git a/system/modules/default.nix b/system/modules/default.nix index 0ab2290c..1483c376 100644 --- a/system/modules/default.nix +++ b/system/modules/default.nix @@ -36,5 +36,7 @@ "${systemModules}/utils/corectrl" "${systemModules}/utils/microfetch" "${systemModules}/utils/nix-ld" + "${systemModules}/utils/misc" + "${systemModules}/utils/npm" ]; } diff --git a/system/modules/utils/misc/default.nix b/system/modules/utils/misc/default.nix new file mode 100644 index 00000000..d2d63fa1 --- /dev/null +++ b/system/modules/utils/misc/default.nix @@ -0,0 +1,20 @@ +{ + pkgs, + config, + lib, + ... +}: let + inherit (lib) mkIf mkEnableOption; + cfg = config.modules.utils.misc; +in { + options = { + modules.utils.misc.enable = mkEnableOption "Enables miscellaneous pacakges"; + }; + config = mkIf cfg.enable { + environment.systemPackages = with pkgs; [ + nodejs_22 + ripgrep + fd + ]; + }; +} diff --git a/system/modules/utils/npm/default.nix b/system/modules/utils/npm/default.nix new file mode 100644 index 00000000..c15a838d --- /dev/null +++ b/system/modules/utils/npm/default.nix @@ -0,0 +1,17 @@ +{ + config, + lib, + ... +}: let + inherit (lib) mkIf mkEnableOption; + cfg = config.modules.utils.npm; +in { + options = { + modules.utils.npm.enable = mkEnableOption "Enables npm"; + }; + config = mkIf cfg.enable { + programs.npm = { + enable = true; + }; + }; +} From fecb63e2a4ae6d7fa0a661762d8222984a5a265c Mon Sep 17 00:00:00 2001 From: cnst Date: Mon, 19 Aug 2024 21:24:47 +0200 Subject: [PATCH 2/2] removed pluginsbak --- .../devtools/neovim/pluginsbak/barbar.nix | 10 -- .../devtools/neovim/pluginsbak/chatgpt.nix | 8 -- .../devtools/neovim/pluginsbak/comment.nix | 10 -- .../devtools/neovim/pluginsbak/conform.nix | 24 ----- .../devtools/neovim/pluginsbak/default.nix | 93 ------------------- .../devtools/neovim/pluginsbak/efm.nix | 22 ----- .../devtools/neovim/pluginsbak/floaterm.nix | 12 --- .../devtools/neovim/pluginsbak/harpoon.nix | 20 ---- .../devtools/neovim/pluginsbak/lsp.nix | 91 ------------------ .../devtools/neovim/pluginsbak/lualine.nix | 47 ---------- .../neovim/pluginsbak/markdown-preview.nix | 20 ---- .../devtools/neovim/pluginsbak/neo-tree.nix | 22 ----- .../devtools/neovim/pluginsbak/nonels.nix | 44 --------- .../devtools/neovim/pluginsbak/startify.nix | 32 ------- .../devtools/neovim/pluginsbak/tagbar.nix | 17 ---- .../devtools/neovim/pluginsbak/telescope.nix | 33 ------- .../devtools/neovim/pluginsbak/treesitter.nix | 26 ------ .../devtools/neovim/pluginsbak/vimtex.nix | 77 --------------- .../devtools/neovim/pluginsbak/yanky.nix | 5 - 19 files changed, 613 deletions(-) delete mode 100644 home/modules/devtools/neovim/pluginsbak/barbar.nix delete mode 100644 home/modules/devtools/neovim/pluginsbak/chatgpt.nix delete mode 100644 home/modules/devtools/neovim/pluginsbak/comment.nix delete mode 100644 home/modules/devtools/neovim/pluginsbak/conform.nix delete mode 100644 home/modules/devtools/neovim/pluginsbak/default.nix delete mode 100644 home/modules/devtools/neovim/pluginsbak/efm.nix delete mode 100644 home/modules/devtools/neovim/pluginsbak/floaterm.nix delete mode 100644 home/modules/devtools/neovim/pluginsbak/harpoon.nix delete mode 100644 home/modules/devtools/neovim/pluginsbak/lsp.nix delete mode 100644 home/modules/devtools/neovim/pluginsbak/lualine.nix delete mode 100644 home/modules/devtools/neovim/pluginsbak/markdown-preview.nix delete mode 100644 home/modules/devtools/neovim/pluginsbak/neo-tree.nix delete mode 100644 home/modules/devtools/neovim/pluginsbak/nonels.nix delete mode 100644 home/modules/devtools/neovim/pluginsbak/startify.nix delete mode 100644 home/modules/devtools/neovim/pluginsbak/tagbar.nix delete mode 100644 home/modules/devtools/neovim/pluginsbak/telescope.nix delete mode 100644 home/modules/devtools/neovim/pluginsbak/treesitter.nix delete mode 100644 home/modules/devtools/neovim/pluginsbak/vimtex.nix delete mode 100644 home/modules/devtools/neovim/pluginsbak/yanky.nix diff --git a/home/modules/devtools/neovim/pluginsbak/barbar.nix b/home/modules/devtools/neovim/pluginsbak/barbar.nix deleted file mode 100644 index aa95f803..00000000 --- a/home/modules/devtools/neovim/pluginsbak/barbar.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ - programs.nixvim.plugins.barbar = { - enable = true; - keymaps = { - next.key = ""; - previous.key = ""; - close.key = ""; - }; - }; -} diff --git a/home/modules/devtools/neovim/pluginsbak/chatgpt.nix b/home/modules/devtools/neovim/pluginsbak/chatgpt.nix deleted file mode 100644 index aeba72e9..00000000 --- a/home/modules/devtools/neovim/pluginsbak/chatgpt.nix +++ /dev/null @@ -1,8 +0,0 @@ -{config, ...}: { - programs.nixvim.plugins.chatgpt = { - enable = true; - settings = { - api_key_cmd = "cat ${config.sops.secrets.openai_api_key.path}"; - }; - }; -} diff --git a/home/modules/devtools/neovim/pluginsbak/comment.nix b/home/modules/devtools/neovim/pluginsbak/comment.nix deleted file mode 100644 index edf65367..00000000 --- a/home/modules/devtools/neovim/pluginsbak/comment.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ - programs.nixvim.plugins.comment = { - enable = true; - - settings = { - opleader.line = ""; - toggler.line = ""; - }; - }; -} diff --git a/home/modules/devtools/neovim/pluginsbak/conform.nix b/home/modules/devtools/neovim/pluginsbak/conform.nix deleted file mode 100644 index 98e1e6b4..00000000 --- a/home/modules/devtools/neovim/pluginsbak/conform.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ - programs.nixvim.plugins.conform-nvim = { - enable = true; - formatOnSave = { - lspFallback = true; - timeoutMs = 500; - }; - notifyOnError = true; - formattersByFt = { - liquidsoap = [ "liquidsoap-prettier" ]; - html = [ [ "prettierd" "prettier" ] ]; - css = [ [ "prettierd" "prettier" ] ]; - javascript = [ [ "prettierd" "prettier" ] ]; - javascriptreact = [ [ "prettierd" "prettier" ] ]; - typescript = [ [ "prettierd" "prettier" ] ]; - typescriptreact = [ [ "prettierd" "prettier" ] ]; - python = [ "black" ]; - lua = [ "stylua" ]; - nix = [ "alejandra" ]; - markdown = [ [ "prettierd" "prettier" ] ]; - yaml = [ "yamllint" "yamlfmt" ]; - }; - }; -} diff --git a/home/modules/devtools/neovim/pluginsbak/default.nix b/home/modules/devtools/neovim/pluginsbak/default.nix deleted file mode 100644 index db6120ef..00000000 --- a/home/modules/devtools/neovim/pluginsbak/default.nix +++ /dev/null @@ -1,93 +0,0 @@ -{ - pkgs, - config, - lib, - concatLists, - ... -}: let - inherit (lib) mkIf; - cfg = config.modules.devtools.neovim; -in { - imports = concatLists [ - mkIf - (cfg.barbar.enable or true) - [./barbar.nix] - mkIf - (cfg.chatgpt.enable or true) - [./chatgpt.nix] - mkIf - (cfg.comment.enable or true) - [./comment.nix] - mkIf - (cfg.conform.enable or true) - [./conform.nix] - mkIf - (cfg.efm.enable or true) - [./efm.nix] - mkIf - (cfg.lsp.enable or true) - [./lsp.nix] - mkIf - (cfg.lualine.enable or true) - [./lualine.nix] - mkIf - (cfg.markdown-preview.enable or true) - [./markdown-preview.nix] - mkIf - (cfg.neo-tree.enable or true) - [./neo-tree.nix] - mkIf - (cfg.nonels.enable or true) - [./nonels.nix] - mkIf - (cfg.startify.enable or true) - [./startify.nix] - mkIf - (cfg.tagbar.enable or true) - [./tagbar.nix] - mkIf - (cfg.telescope.enable or true) - [./telescope.nix] - mkIf - (cfg.treesitter.enable or true) - [./treesitter.nix] - ]; - - programs.nixvim = { - extraPlugins = [pkgs.vimPlugins.gruvbox-material]; - colorscheme = "gruvbox-material"; - - plugins = { - gitsigns = { - enable = true; - settings.signs = { - add.text = "+"; - change.text = "~"; - }; - }; - - nvim-autopairs.enable = true; - - nvim-colorizer = { - enable = true; - userDefaultOptions.names = false; - }; - - oil.enable = true; - - trim = { - enable = true; - settings = { - highlight = false; - ft_blocklist = [ - "checkhealth" - "floaterm" - "lspinfo" - "neo-tree" - "TelescopePrompt" - ]; - }; - }; - }; - }; -} diff --git a/home/modules/devtools/neovim/pluginsbak/efm.nix b/home/modules/devtools/neovim/pluginsbak/efm.nix deleted file mode 100644 index f2da424a..00000000 --- a/home/modules/devtools/neovim/pluginsbak/efm.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ - programs.nixvim.plugins = { - lsp.servers.efm = { - enable = true; - extraOptions.init_options = { - documentFormatting = true; - documentRangeFormatting = true; - hover = true; - documentSymbol = true; - codeAction = true; - completion = true; - }; - }; - - lsp-format = { - enable = true; - lspServersToEnable = ["efm"]; - }; - - efmls-configs.enable = true; - }; -} diff --git a/home/modules/devtools/neovim/pluginsbak/floaterm.nix b/home/modules/devtools/neovim/pluginsbak/floaterm.nix deleted file mode 100644 index 6ef22e65..00000000 --- a/home/modules/devtools/neovim/pluginsbak/floaterm.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ - programs.nixvim.plugins.floaterm = { - enable = true; - - width = 0.8; - height = 0.8; - - title = ""; - - keymaps.toggle = ","; - }; -} diff --git a/home/modules/devtools/neovim/pluginsbak/harpoon.nix b/home/modules/devtools/neovim/pluginsbak/harpoon.nix deleted file mode 100644 index c7ad0f3b..00000000 --- a/home/modules/devtools/neovim/pluginsbak/harpoon.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ - programs.nixvim = { - plugins.harpoon = { - enable = true; - - keymapsSilent = true; - - keymaps = { - addFile = "a"; - toggleQuickMenu = ""; - navFile = { - "1" = ""; - "2" = ""; - "3" = ""; - "4" = ""; - }; - }; - }; - }; -} diff --git a/home/modules/devtools/neovim/pluginsbak/lsp.nix b/home/modules/devtools/neovim/pluginsbak/lsp.nix deleted file mode 100644 index ab54cd52..00000000 --- a/home/modules/devtools/neovim/pluginsbak/lsp.nix +++ /dev/null @@ -1,91 +0,0 @@ -{ - config, - lib, - ... -}: let - inherit (lib) mkEnableOption mkIf; - cfg = config.modules.devtools.neovim.plugins.lsp; -in { - options = { - modules.devtools.neovim.plugins.lsp.enable = mkEnableOption "Enables LSP support for Neovim"; - - modules.devtools.neovim.plugins.lsp.servers = { - cssls.enable = mkEnableOption "Enable CSS LSP"; - tailwindcss.enable = mkEnableOption "Enable TailwindCSS LSP"; - html.enable = mkEnableOption "Enable HTML LSP"; - astro.enable = mkEnableOption "Enable AstroJS LSP"; - phpactor.enable = mkEnableOption "Enable PHP LSP"; - svelte.enable = mkEnableOption "Enable Svelte LSP"; - vuels.enable = mkEnableOption "Enable Vue LSP"; - pyright.enable = mkEnableOption "Enable Python LSP"; - marksman.enable = mkEnableOption "Enable Markdown LSP"; - nixd.enable = mkEnableOption "Enable Nix LSP"; - dockerls.enable = mkEnableOption "Enable Docker LSP"; - bashls.enable = mkEnableOption "Enable Bash LSP"; - clangd.enable = mkEnableOption "Enable C/C++ LSP"; - csharp-ls.enable = mkEnableOption "Enable C# LSP"; - yamlls.enable = mkEnableOption "Enable YAML LSP"; - lua-ls.enable = mkEnableOption "Enable Lua LSP"; - tsserver.enable = mkEnableOption "Enable TypeScript/JavaScript LSP"; - rust-analyzer.enable = mkEnableOption "Enable Rust LSP"; - }; - }; - - config = mkIf cfg.enable { - programs.nixvim = { - plugins = { - lsp = { - enable = true; - - keymaps = { - silent = true; - diagnostic = { - "k" = "goto_prev"; - "j" = "goto_next"; - }; - - lspBuf = { - gd = "definition"; - gD = "references"; - gt = "type_definition"; - gi = "implementation"; - K = "hover"; - "" = "rename"; - }; - }; - - servers = { - cssls = mkIf cfg.servers.cssls.enable {}; - tailwindcss = mkIf cfg.servers.tailwindcss.enable {}; - html = mkIf cfg.servers.html.enable {}; - astro = mkIf cfg.servers.astro.enable {}; - phpactor = mkIf cfg.servers.phpactor.enable {}; - svelte = mkIf cfg.servers.svelte.enable {}; - vuels = mkIf cfg.servers.vuels.enable {}; - pyright = mkIf cfg.servers.pyright.enable {}; - marksman = mkIf cfg.servers.marksman.enable {}; - nixd = mkIf cfg.servers.nixd.enable {}; - dockerls = mkIf cfg.servers.dockerls.enable {}; - bashls = mkIf cfg.servers.bashls.enable {}; - clangd = mkIf cfg.servers.clangd.enable {}; - csharp-ls = mkIf cfg.servers.csharp-ls.enable {}; - yamlls = mkIf cfg.servers.yamlls.enable {}; - lua-ls = mkIf cfg.servers.lua-ls.enable { - settings.telemetry.enable = false; - settings.diagnostics.globals = ["vim"]; - }; - tsserver = mkIf cfg.servers.tsserver.enable {}; - rust-analyzer = mkIf cfg.servers.rust-analyzer.enable { - installRustc = true; - installCargo = true; - settings = { - checkOnSave = true; - check.command = "clippy"; - }; - }; - }; - }; - }; - }; - }; -} diff --git a/home/modules/devtools/neovim/pluginsbak/lualine.nix b/home/modules/devtools/neovim/pluginsbak/lualine.nix deleted file mode 100644 index efed05cd..00000000 --- a/home/modules/devtools/neovim/pluginsbak/lualine.nix +++ /dev/null @@ -1,47 +0,0 @@ -{ - programs.nixvim.plugins.lualine = { - enable = true; - theme = "gruvbox-material"; - - globalstatus = true; - - # +-------------------------------------------------+ - # | A | B | C X | Y | Z | - # +-------------------------------------------------+ - sections = { - lualine_a = ["mode"]; - lualine_b = ["branch"]; - lualine_c = ["filename" "diff"]; - - lualine_x = [ - "diagnostics" - - # Show active language server - { - name.__raw = '' - function() - local msg = "" - local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype') - local clients = vim.lsp.get_active_clients() - if next(clients) == nil then - return msg - end - for _, client in ipairs(clients) do - local filetypes = client.config.filetypes - if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then - return client.name - end - end - return msg - end - ''; - icon = ""; - color.fg = "#ffffff"; - } - "encoding" - "fileformat" - "filetype" - ]; - }; - }; -} diff --git a/home/modules/devtools/neovim/pluginsbak/markdown-preview.nix b/home/modules/devtools/neovim/pluginsbak/markdown-preview.nix deleted file mode 100644 index 17b8f970..00000000 --- a/home/modules/devtools/neovim/pluginsbak/markdown-preview.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ - programs.nixvim = { - plugins.markdown-preview = { - enable = true; - - settings = { - auto_close = false; - theme = "dark"; - }; - }; - - files."after/ftplugin/markdown.lua".keymaps = [ - { - mode = "n"; - key = "m"; - action = ":MarkdownPreview"; - } - ]; - }; -} diff --git a/home/modules/devtools/neovim/pluginsbak/neo-tree.nix b/home/modules/devtools/neovim/pluginsbak/neo-tree.nix deleted file mode 100644 index 560e7f81..00000000 --- a/home/modules/devtools/neovim/pluginsbak/neo-tree.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ - programs.nixvim = { - keymaps = [ - { - mode = "n"; - key = "n"; - action = ":Neotree action=focus reveal toggle"; - options.silent = true; - } - ]; - - plugins.neo-tree = { - enable = true; - - closeIfLastWindow = true; - window = { - width = 30; - autoExpandWidth = true; - }; - }; - }; -} diff --git a/home/modules/devtools/neovim/pluginsbak/nonels.nix b/home/modules/devtools/neovim/pluginsbak/nonels.nix deleted file mode 100644 index f042bdbb..00000000 --- a/home/modules/devtools/neovim/pluginsbak/nonels.nix +++ /dev/null @@ -1,44 +0,0 @@ -{ - programs.nixvim.plugins.none-ls = { - enable = true; - settings = { - cmd = ["bash -c nvim"]; - debug = true; - }; - sources = { - code_actions = { - statix.enable = true; - gitsigns.enable = true; - }; - diagnostics = { - statix.enable = true; - deadnix.enable = true; - pylint.enable = true; - checkstyle.enable = true; - }; - formatting = { - alejandra.enable = true; - stylua.enable = true; - shfmt.enable = true; - nixpkgs_fmt.enable = true; - google_java_format.enable = false; - prettier = { - enable = true; - disableTsServerFormatter = true; - }; - black = { - enable = true; - settings = '' - { - extra_args = { "--fast" }, - } - ''; - }; - }; - completion = { - luasnip.enable = true; - spell.enable = true; - }; - }; - }; -} diff --git a/home/modules/devtools/neovim/pluginsbak/startify.nix b/home/modules/devtools/neovim/pluginsbak/startify.nix deleted file mode 100644 index 28352a14..00000000 --- a/home/modules/devtools/neovim/pluginsbak/startify.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ - programs.nixvim.plugins.startify = { - enable = true; - - settings = { - custom_header = [ - "" - " ███╗ ██╗██╗██╗ ██╗██╗ ██╗██╗███╗ ███╗" - " ████╗ ██║██║╚██╗██╔╝██║ ██║██║████╗ ████║" - " ██╔██╗ ██║██║ ╚███╔╝ ██║ ██║██║██╔████╔██║" - " ██║╚██╗██║██║ ██╔██╗ ╚██╗ ██╔╝██║██║╚██╔╝██║" - " ██║ ╚████║██║██╔╝ ██╗ ╚████╔╝ ██║██║ ╚═╝ ██║" - " ╚═╝ ╚═══╝╚═╝╚═╝ ╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═╝" - ]; - - # When opening a file or bookmark, change to its directory. - change_to_dir = false; - - # By default, the fortune header uses ASCII characters, because they work for everyone. - # If you set this option to 1 and your 'encoding' is "utf-8", Unicode box-drawing characters will - # be used instead. - use_unicode = true; - - lists = [{type = "dir";}]; - files_number = 30; - - skiplist = [ - "flake.lock" - ]; - }; - }; -} diff --git a/home/modules/devtools/neovim/pluginsbak/tagbar.nix b/home/modules/devtools/neovim/pluginsbak/tagbar.nix deleted file mode 100644 index 1478e9a7..00000000 --- a/home/modules/devtools/neovim/pluginsbak/tagbar.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ - programs.nixvim = { - plugins.tagbar = { - enable = true; - settings.width = 50; - }; - - keymaps = [ - { - mode = "n"; - key = ""; - action = ":TagbarToggle"; - options.silent = true; - } - ]; - }; -} diff --git a/home/modules/devtools/neovim/pluginsbak/telescope.nix b/home/modules/devtools/neovim/pluginsbak/telescope.nix deleted file mode 100644 index 70d05762..00000000 --- a/home/modules/devtools/neovim/pluginsbak/telescope.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ - programs.nixvim = { - plugins.telescope = { - enable = true; - - keymaps = { - # Find files using Telescope command-line sugar. - "ff" = "find_files"; - "fg" = "live_grep"; - "b" = "buffers"; - "fh" = "help_tags"; - "fd" = "diagnostics"; - - # FZF like bindings - "" = "git_files"; - "p" = "oldfiles"; - "" = "live_grep"; - }; - - settings.defaults = { - file_ignore_patterns = [ - "^.git/" - "^.mypy_cache/" - "^__pycache__/" - "^output/" - "^data/" - "%.ipynb" - ]; - set_env.COLORTERM = "truecolor"; - }; - }; - }; -} diff --git a/home/modules/devtools/neovim/pluginsbak/treesitter.nix b/home/modules/devtools/neovim/pluginsbak/treesitter.nix deleted file mode 100644 index c5e8d7ab..00000000 --- a/home/modules/devtools/neovim/pluginsbak/treesitter.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ - programs.nixvim.plugins = { - treesitter = { - enable = true; - - nixvimInjections = true; - - settings = { - highlight.enable = true; - indent.enable = true; - }; - folding = true; - }; - - treesitter-refactor = { - enable = true; - highlightDefinitions = { - enable = true; - # Set to false if you have an `updatetime` of ~100. - clearOnCursorMove = false; - }; - }; - - hmts.enable = true; - }; -} diff --git a/home/modules/devtools/neovim/pluginsbak/vimtex.nix b/home/modules/devtools/neovim/pluginsbak/vimtex.nix deleted file mode 100644 index 2cfbc803..00000000 --- a/home/modules/devtools/neovim/pluginsbak/vimtex.nix +++ /dev/null @@ -1,77 +0,0 @@ -{ - programs.nixvim = { - plugins.vimtex = { - enable = true; - - settings = { - view_method = "zathura"; - - quickfix_enabled = true; - quickfix_open_on_warning = false; - - # Ignore undesired errors and warnings - quickfix_ignore_filters = [ - "Underfull" - "Overfull" - "specifier changed to" - "Token not allowed in a PDF string" - ]; - - # TOC settings - toc_config = { - name = "TOC"; - layers = ["content" "todo"]; - resize = true; - split_width = 50; - todo_sorted = false; - show_help = true; - show_numbers = true; - mode = 2; - }; - }; - }; - - files."after/ftplugin/tex.lua".keymaps = [ - { - mode = "n"; - key = "m"; - action = ":VimtexView"; - } - ]; - - autoCmd = [ - { - event = ["BufEnter" "BufWinEnter"]; - pattern = "*.tex"; - command = "set filetype=tex \"| VimtexTocOpen"; - } - - # Folding - { - event = "FileType"; - pattern = ["tex" "latex"]; - callback.__raw = '' - function () - vim.o.foldmethod = 'expr' - vim.o.foldexpr = 'vimtex#fold#level(v:lnum)' - vim.o.foldtext = 'vimtex#fold#text()' - end - ''; - } - - # Compile on initialization - { - event = "User"; - pattern = "VimtexEventInitPost"; - callback = "vimtex#compiler#compile"; - } - - # Cleanup on exit - { - event = "User"; - pattern = "VimtexEventQuit"; - command = "call vimtex#compiler#clean(0)"; - } - ]; - }; -} diff --git a/home/modules/devtools/neovim/pluginsbak/yanky.nix b/home/modules/devtools/neovim/pluginsbak/yanky.nix deleted file mode 100644 index 31437cf2..00000000 --- a/home/modules/devtools/neovim/pluginsbak/yanky.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ - programs.nixvim.plugins.yanky = { - enable = true; - }; -}