为Mutt中同一账户切换宏设置多组快捷键的问题求助
解决Mutt中用组合键替代功能键切换账户的问题
你之前尝试用<f1>,cu这种写法行不通,因为Mutt的宏定义不支持用逗号同时绑定多个触发键,得为每个想要的触发序列单独定义宏。
正确的配置方式是把每个组合键(cu、cg、cp)分别写成独立的macro指令,同时也可以保留原来的功能键绑定(如果之后需要的话)。修改后的配置如下:
# 保留原功能键绑定(可选,不需要可以删掉) macro index,pager <f1> '<sync-mailbox><enter-command>source ~/.mutt/comptes/University<enter><change-folder>!<enter>' macro index,pager <f2> '<sync-mailbox><enter-command>source ~/.mutt/comptes/Gmail<enter><change-folder>!<enter>' macro index,pager <f3> '<sync-mailbox><enter-command>source ~/.mutt/comptes/Petur<enter><change-folder>!<enter>' # 添加组合键绑定 macro index,pager cu '<sync-mailbox><enter-command>source ~/.mutt/comptes/University<enter><change-folder>!<enter>' macro index,pager cg '<sync-mailbox><enter-command>source ~/.mutt/comptes/Gmail<enter><change-folder>!<enter>' macro index,pager cp '<sync-mailbox><enter-command>source ~/.mutt/comptes/Petur<enter><change-folder>!<enter>'
小提示:
- Mutt中定义组合键非常直接,直接连续写按键即可(比如先按
c再按u,就写cu作为触发序列),不需要额外的分隔符或特殊标记。 - 保存配置文件后,重启Mutt就能生效,之后按
c+u切换到University账户,c+g切换到Gmail,c+p切换到Petur。 - 如果完全不需要原功能键绑定,直接删掉前三条
<f1>/<f2>/<f3>的宏定义就好。
内容的提问来源于stack exchange,提问作者ppr
相关产品推荐
相关产品推荐

