# Macros - neomutt macros for sync, URL extraction, flag legend, and quit { config, lib, ... }: { config.programs.neomutt.macros = lib.mkIf config.communication.neomutt.enable [ { map = [ "index" "pager" ]; key = "O"; action = "set my_wait_key=$wait_key wait_key=no${lib.getExe config.scripts.neomutt-sync.package}set wait_key=$my_wait_key"; } { # gx: extract links from the current message and open one, vim-netrw style map = [ "index" "pager" ]; key = "gx"; action = "urlscan"; } { map = [ "index" "pager" ]; key = "gl"; action = "less ~/.config/neomutt/flag_legend.txt"; } { # gF: clear the current limit/filter and show every message again, # the counterpart to gf (interactive limit prompt) in binds.nix map = [ "index" ]; key = "gF"; action = "~A"; } { # ZZ: save and quit, vim-style (sync mailbox, then quit) map = [ "index" ]; key = "ZZ"; action = ""; } { # ZQ: quit without saving, vim-style counterpart to ZZ map = [ "index" ]; key = "ZQ"; action = ""; } ]; }