{ lib, pkgs, ... }: { enable = true; viAlias = true; vimAlias = true; colorschemes.dracula.enable = true; globals.mapleader = " "; opts = { updatetime = 100; # Faster completion number = true; relativenumber = true; showmode = false; #already shown in lightline 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; }; plugins.mini-align.enable = true; keymaps = [ # Global # Default mode is "" which means normal-visual-op { key = "x"; action = "NvimTreeToggle"; options.desc = "Toggle NvimTree"; } #{ # key = "x"; # action = "Neotree toggle"; # options.desc = "Toggle Neotree"; #} { 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"; } { key = "gg"; action = "LazyGit"; options.desc = "Open LazyGit"; } { 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"; } # === Neogit === #{ # key = "gc"; # action = "NvimTreeCloseNeogit"; # options.desc = "Commit changes"; #} #{ # key = "gd"; # action = "NvimTreeCloseDiffviewOpen"; # options.desc = "View git changes"; #} #{ # key = "gq"; # action = "DiffviewCloseNvimTreeOpen"; # options.desc = "Close git changes"; #} # === End Neogit === { 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 (barbar) { mode = "n"; key = "tn"; action = "tabnew"; options.desc = "Create new tab"; } { mode = "n"; key = "td"; action = "BufferClose"; options.desc = "Close tab"; } { mode = "n"; key = "tt"; action = "BufferNext"; options.desc = "Go to the sub-sequent tab"; } { mode = "n"; key = "tp"; action = "BufferPrevious"; 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"; } # hop { key = "f"; action.__raw = '' function() require'hop'.hint_char1({ --direction = require'hop.hint'.HintDirection.AFTER_CURSOR, current_line_only = false, case_insensitive = true, }) end ''; options.remap = true; } { key = "F"; action.__raw = '' function() require'hop'.hint_char1({ direction = require'hop.hint'.HintDirection.BEFORE_CURSOR, current_line_only = false }) end ''; options.remap = true; } ]; }