Mutt

如何修復我的 neomuttrc 語法?

  • February 28, 2021

我已經設置了 Neomutt 並且工作得很好,但在某些時候我開始在啟動時看到一個錯誤,我想最終修復它。錯誤說:

Error in /home/amanda/.config/neomutt/neomuttrc, line 23: 
Binding '\\' will alias '\'  Before, try: 'bind pager \ noop'  https://neomutt.org/guide/configuration.html#bind-warnings
Warning in /home/amanda/.config/neomutt/neomuttrc, line 24: 
source: errors in /home/amanda/.config/neomutt/neomuttrc

我的目標是\\打開一個不多的查詢來搜尋我的整個郵件目錄,而/只是搜尋打開的列表或查詢(因此,如果我正在查看收件箱,/將打開一個提示來搜尋我的收件箱\\並將打開一個提示搜尋所有郵件。

該錯誤建議添加bind pager \ noop,但第 23 行正是如此。

設置 myneomuttrc\\打開查詢提示的正確方法是什麼?

我的完整neomuttrc文件以防我遺漏了其他東西:

source ~/.config/neomutt/pass.sh|

set smtp_url = "smtp://myself@example.com@mail.example.com:587/"
set smtp_pass = $my_pass
set ssl_force_tls = yes

set from = "myself@velociraptor.info"
set realname = "Myself"

set signature = "~/.config/neomutt/signature"
set status_format = "%n new | %M in %f [%v]."
set xterm_set_titles = yes

# notmuch
set nm_default_uri="notmuch:///home/myself/Mail" # path to the maildir
set spoolfile = ~/Mail/INBOX
set record = ~/Mail/INBOX.Sent
set postponed = ~/Mail/INBOX.Drafts
set mbox_type = Maildir
set folder = ~/Mail/

# notmuch bindings
bind pager \ noop
macro index,pager \\\\ "<vfolder-from-query>"              # looks up a hand made query
macro index A "<modify-labels>+archive -unread -inbox\\n"        # tag as Archived
macro index I "<modify-labels>-inbox -unread\\n"                 # removed from inbox
macro index S "<modify-labels-then-hide>-inbox -unread +junk\\n" # tag as Junk mail
macro index + "<modify-labels>+*\\n<sync-mailbox>"               # tag as starred
macro index - "<modify-labels>-*\\n<sync-mailbox>"               # tag as unstarred

# macro pager ` <edit-label>

# ctrl u searches for URLs
macro pager \cu |urlview\n

# Remap bounce-message function to “B”
bind index B bounce-message


# show the year via http://www.sendmail.org/~ca/email/mutt/manual-6.html#index_format
set index_format = "%4C %Z %{%b %d %Y} %-15.15L (%?l?%4l&%4c?) %s"

## Save Hooks
save-hook '~s [Rr]eceipt' =INBOX.receipts
save-hook '~s order\ confirmation' =INBOX.receipts
save-hook '~s authorized\ a\ payment' =INBOX.receipts
save-hook '~e Venmo' =INBOX.receipts
save-hook .         =INBOX.Archives.%[%Y]
## Addressing
macro pager,index a "<pipe-message>khard add-email<return>" "add the sender address to khard"

set query_command= "khard email --parsable %s"
bind editor <Tab> complete-query
bind editor ^T    complete


set mailcap_path = ~/.config/mailcap
set print_command="/home/amanda/.config/neomutt/print_unicode.sh"

Neomutt\在配置文件中使用反斜杠作為轉義字元。您需要轉義它以獲得文字反斜杠。但是您已經根據您的配置文件知道了這一點。

bind   index,pager \\     noop
bind   index,pager \\\\   vfolder-from-query

您也可以使用unbind命令而不是綁定 noop 函式。

unbind index,pager \\
bind   index,pager \\\\   vfolder-from-query

如果沒有特殊原因,我還建議使用bind而不是 a 。您只能將單個功能綁定到鍵macrobind如果您希望所有搜尋都排除某些標籤,可能會有一個方便的案例:

unbind index,pager \\
macro index,pager \\\\   "<vfolder-from-query>NOT tag:newsletters AND "

按下\將執行vfolder-from-query預填充NOT tag:newsletters AND 並停留在命令提示符中等待您添加其他搜尋查詢參數。

引用自:https://unix.stackexchange.com/questions/635461