{lib, pkgs, ...}: { enable = true; viAlias = true; vimAlias = true; colorschemes.dracula.enable = true; globals.mapleader = " "; opts = { updatetime = 100; # Faster completion number = true; relativenumber = true; autoindent = true; clipboard = "unnamedplus"; expandtab = true; shiftwidth = 2; smartindent = true; tabstop = 2; ignorecase = true; incsearch = true; smartcase = true; wildmode = "list:longest"; swapfile = false; undofile = true; # Build-in persistent undo termguicolors = lib.mkForce pkgs.stdenv.isLinux; }; keymaps = [ # Global # Default mode is "" which means normal-visual-op { key = "x"; action = "NvimTreeToggle"; options.desc = "Toggle NvimTree"; } { key = "p"; action = "PasteImg"; options.desc = "Pastes an Image from the clipboard"; } # File #{ # mode = "n"; # key = "sf"; # action = "+find/file"; #} { # Format file key = "fm"; action = "lua vim.lsp.buf.format()"; options.desc = "Format the current buffer"; } # Git { mode = "n"; key = "g"; action = "+git"; } { mode = "n"; key = "gt"; action = "+toggles"; } { key = "gtb"; action = "Gitsigns toggle_current_line_blame"; options.desc = "Gitsigns current line blame"; } { key = "gtd"; action = "Gitsigns toggle_deleted"; options.desc = "Gitsigns deleted"; } { key = "gd"; action = "Gitsigns diffthis"; options.desc = "Gitsigns diff this buffer"; } { mode = "n"; key = "gr"; action = "+resets"; } { key = "grh"; action = "Gitsigns reset_hunk"; options.desc = "Gitsigns reset hunk"; } { key = "grb"; action = "Gitsigns reset_buffer"; options.desc = "Gitsigns reset current buffer"; } # Tabs { mode = "n"; key = "tn"; action = "tabnew"; options.desc = "Create new tab"; } { mode = "n"; key = "td"; action = "tabclose"; options.desc = "Close tab"; } { mode = "n"; key = "tt"; action = "tabnext"; options.desc = "Go to the sub-sequent tab"; } { mode = "n"; key = "tp"; action = "tabprevious"; options.desc = "Go to the previous tab"; } # Terminal { # Escape terminal mode using ESC mode = "t"; key = ""; action = ""; options.desc = "Escape terminal mode"; } # Trouble { key = "dt"; action = "TroubleToggle"; options.desc = "Toggle trouble"; } # Rust { # Start standalone rust-analyzer (fixes issues when opening files from nvim tree) mode = "n"; key = "rs"; action = "RustStartStandaloneServerForBuffer"; options.desc = "Start standalone rust-analyzer"; } # refactoring { mode = "n"; key = "re"; action = ":Refactor extract_var "; options.desc = "Extract to variable"; } { mode = "n"; key = "rE"; action = ":Refactor extract "; options.desc = "Extract to function"; } { mode = "n"; key = "rb"; action = ":Refactor extract_block "; options.desc = "Extract to block"; } { mode = "n"; key = "ri"; action = ":Refactor inline_var "; options.desc = "Inline variable"; } { mode = "n"; key = "rI"; action = ":Refactor inline_func "; options.desc = "Inline function"; } ]; }