From b5032dcb8b51720a7b735fac0cef6c39554690c9 Mon Sep 17 00:00:00 2001 From: xqtc161 Date: Mon, 29 Jan 2024 11:04:52 +0100 Subject: [PATCH] Further nixvim configuration --- home/lambda/config-files/nvim/keybinds.lua | 12 +++ home/lambda/default.nix | 95 ++++++++++++++++++---- overlays/nixvim.nix | 3 - 3 files changed, 89 insertions(+), 21 deletions(-) create mode 100644 home/lambda/config-files/nvim/keybinds.lua delete mode 100644 overlays/nixvim.nix diff --git a/home/lambda/config-files/nvim/keybinds.lua b/home/lambda/config-files/nvim/keybinds.lua new file mode 100644 index 0000000..2d81ce8 --- /dev/null +++ b/home/lambda/config-files/nvim/keybinds.lua @@ -0,0 +1,12 @@ +-- Switch between splits +vim.keymap.set("n", "", "l") +vim.keymap.set("n", "", "h") +vim.keymap.set("n", "", "k") +vim.keymap.set("n", "", "j") + +-- Escape for exiting terminal mode +vim.keymap.set('t', '', '') + +-- move selection linewise +vim.keymap.set('v', 'J', ":m '>+1gv=gv") +vim.keymap.set('v', 'K', ":m '<-2gv=gv") diff --git a/home/lambda/default.nix b/home/lambda/default.nix index 50adc7d..9425a82 100644 --- a/home/lambda/default.nix +++ b/home/lambda/default.nix @@ -43,25 +43,84 @@ }; programs.nixvim = { - enable = true; - colorschemes.catppuccin.enable = true; - plugins = { - lsp = { - enable = true; - servers = { - rust-analyzer = { - enable = true; - installLanguageServer = false; - }; - nil_ls.enable = true; - }; - }; - gitsigns.enable = true; - treesitter.enable = true; - nvim-cmp.enable = true; - telescope.enable = true; - cmp-nvim-lsp.enable = true; + enable = true; + globals.mapleader = " "; + extraConfigLua = builtins.readFile ./config-files/nvim/keybinds.lua; + + options = { + number = true; # Show line numbers + relativenumber = true; # Show relative line numbers + + shiftwidth = 2; # Tab width should be 2 + }; + + colorschemes.catppuccin.enable = true; + plugins = { + lsp = { + enable = true; + servers = { + rust-analyzer = { + enable = true; + installLanguageServer = false; + installCargo = false; + installRustc = false; + }; + nil_ls.enable = true; + }; }; + gitsigns.enable = true; + fugitive.enable = true; + treesitter.enable = true; + nvim-cmp.enable = true; + telescope.enable = true; + cmp-nvim-lsp.enable = true; + noice.enable = true; + neo-tree.enable = true; + presence-nvim.enable = true; + crates-nvim.enable = true; + alpha = { + enable = true; + }; + bufferline.enable = true; + }; + keymaps = [ + { + mode = "n"; + key = "ff"; + options.silent = true; + action = "Telescope find_files"; + } + { + mode = "n"; + key = "Gp"; + action = "Git pull"; + } + { + mode = "n"; + key = "GP"; + action = "Git push"; + } + { + mode = "n"; + key = "Gc"; + action = "Git commit"; + } + { + mode = "n"; + key = "Ga"; + action = "Git add ."; + } + { + mode = "n"; + key = "Gd"; + action = "Git diff"; + } + { + mode = "n"; + key = "nt"; + action = "Neotree toggle left"; + } + ]; }; #wayland.windowManager.hyprland = { # enable = true; diff --git a/overlays/nixvim.nix b/overlays/nixvim.nix deleted file mode 100644 index 97a9cda..0000000 --- a/overlays/nixvim.nix +++ /dev/null @@ -1,3 +0,0 @@ -self: super: { - nixneovim.overlays.default; -}