恢复所有mutt自定义配置 [英] Revert all mutt custom config
本文介绍了恢复所有mutt自定义配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图在Mutt中使用两个非常不同的设置来设置两个(也许更多)邮箱. 我每个都有设置文件夹的钩子,但是自定义设置并不完全相同.
I am trying to setup a two (maybe more) mailboxes in mutt with very different settings. I have setup folder-hooks for each but it custom settings are not fully the same.
我想知道如何在应用另一个邮箱的设置之前重设一个邮箱的所有自定义设置.
I wonder how to reset all custom settings setup for one mailbox before applying settings from the other.
设置为:
.muttrc:
some custom config...
mre custom config...
folder-hook home source .mutt/home.config
folder-hook work source .mutt/work.config
当我应用work.config时,我想通过home.config重置所有配置设置(但是请保留.muttrc的常规配置设置,以使reset all
太多).
I'd like to reset all configs setup by home.config when I apply work.config (but keep general config setup by .muttrc so reset all
is too much).
推荐答案
自己的答案:
创建脚本reset.sh
,例如:
grep -E -h -v '^(#.*)?$' $@ | sed -E 's/(.*)=.*/\1/; s/^(un)?set/reset/g; /macro/d'
并如Adam所建议的那样,在主配置文件中:
and as Adam suggested, in the main conf:
set my_reset_source=`~/.mutt/reset.sh ~/.mutt/*.config > /tmp/mutt-reset`
folder-hook . source /tmp/mutt-reset
folder-hook home source ~/.mutt/home.config
folder-hook work source ~/.mutt/work.config
这篇关于恢复所有mutt自定义配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文