From 54142dba0991ecbe3031ef532d0a379ee3c58871 Mon Sep 17 00:00:00 2001 From: Arpit Chakladar <54011232+arpitchakladar@users.noreply.github.com> Date: Wed, 10 Dec 2025 22:42:35 +0530 Subject: Separated nixvim config into modules --- modules/tools/nixvim/colorscheme.nix | 27 +++++++ modules/tools/nixvim/default.nix | 152 +---------------------------------- modules/tools/nixvim/keymaps.nix | 17 ++++ modules/tools/nixvim/plugins.nix | 122 ++++++++++++++++++++++++++++ 4 files changed, 170 insertions(+), 148 deletions(-) create mode 100644 modules/tools/nixvim/colorscheme.nix create mode 100644 modules/tools/nixvim/keymaps.nix create mode 100644 modules/tools/nixvim/plugins.nix (limited to 'modules/tools/nixvim') diff --git a/modules/tools/nixvim/colorscheme.nix b/modules/tools/nixvim/colorscheme.nix new file mode 100644 index 0000000..810111a --- /dev/null +++ b/modules/tools/nixvim/colorscheme.nix @@ -0,0 +1,27 @@ +{ pkgs, config, lib, ... }: + +{ + config = lib.mkIf config.tools.nixvim.enable { + programs.nixvim.colorschemes.base16 = { + enable = true; + colorscheme = with config.scheme.withHashtag; { + base00 = base00; + base01 = base01; + base02 = base02; + base03 = base03; + base04 = base04; + base05 = base05; + base06 = base06; + base07 = base07; + base08 = base08; + base09 = base09; + base0A = base0A; + base0B = base0B; + base0C = base0C; + base0D = base0D; + base0E = base0E; + base0F = base0F; + }; + }; + }; +} diff --git a/modules/tools/nixvim/default.nix b/modules/tools/nixvim/default.nix index bff6220..1188526 100644 --- a/modules/tools/nixvim/default.nix +++ b/modules/tools/nixvim/default.nix @@ -7,6 +7,9 @@ let in { imports = [ nixvim.homeModules.nixvim + ./colorscheme.nix + ./keymaps.nix + ./plugins.nix ]; options.tools.nixvim = { @@ -17,38 +20,6 @@ in { { programs.nixvim = { enable = true; - keymaps = [ - { key = ""; action = "h"; } - { key = ""; action = "j"; } - { key = ""; action = "k"; } - { key = ""; action = "l"; } - { - key = ""; - action = "NvimTreeToggle"; - mode = [ "n" "i" ]; - } - ]; - colorschemes.base16 = { - enable = true; - colorscheme = with config.scheme.withHashtag; { - base00 = base00; - base01 = base01; - base02 = base02; - base03 = base03; - base04 = base04; - base05 = base05; - base06 = base06; - base07 = base07; - base08 = base08; - base09 = base09; - base0A = base0A; - base0B = base0B; - base0C = base0C; - base0D = base0D; - base0E = base0E; - base0F = base0F; - }; - }; opts = { number = true; relativenumber = true; @@ -68,122 +39,7 @@ in { bg = "${base00}", }) ''; - plugins = { - comment = { - enable = true; - }; - lualine = { - enable = true; - settings = { - options = { - theme = with config.scheme.withHashtag; { - normal = { - a = { fg = base00; bg = base0D; gui = "bold"; }; - b = { fg = base05; bg = base01; }; - c = { fg = base05; bg = base00; }; - }; - insert = { - a = { fg = base00; bg = base0B; gui = "bold"; }; - b = { fg = base05; bg = base01; }; - c = { fg = base05; bg = base00; }; - }; - visual = { - a = { fg = base00; bg = base0A; gui = "bold"; }; - b = { fg = base05; bg = base01; }; - c = { fg = base05; bg = base00; }; - }; - replace = { - a = { fg = base00; bg = base08; gui = "bold"; }; - b = { fg = base05; bg = base01; }; - c = { fg = base05; bg = base00; }; - }; - inactive = { - a = { fg = base04; bg = base00; gui = "bold"; }; - b = { fg = base04; bg = base00; }; - c = { fg = base04; bg = base00; }; - }; - }; - icons_enabled = true; - }; - }; - }; - noice = { - enable = true; - cmdline = { - enabled = true; - view = "cmdline_popup"; - }; - popupmenu = { - enabled = true; - backend = "cmp"; - }; - presets = { - command_palette = true; - }; - }; - nvim-tree = { - enable = true; - settings = { - filters = { - dotfiles = false; - git_clean = false; - no_buffer = false; - custom = {}; - }; - git = { - enable = true; - ignore = false; - }; - view = { - width = { - padding = 0; - }; - }; - renderer = { - indent_markers = { - enable = true; - inline_arrows = false; - icons = { - corner = "└"; - edge = "│"; - item = "├"; - bottom = "─"; - none = " "; - }; - }; - icons = { - show = { - folder = true; - folder_arrow = false; - file = true; - git = true; - }; - }; - }; - }; - }; - treesitter = { - enable = true; - settings = { - highlight = { enable = true; }; - indent = { enable = true; }; - }; - }; - web-devicons = { - enable = true; - }; - which-key = { - enable = true; - settings = { - plugins = { - marks = true; - registers = true; - spelling = { enabled = true; suggestions = 20; }; - }; - window = { border = "single"; }; - }; - }; - }; + performance.byteCompileLua.enable = true; }; }; } diff --git a/modules/tools/nixvim/keymaps.nix b/modules/tools/nixvim/keymaps.nix new file mode 100644 index 0000000..c6990b6 --- /dev/null +++ b/modules/tools/nixvim/keymaps.nix @@ -0,0 +1,17 @@ +{ pkgs, config, lib, ... }: + +{ + config = lib.mkIf config.tools.nixvim.enable { + programs.nixvim.keymaps = [ + { key = ""; action = "h"; } + { key = ""; action = "j"; } + { key = ""; action = "k"; } + { key = ""; action = "l"; } + { + key = ""; + action = "NvimTreeToggle"; + mode = [ "n" "i" ]; + } + ]; + }; +} diff --git a/modules/tools/nixvim/plugins.nix b/modules/tools/nixvim/plugins.nix new file mode 100644 index 0000000..9af84fb --- /dev/null +++ b/modules/tools/nixvim/plugins.nix @@ -0,0 +1,122 @@ +{ pkgs, config, lib, ... }: + +{ + config = lib.mkIf config.tools.nixvim.enable { + programs.nixvim.plugins = { + comment = { + enable = true; + }; + lualine = { + enable = true; + settings = { + options = { + theme = with config.scheme.withHashtag; { + normal = { + a = { fg = base00; bg = base0D; gui = "bold"; }; + b = { fg = base05; bg = base01; }; + c = { fg = base05; bg = base00; }; + }; + insert = { + a = { fg = base00; bg = base0B; gui = "bold"; }; + b = { fg = base05; bg = base01; }; + c = { fg = base05; bg = base00; }; + }; + visual = { + a = { fg = base00; bg = base0A; gui = "bold"; }; + b = { fg = base05; bg = base01; }; + c = { fg = base05; bg = base00; }; + }; + replace = { + a = { fg = base00; bg = base08; gui = "bold"; }; + b = { fg = base05; bg = base01; }; + c = { fg = base05; bg = base00; }; + }; + inactive = { + a = { fg = base04; bg = base00; gui = "bold"; }; + b = { fg = base04; bg = base00; }; + c = { fg = base04; bg = base00; }; + }; + }; + icons_enabled = true; + }; + }; + }; + noice = { + enable = true; + cmdline = { + enabled = true; + view = "cmdline_popup"; + }; + popupmenu = { + enabled = true; + backend = "cmp"; + }; + presets = { + command_palette = true; + }; + }; + nvim-tree = { + enable = true; + settings = { + filters = { + dotfiles = false; + git_clean = false; + no_buffer = false; + custom = {}; + }; + git = { + enable = true; + ignore = false; + }; + view = { + width = { + padding = 0; + }; + }; + renderer = { + indent_markers = { + enable = true; + inline_arrows = false; + icons = { + corner = "└"; + edge = "│"; + item = "├"; + bottom = "─"; + none = " "; + }; + }; + icons = { + show = { + folder = true; + folder_arrow = false; + file = true; + git = true; + }; + }; + }; + }; + }; + treesitter = { + enable = true; + settings = { + highlight = { enable = true; }; + indent = { enable = true; }; + }; + }; + web-devicons = { + enable = true; + }; + which-key = { + enable = true; + settings = { + plugins = { + marks = true; + registers = true; + spelling = { enabled = true; suggestions = 20; }; + }; + win = { border = "single"; }; + }; + }; + }; + }; +} -- cgit v1.2.3