aboutsummaryrefslogtreecommitdiffstats
path: root/nvim
diff options
context:
space:
mode:
authorArpit Chakladar <54011232+arpitchakladar@users.noreply.github.com>2024-09-17 22:55:39 +0530
committerArpit Chakladar <54011232+arpitchakladar@users.noreply.github.com>2024-09-17 22:55:39 +0530
commitcfb09be4801c1d41eda9113531a08e9d9e54ac62 (patch)
tree24350701f77aea9d08e94da22da178b5efe30609 /nvim
parentcbd5b66b89fba2ad23a9da7372cf916305efad1f (diff)
downloadhome-manager-config-cfb09be4801c1d41eda9113531a08e9d9e54ac62.tar.gz
home-manager-config-cfb09be4801c1d41eda9113531a08e9d9e54ac62.zip
Adding many changes.
Diffstat (limited to 'nvim')
-rw-r--r--nvim/colorscheme.nix43
-rw-r--r--nvim/default.nix60
-rw-r--r--nvim/keybindings.lua10
-rw-r--r--nvim/options.lua30
-rw-r--r--nvim/plugins/base16.nix11
-rw-r--r--nvim/plugins/lualine.lua (renamed from nvim/plugins/lualine/init.lua)5
-rw-r--r--nvim/plugins/lualine/default.nix6
-rw-r--r--nvim/plugins/lualine/theme.nix15
-rw-r--r--nvim/plugins/nvim-tree.lua6
9 files changed, 69 insertions, 117 deletions
diff --git a/nvim/colorscheme.nix b/nvim/colorscheme.nix
deleted file mode 100644
index d053324..0000000
--- a/nvim/colorscheme.nix
+++ /dev/null
@@ -1,43 +0,0 @@
-# Using the stylix to have a consistent colorscheme
-config:
-
-with config.lib.stylix.colors.withHashtag;
-''
--- Apply the color scheme
-vim.cmd("highlight clear")
-vim.cmd("syntax reset")
-
--- Set terminal colors
-vim.g.terminal_color_0 = "${base00}"
-vim.g.terminal_color_1 = "${base08}"
-vim.g.terminal_color_2 = "${base0B}"
-vim.g.terminal_color_3 = "${base0A}"
-vim.g.terminal_color_4 = "${base0D}"
-vim.g.terminal_color_5 = "${base0E}"
-vim.g.terminal_color_6 = "${base0C}"
-vim.g.terminal_color_7 = "${base05}"
-vim.g.terminal_color_8 = "${base03}"
-vim.g.terminal_color_9 = "${base08}"
-vim.g.terminal_color_10 = "${base0B}"
-vim.g.terminal_color_11 = "${base0A}"
-vim.g.terminal_color_12 = "${base0D}"
-vim.g.terminal_color_13 = "${base0E}"
-vim.g.terminal_color_14 = "${base0C}"
-vim.g.terminal_color_15 = "${base07}"
-
--- Set highlight groups
-vim.api.nvim_set_hl(0, "Normal", { fg = "${base05}", bg = "${base00}" })
-vim.api.nvim_set_hl(0, "Comment", { fg = "${base03}", bg = "${base00}", italic = true })
-vim.api.nvim_set_hl(0, "Constant", { fg = "${base09}" })
-vim.api.nvim_set_hl(0, "String", { fg = "${base0B}" })
-vim.api.nvim_set_hl(0, "Identifier", { fg = "${base08}" })
-vim.api.nvim_set_hl(0, "Function", { fg = "${base0D}" })
-vim.api.nvim_set_hl(0, "Statement", { fg = "${base0E}" })
-vim.api.nvim_set_hl(0, "Keyword", { fg = "${base0E}" })
-vim.api.nvim_set_hl(0, "Type", { fg = "${base0A}" })
-vim.api.nvim_set_hl(0, "Special", { fg = "${base0C}" })
-vim.api.nvim_set_hl(0, "PreProc", { fg = "${base0A}" })
-vim.api.nvim_set_hl(0, "Underlined", { fg = "${base0B}", underline = true })
-vim.api.nvim_set_hl(0, "Error", { fg = "${base08}", bg = "${base00}", bold = true })
-vim.api.nvim_set_hl(0, "Todo", { fg = "${base0A}", bg = "${base00}", bold = true })
-''
diff --git a/nvim/default.nix b/nvim/default.nix
index f2589ae..bf5b050 100644
--- a/nvim/default.nix
+++ b/nvim/default.nix
@@ -1,37 +1,43 @@
{ pkgs, config, ... }:
{
- programs.neovim =
- let
- toLua = str: "lua << EOF\n${str}\nEOF\n";
- toLuaFile = file: "lua << EOF\n${builtins.readFile file}\nEOF\n";
- in {
- enable = true;
- viAlias = true;
- vimAlias = true;
- vimdiffAlias = true;
+ programs.neovim.enable = true;
+ programs.neovim.viAlias = true;
+ programs.neovim.vimAlias = true;
+ programs.neovim.vimdiffAlias = true;
- extraLuaConfig = ''
-${import ./colorscheme.nix config}
+ programs.neovim.extraLuaConfig =
+''
${builtins.readFile ./options.lua}
${builtins.readFile ./keybindings.lua}
'';
- plugins = with pkgs.vimPlugins; [
- {
- plugin = comment-nvim;
- config = toLuaFile ./plugins/comment.lua;
- }
- {
- plugin = lualine-nvim;
- config = toLua (import ./plugins/lualine/default.nix config);
- }
+ programs.neovim.plugins =
+ with pkgs.vimPlugins;
+ let
+ toLua = str: "lua << EOF\n${str}\nEOF\n";
+ toLuaFile = file: "lua << EOF\n${builtins.readFile file}\nEOF\n";
+ in [
+ {
+ plugin = comment-nvim;
+ config = toLuaFile ./plugins/comment.lua;
+ }
+
+ {
+ plugin = lualine-nvim;
+ config = toLuaFile ./plugins/lualine.lua;
+ }
+
+ {
+ plugin = base16-nvim;
+ config = toLua (import ./plugins/base16.nix config);
+ }
+
+ nvim-web-devicons
- nvim-web-devicons
- {
- plugin = nvim-tree-lua;
- config = toLuaFile ./plugins/nvim-tree.lua;
- }
- ];
- };
+ {
+ plugin = nvim-tree-lua;
+ config = toLuaFile ./plugins/nvim-tree.lua;
+ }
+ ];
}
diff --git a/nvim/keybindings.lua b/nvim/keybindings.lua
index d952736..3e8e0fa 100644
--- a/nvim/keybindings.lua
+++ b/nvim/keybindings.lua
@@ -1,8 +1,8 @@
-- Navigate splits
-vim.keymap.set("n", "<C-h>", ":wincmd h<CR>", { silent = true })
-vim.keymap.set("n", "<C-j>", ":wincmd j<CR>", { silent = true })
-vim.keymap.set("n", "<C-k>", ":wincmd k<CR>", { silent = true })
-vim.keymap.set("n", "<C-l>", ":wincmd l<CR>", { silent = true })
+vim.keymap.set("n", "<C-h>", ":wincmd h<CR>", { silent = true });
+vim.keymap.set("n", "<C-j>", ":wincmd j<CR>", { silent = true });
+vim.keymap.set("n", "<C-k>", ":wincmd k<CR>", { silent = true });
+vim.keymap.set("n", "<C-l>", ":wincmd l<CR>", { silent = true });
-- NvimTree
-vim.keymap.set("n", "<C-n>", ":NvimTreeToggle<CR>", { silent = true })
+vim.keymap.set("n", "<C-n>", ":NvimTreeToggle<CR>", { silent = true });
diff --git a/nvim/options.lua b/nvim/options.lua
index 2897a69..5efd8d5 100644
--- a/nvim/options.lua
+++ b/nvim/options.lua
@@ -1,23 +1,23 @@
-vim.g.mapleader = " "
-vim.g.maplocalleader = " "
+vim.g.mapleader = " ";
+vim.g.maplocalleader = " ";
-vim.o.clipboard = "unnamedplus"
+vim.o.clipboard = "unnamedplus";
-vim.o.number = true
-vim.o.list = true
-vim.o.listchars = "tab:| ,trail:_,lead:_"
+vim.o.number = true;
+vim.o.list = true;
+vim.o.listchars = "tab:| ,trail:_,lead:_";
-vim.o.laststatus = 3
-vim.opt.fillchars = { eob = " " }
+vim.o.laststatus = 3;
+vim.opt.fillchars = { eob = " " };
-vim.o.signcolumn = "auto"
+vim.o.signcolumn = "auto";
-vim.o.tabstop = 2
-vim.o.shiftwidth = 2
-vim.o.expandtab = false
+vim.o.tabstop = 2;
+vim.o.shiftwidth = 2;
+vim.o.expandtab = false;
-vim.o.updatetime = 300
+vim.o.updatetime = 300;
-vim.o.termguicolors = true
+vim.o.termguicolors = true;
-vim.o.mouse = "a"
+vim.o.mouse = "a";
diff --git a/nvim/plugins/base16.nix b/nvim/plugins/base16.nix
new file mode 100644
index 0000000..170b68b
--- /dev/null
+++ b/nvim/plugins/base16.nix
@@ -0,0 +1,11 @@
+config:
+
+with config.lib.stylix.colors.withHashtag;
+''
+require("base16-colorscheme").setup {
+ 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/nvim/plugins/lualine/init.lua b/nvim/plugins/lualine.lua
index 36acda4..ba2eda6 100644
--- a/nvim/plugins/lualine/init.lua
+++ b/nvim/plugins/lualine.lua
@@ -1,6 +1,5 @@
require("lualine").setup {
options = {
globalstatus = true,
- theme = theme
- }
-}
+ },
+};
diff --git a/nvim/plugins/lualine/default.nix b/nvim/plugins/lualine/default.nix
deleted file mode 100644
index b6be39e..0000000
--- a/nvim/plugins/lualine/default.nix
+++ /dev/null
@@ -1,6 +0,0 @@
-config:
-
-''
-${import ./theme.nix config}
-${builtins.readFile ./init.lua}
-''
diff --git a/nvim/plugins/lualine/theme.nix b/nvim/plugins/lualine/theme.nix
deleted file mode 100644
index 26c420e..0000000
--- a/nvim/plugins/lualine/theme.nix
+++ /dev/null
@@ -1,15 +0,0 @@
-config:
-
-with config.lib.stylix.colors.withHashtag;
-''
-local theme = {
- normal = {
- a = { fg = "${base07}", bg = "${base0D}", gui = "bold" },
- b = { fg = "${base05}", bg = "${base01}" },
- c = { fg = "${base03}", bg = "${base00}" },
- },
- insert = { a = { fg = "${base07}", bg = "${base0B}", gui = "bold" } },
- visual = { a = { fg = "${base07}", bg = "${base0C}", gui = "bold" } },
- replace = { a = { fg = "${base07}", bg = "${base08}", gui = "bold" } },
- command = { a = { fg = "${base07}", bg = "${base0A}", gui = "bold" } },
-}''
diff --git a/nvim/plugins/nvim-tree.lua b/nvim/plugins/nvim-tree.lua
index 1aa2e6e..c6c4102 100644
--- a/nvim/plugins/nvim-tree.lua
+++ b/nvim/plugins/nvim-tree.lua
@@ -8,6 +8,6 @@ require("nvim-tree").setup {
},
root_folder_label = function(path)
return vim.fn.fnamemodify(path, ":t")
- end
- }
-}
+ end,
+ },
+};