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 { mode = [ "n" "x" ]; key = "j"; action = "v:count == 0 ? 'gj' : 'j'"; options = { desc = "Move cursor down"; expr = true; silent = true; }; } { mode = [ "n" "x" ]; key = "k"; action = "v:count == 0 ? 'gk' : 'k'"; options = { desc = "Move cursor up"; expr = true; silent = true; }; } { mode = "n"; key = "w"; action = "w"; options.desc = "Save"; } { mode = "n"; key = "q"; action = "confirm q"; options.desc = "Quit window"; } { mode = "n"; key = "Q"; action = "confirm qall"; options.desc = "Exit neovim"; } { mode = "n"; key = "n"; action = "enew"; options.desc = "New file"; } { inherit (forceWrite) action options; mode = "n"; key = ""; } { inherit (forceWrite) options; mode = [ "i" "x" ]; key = ""; action = "" + forceWrite.action; } { mode = "n"; key = ""; action = "q!"; options.desc = "Force quit"; } { mode = "n"; key = "|"; action = "vsplit"; options.desc = "Vertical split"; } { mode = "n"; key = "\\"; action = "split"; options.desc = "Horizontal split"; } { mode = "n"; 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 { mode = "v"; key = ""; action = "