let forceWrite = { action = "silent! update! | redraw"; options.desc = "Force write"; }; in [ # Standard operations # https://github.com/AstroNvim/AstroNvim/blob/v4.7.7/lua/astronvim/plugins/_astrocore_mappings.lua#L27-L44 { key = "j"; mode = [ "n" "x" ]; action = "v:count == 0 ? 'gj' : 'j'"; options = { desc = "Move cursor down"; expr = true; silent = true; }; } { key = "k"; mode = [ "n" "x" ]; action = "v:count == 0 ? 'gk' : 'k'"; options = { desc = "Move cursor up"; expr = true; silent = true; }; } { key = "w"; action = "w"; options.desc = "Save"; } { key = "q"; action = "confirm q"; options.desc = "Quit window"; } { key = "Q"; action = "confirm qall"; options.desc = "Exit neovim"; } { key = "n"; action = "enew"; options.desc = "New file"; } { inherit (forceWrite) action options; key = ""; } { inherit (forceWrite) options; key = ""; mode = [ "i" "x" ]; action = "" + forceWrite.action; } { key = ""; action = "q!"; options.desc = "Force quit"; } { key = "|"; action = "vsplit"; options.desc = "Vertical split"; } { key = "\\"; action = "split"; options.desc = "Horizontal split"; } { key = "gx"; action.__raw = "require('astrocore').system_open"; options.desc = "Open the file under cursor with system app"; } # Stay in indent mode # https://github.com/AstroNvim/AstroNvim/blob/v4.7.7/lua/astronvim/plugins/_astrocore_mappings.lua#L117-L118 { key = ""; mode = [ "v" ]; action = "