├── .gitignore ├── LICENSE ├── README.md ├── aerc.conf ├── aerc.sh ├── binds.conf └── mf.sh /.gitignore: -------------------------------------------------------------------------------- 1 | accounts.conf 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Riedel 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Aerc-vim: Vim-Like Keybindings for Aerc 2 | 3 | ## Introduction 4 | 5 | Welcome to my little repository where I try to enhance the [Aerc](https://aerc-mail.org/) email client experience with intuitive Vim-like keybindings! Aerc is an exceptional terminal-based email client known for its efficiency and simplicity. However, I think the developers missed an opportunity in its default setup – the lack of Vim-standard keybindings, which are beloved by many for their speed and convenience. 6 | 7 | ## Quick Start & Concept 8 | 9 | Jeder der sich mit vim auskennt, weiß, wie effizient die Tastaturkürzel zur Bearbeitung von Texten sind. Meine Idee für Aerc-vim ist nicht nur möglichst viele Tastaturkürzel aus vim auf Aerc zu übertragen, sondern Aerc wie den Textbuffer von vim zu behandeln. Das bedeutet, dass nicht nur Emails mit vim geschrieben werden, sondern das auch das navigieren, finden, löschen, verschieben, markieren usw. von Emails mit vim-Kürzeln möglich ist. 10 | 11 | Dazu ist es nötig, ein klein wenig umzudenken. Ähnlich wie bei [oil](https://github.com/stevearc/oil.nvim) "You want to be able to edit your filesystem like a buffer" oder [mini.files](https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-files.md) "Manipulate files and directories by editing text buffers: create, delete, copy, rename, move.", in denen das Dateisytem als Textbuffer dargestellt wird, wird in Aerc-vim das Email-Postfach als Textbuffer dargestellt. 12 | 13 | 14 | 15 | Ein paar Beispiele: 16 | 17 | - **o** steht in Vim für "open a new line below the cursor and start insert mode". In Aerc-vim wird damit eine neue Email erstellt. Warum? Weil ich auf einen Textbuffer – jede Zeile eine Email – schaue und eine neue Email schreiben will. Ich will also eine neue ~Zeile~ Email unterhalb der aktuellen ~Zeile~ Email öffnen und mit dem Schreiben beginnen. In Aerc ist das "o" für "open a new email" und nicht für "open a new line". Eine neue Email in Aerc wäre normalerweise "n" für "new email". Siehe [Aerc Default Keybindings](https://git.sr.ht/~rjarry/aerc/tree/master/item/config/binds.conf) 18 | - **dd** steht in Vim für "delete the current line". In Aerc-vim wird damit die markierte(n) Email(s) gelöscht. Warum? Weil ich auf einen Textbuffer voller ~Zeilen~ Emails schaue und eine ~Zeile~ Email löschen will. 19 | - 20 | 21 | ## Current Status 22 | 23 | Please note, this project is a work in progress. I am constantly refining and improving the keybindings to ensure they feel natural and intuitive for both Vim veterans and newcomers. 24 | 25 | ## Community Contributions 26 | 27 | Your input is invaluable! We strongly encourage you to report any bugs you encounter and suggest improvements or new keybindings. Your contributions will help make this project even better. 28 | 29 | ## Getting Involved 30 | 31 | - Issue Reporting: Encountered a bug? Let us know by opening an issue. Please provide as much detail as possible to help us understand and address the problem quickly. 32 | - Suggestions: Have ideas for more efficient keybindings or general improvements? We'd love to hear from you! Feel free to open an issue or submit a pull request with your suggestions. 33 | - Contribution: Check out our Contribution Guidelines for more details on how you can contribute to this project. 34 | 35 | ## About aerc-vim 36 | 37 | Aerc-vim is dedicated to bridging that gap by introducing a set of Vim-like keybindings to Aerc. My aim is to make Aerc not only more accessible to Vim users but also to enhance the overall user experience by leveraging the efficiency of Vim's keyboard-driven commands. 38 | 39 | ### How to Use and inspiation 40 | - [Email in the terminal: a complete guide to the unix way of email](https://bence.ferdinandy.com/2023/07/20/email-in-the-terminal-a-complete-guide-to-the-unix-way-of-email/) 41 | - [Aerc and Why Text-Only Email Clients Are the Future](https://retrocode.uk/posts/aerc-fast-linux-email-client/) 42 | - [My email setup with Aerc and Git](https://www.acarg.ch/posts/aerc-email-setup/) 43 | - [Aerc, mbsync, and postfix for maximum comfy offline email"](https://drewdevault.com/2021/05/17/aerc-with-mbsync-postfix.html) 44 | - [Contributing to the aerc email client](https://www.benburwell.com/posts/aerc/) 45 | - [Code review at the speed of email](https://drewdevault.com/2022/07/25/Code-review-with-aerc.html) 46 | 47 | ### Aerc on hacker news 48 | - [Aerc : A well-crafted TUI for email](https://news.ycombinator.com/item?id=41321981) 49 | - [Aerc – a pretty good (terminal) email client](https://news.ycombinator.com/item?id=33166054) 50 | - [Aerc – An email client that runs in the terminal](https://news.ycombinator.com/item?id=20090950) 51 | 52 | ### Official Aerc Documentation 53 | - [Aerc Website](https://aerc-mail.org/) 54 | - [Aerc Wiki](https://sr.ht/~rjarry/aerc/) 55 | - [Aerc Mailing List](https://lists.sr.ht/~rjarry/aerc-discuss) 56 | -------------------------------------------------------------------------------- /aerc.conf: -------------------------------------------------------------------------------- 1 | # vim: set filetype=config: 2 | [general] 3 | log-file = "~/.config/aerc/aerc.log" # Optional: Pfad zur Logdatei 4 | log-level = trace 5 | 6 | default-save-path="~/Data/Mail/aerc/" # Used as a default path for save operations if no other path is specified. ~ is expanded to the current user home dir. 7 | log-file="~/Data/Mail/aerc/aerclog.txt" # Output log messages to specified file. A path starting with ~/ is expanded to the user home dir. When redirecting aerc's output to a file using > shell redirection, this setting is ignored and log messages are printed to stdout. 8 | empty-subject-warning=true # Warn before sending emails with an empty subject 9 | 10 | [ui] 11 | auto-mark-read=false # Automatically set the "seen" flag when a message is opened in the message viewer. Default: true 12 | border-char-vertical=" " # Uncomment to use box-drawing characters for vertical and horizontal borders. Default: " " 13 | client-threads-delay=50ms # Debounce client-side thread building Default: 50ms 14 | column-flags = {{.Flags | join " "}} 15 | column-separator=" " # String separator inserted between columns. When the column width specifier is an exact number of characters, the separator is added to it (i.e. the exact width will be fully available for the column contents). Default: " " 16 | dirlist-delay=500ms # Delay after which the messages are actually listed when entering a directory. This avoids loading messages when skipping over folders and makes the UI more responsive. If you do not want that, set it to 0s. Default: 200ms 17 | dirlist-tree=true # Display the directory list as a foldable tree that allows to collapse and expand the folders. Default: false 18 | empty-message = "Tumbleweed" 19 | force-client-threads=false # Force client-side thread building Default: false 20 | fuzzy-complete=true # Activates fuzzy search in commands and their arguments: the typed string is searched in the command or option in any position, and need not be consecutive characters in the command or option. Default: false 21 | icon-attachment=󰏢 22 | icon-new ="󰇮 " 23 | icon-old =󱙡 24 | icon-flagged =󰛏 25 | icon-draft =󰻣 26 | icon-marked =󰪱 27 | icon-replied = 28 | index-columns=date<8,name<17,subject<*,flags<4 # Describes the format for each row in a mailbox view. This is a comma separated list of column names with an optional align and width suffix. After the column name, one of the '<' (left), ':' (center) or '>' (right) alignment characters can be added (by default, left) followed by an optional width specifier. The width is either an integer representing a fixed number of characters, or a percentage between 1% and 99% representing a fraction of the terminal width. It can also be one of the '*' (auto) or '=' (fit) special width specifiers. Auto width columns will be equally attributed the remaining terminal width. Fit width columns take the width of their contents. If no width specifier is set, '*' is used by default. 29 | next-message-on-delete=false # Moves to next message when the current message is deleted Default: true 30 | pinned-tab-marker='*' # Marker to show before a pinned tab's name. Default: ` 31 | styleset-name=Dracula # Sets the styleset to use for the aerc ui elements. Default: default 32 | this-day-time-format=15:04 # Index-only time format for messages that were received/sent today. If this is not specified, timestamp-format is used instead. 33 | this-week-time-format=Mon # Index-only time format for messages that were received/sent within the last 7 days. If this is not specified, timestamp-format is used instead. 34 | this-year-time-format=06-01-02 # Index-only time format for messages that were received/sent this year. If this is not specified, timestamp-format is used instead. 35 | threading-enabled=true # Enable a threaded view of messages. If this is not supported by the backend (IMAP server or notmuch), threads will be built by the client. Default: false 36 | timestamp-format=06-01-02 15:04 # See time.Time#Format at https://godoc.org/time#Time.Format Default: 2006-01-02 03:04 PM (ISO 8601 + 12 hour time) 37 | 38 | [statusline] 39 | status-columns = left<*,center>=,right>* # Describes the format for each row in the statusline. 40 | column-left = {{.Folder}} # Specifies the format for the left column. Default: {{.Folder}} 41 | column-center = {{.PendingKeys}} {{.TrayInfo}} {{.StatusInfo}} # Specifies the format for the center column. Default: {{.StatusInfo}} 42 | column-right = {{if gt (len .From) 0}}{{(index .From 0).Address}}{{else}}No Semder{{end}} {{.Size | humanReadable}} # Specifies the format for the right column. Default: {{.Date}} 43 | separator=" | " # Specifies the separator between grouped statusline elements. Default: " | " 44 | #display-mode=text # Defines the mode for displaying the status elements. Options: text, icon Default: text 45 | 46 | [viewer] 47 | text/plain = less %s 48 | text/html = w3m -T text/html %s 49 | # application/pdf = open %s 50 | image/* = open %s 51 | audio/* = afplay %s# The viewer section 52 | # pager = w3m -F -I UTF-8 -T text/html -dump # :w3m 53 | 54 | # pager = less -Rc -+S # Command to use for viewing messages. Default: less -Rc -+S --wordwrap 55 | 56 | # Layout of headers when viewing a message. To display multiple headers in the same row, separate them with a pipe, e.g. "From|To". Rows will be hidden if none of their specified headers are present in the message. Default: From|To,Cc|Bcc,Date,Subject 57 | #header-layout=From|To,Cc|Bcc,Date,Subject 58 | # header-layout=From,To,Cc|Bcc,Date,Subject 59 | 60 | # Display pdf attachments inline. Default: false 61 | # [mimeviewer] 62 | 63 | # Display image attachments 64 | 65 | # Whether to always show the mimetype of an email, even when it is just a single part Default: false 66 | # always-show-mime=true 67 | 68 | [compose] 69 | # Specifies the command to run the editor with. It will be shown in an embedded terminal, though it may also launch a graphical window if the environment supports it. Defaults to $EDITOR, or vi. editor= 70 | 71 | # Default header fields to display when composing a message. To display multiple headers in the same row, separate them with a pipe, e.g. "To|From". Default: To|From,Subject 72 | header-layout=To,Cc,Bcc,From,Subject 73 | 74 | # Specifies the command to be used to tab-complete email addresses. Any occurrence of "%s" in the address-book-cmd will be replaced with what the user has typed so far. The command must output the completions to standard output, one completion per line. Each line must be tab-delimited, with an email address occurring as the first field. Only the email address field is required. The second field, if present, will be treated as the contact name. Additional fields are ignored. This parameter can also be set per account in accounts.conf. 75 | #address-book-cmd= 76 | 77 | # Specifies the command to be used to select attachments. Any occurence of '%s' in the file-picker-cmd will be replaced the argument to :attach -m . The command must output the selected files to standard output, one file per line. 78 | file-picker-cmd=osascript -e 'tell application "Finder" to choose file with prompt "Select File to Attach"' -e 'POSIX path of result' 79 | # file-picker-cmd=find . -type f | fzf --multi --query="%s" 80 | 81 | # Allow to address yourself when replying Default: true 82 | reply-to-self=true 83 | 84 | # Warn before sending an email that matches the specified regexp but does not have any attachments. Leave empty to disable this feature. Uses Go's regexp syntax, documented at https://golang.org/s/re2syntax. The "(?im)" flags are set by default (case-insensitive and multi-line). Example: no-attachment-warning=^[^>]*attach(ed|ment) 85 | no-attachment-warning=true 86 | 87 | [multipart-converters] 88 | # Converters allow to generate multipart/alternative messages by converting the main text/plain part into any other MIME type. Only exact MIME types are accepted. The commands are invoked with sh -c and are expected to output valid UTF-8 text. Example (obviously, this requires that you write your main text/plain body using the markdown syntax): 89 | text/html=pandoc -f markdown -t html --standalone 90 | 91 | [filters] 92 | # Filters allow you to pipe an email body through a shell command to render certain emails differently, e.g. highlighting them with ANSI escape codes. The commands are invoked with sh -c. The following folders are appended to the system $PATH to allow referencing filters from their name only: 93 | # The first filter which matches the email's mimetype will be used, so order them from most to least specific. You can also match on non-mimetypes, by prefixing with the header to match against (non-case-sensitive) and a comma, e.g. subject,text will match a subject which contains "text". Use header,~regex to match against a regex. 94 | text/plain = sed 's/^>\+.*/\x1b[36m&\x1b[0m/' 95 | # text/plain = less 96 | text/html = w3m -T text/html 97 | application/pdf = open 98 | image/*=catimg -w $(tput cols) - 99 | # image/*=catimg 100 | # image/* = open 101 | # audio/* = afplay 102 | 103 | # text/plain=bat -p # 104 | # text/html=w3m -F 105 | # text/plain=less -Rc -+S 106 | # text/plain=less -Rc 107 | # text/plain=bat -p # 108 | 109 | [openers] 110 | # Openers allow you to specify the command to use for the :open action on a per-MIME-type basis. {} is expanded as the temporary filename to be opened. If it is not encountered in the command, the temporary filename will be appened to the end of the command. Examples: 111 | text/plain=nvim -R 112 | text/html=w3m -F -I UTF-8 -T text/html -dump 113 | message/rfc822=thunderbird 114 | 115 | [triggers] 116 | # Triggers specify commands to execute when certain events occur. Example: new-email=exec notify-send "New email from %n" "%s" Executed when a new email arrives in the selected folder 117 | new-email=exec osascript -e 'display notification "%s" with title "New email from %n"' 118 | 119 | [templates] 120 | # Templates are used to populate email bodies automatically. The directories where the templates are stored. It takes a colon-separated list of directories. If this is unset or if a template cannot be found, the following paths will be used as a fallback in that order: 121 | # ${XDG_CONFIG_HOME:-~/.config}/aerc/templates 122 | # ${XDG_DATA_HOME:-~/.local/share}/aerc/templates 123 | # /usr/local/share/aerc/templates 124 | # /usr/share/aerc/templates 125 | # template-dirs= 126 | # The default template to be used for quoted replies. default: quoted_reply 127 | #quoted-reply=quoted_reply 128 | 129 | # The default template to be used for forward as body. default: forward_as_body 130 | #forwards=forward_as_body 131 | -------------------------------------------------------------------------------- /aerc.sh: -------------------------------------------------------------------------------- 1 | # AERC 2 | # Source https://aerc-mail.org/ 3 | # Aerc is an email client for your terminal. 4 | 5 | alias ,a='aerc' # Minimalistic E-Mail client 6 | alias ae_rc='aerc' # Minimalistic E-Mail client 7 | -------------------------------------------------------------------------------- /binds.conf: -------------------------------------------------------------------------------- 1 | # Author: Rafo 2 | # Description: Keybindings for aerc 3 | # License: MIT 4 | # Source: https://github.com/rafo/aerc-vim 5 | # Binds are of the form = 6 | # To use '=' in a key sequence, substitute it with "Eq": "" 7 | # If you wish to bind #, you can wrap the key sequence in quotes: "#" = quit 8 | 9 | = :term # open terminal 10 | ? = :help keys # show help 11 | gt = :next-tab # select next tab 12 | gT = :prev-tab # select previous tab 13 | H = :prev-tab # select previous tab 14 | L = :next-tab # select next tab 15 | ZZ = :prompt 'Quit? ' quit # quit 16 | 17 | [messages] 18 | dd = :delete # delete mail under cursor. Use if its not google mail. 19 | ! = :term # open terminal 20 | $ = :term # open terminal 21 | / = :search # search mails. Next character filters mails. 22 | = :prev 100% # move one screen back 23 | = :next 50% # move half a screen down 24 | = :next 100% # move one screen forward 25 | = :vsplit - # Shrink the vertical split of the message list. 26 | = :clear # clear the terminal 27 | = :vsplit + # Grow the vertical split of the message list. 28 | = :check-mail # Check for new mail 29 | = :prev 50% # move half a screen up 30 | = :vsplit # Creates a vertical split of the message list. 31 | = :next # select next mail 32 | = :view # open mail 33 | = :clear # clear 34 | = :next 100% # move one screen forward 35 | = :prev 100% # move one screen back 36 | = :prev # select previous mail 37 | c = :cf # change mail folder. Next character filters folders. 38 | dd = :move"[Google Mail]/Trash" # For Google accounts: delete mail under cursor by moving it to the trash folder 39 | tu = :unsubscribe # unsubscribe from mailing list 40 | E = :compose # edit new mail 41 | ea = :reply -a # edit a reply to all senders 42 | ee = :compose # edit a new mail like E 43 | eF = :forward -a # edit a forward mail to all recipients 44 | ef = :forward # edit a forward mail 45 | eR = :reply -aq # edit a reply to sender and all CC with quoted original mail 46 | er = :reply -q # edit a reply with quoted original mail 47 | F = :filter # filter mails. Next character filters mails. 48 | fa = :filter -a # filter entire text of mails. e.g. "fa foo" filters mails containing "foo" in the entire mail. 49 | fb = :filter -b # filter text in the body of mails 50 | fc = :filter -c # filter mails cc'd to recipient 51 | fd = :filter -d # filter mails with date range (e.g. 2019-01-01..2019-12-31) 52 | ff = :filter -f "{{index (.From | emails) 0}}" # filter all mails from current sender 53 | fF = :filter -f # filter mails from sender 54 | fr = :filter -r # filter read mails (old mails) 55 | fs = :filter -H subject:"{{.SubjectBase}}" # 56 | fS = :filter -H subject: # filter mails with subject e.g. "fs foo" filters mails with subject containing "foo" 57 | ft = :filter -t # filter mails to recipient 58 | fu = :filter -u # filter unread mails (new mails) 59 | G = :select -1 # select last mail 60 | gg = :select 0 # select first mail 61 | i = :compose # edit new mail. Like "E" or "O" but with a different key. 62 | J = :next-folder # select next mail folder 63 | j = :next # select next mail 64 | K = :prev-folder # select previous mail folder 65 | k = :prev # select previous mail 66 | l = :view # open mail 67 | mm = :mark -v # mark mails like v 68 | mt = :mark -t # mark mail as todo 69 | md = :mark -d # mark mail as done 70 | mu = :unread # mark mail as unread. Like "tr" 71 | n = :next-result # jump to next search result 72 | N = :prev-result 73 | O = :compose # edit new mail like in vim to insert a new line above the current line. 74 | o = :reply -q # edit a reply with original mail like in vim to insert a new line below the current line. 75 | pa = :archive flat # move (think put or paste) mail in the archive folder 76 | pb = :move Brain # move mail in my Brain. 77 | pf = :move # move (think put or paste) mail in folder. Next character filters folders. 78 | sA = :sort -r arrival # sort mails by arrival (reversed) 79 | sa = :sort arrival # sort mails by arrival 80 | sC = :sort -r cc # sort mails by cc (reversed) 81 | sc = :sort cc # sort mails by cc 82 | sD = :sort -r date # sort mails by time & date 83 | sd = :sort date # sort mails by time & date 84 | sF = :sort -r from # sort mails by sender (reversed) 85 | sf = :sort from # sort mails by sender 86 | sR = :sort -r read # sort mails by read status (reversed) 87 | sr = :sort read # sort mails by read status 88 | sS = :sort -r subject # sort mails by subject (reversed) 89 | ss = :sort subject # sort mails by subject 90 | sT = :sort -r to # sort mails by to (reversed) 91 | st = :sort to # sort mails by to 92 | sZ = :sort -r size # sort mails by size (reversed) 93 | sz = :sort size # sort mails by size 94 | ta = :flag -ta # toggle mail between answered and unanswered 95 | tr = :read -t # toggle read status 96 | ts = :flag -tx Seen # toggle seen status 97 | tt = :toggle-threads # toggle threads 98 | V = :mark -V # Same as -v but does not clear existing selection 99 | vv = :mark -v # Enter / leave visual mark mode 100 | va = :mark -a # mark all mails in the current view 101 | vt = :mark -t # toggle the mark state instead of marking a message 102 | vT = :mark -T # Marks the displayed message thread of the selected message 103 | yy = :copy # copy mail to a folder. Next character filters folders. 104 | yf = :pipe -b echo "{{index (.From | emails) 0}}" | pbcopy # Copy the email-address of the sender (*f*rom) to the clipboard 105 | ys = :pipe -b echo "{{.Subject}}" | pbcopy # Copy the *s*ubject of the email to the clipboard 106 | yd = :pipe -b echo "{{.Date}}" | pbcopy # Copy the *d*ate and time of the email to the clipboard 107 | yf = :copy # copy mail to a folder. Next character filters folders. 108 | zC = :collapse-folder # collapse folder in the siedebar / directory tree 109 | zc = :collapse # collapse thread 110 | zO = :expand-folder # expand folder in the sidebar / directory tree 111 | zo = :open-thread # open thread 112 | ZZ = :quit # Quit aerc. Only "q" is to dangerous. 113 | | = :pipe # pipe mail to command (e.g. |less) 114 | 115 | [messages:folder=Drafts] 116 | = :recall # recall mail from drafts folder 117 | 118 | [view] 119 | = :toggle-key-passthrough # toggle key passthrough 120 | = :next # open next mail 121 | = :prev # open previous mail 122 | dd = :delete # delete selected mail 123 | ea = :reply -a # edit a reply to all recipients 124 | ee = :reply # edit a reply to the sender 125 | eF = :forward -a # edit a forward mail to all recipients 126 | ef = :forward # edit a forward mail like f 127 | eQ = :reply -a -q # edit a reply to all senders with quoted mail 128 | eq = :reply -q # edit a reply to all senders with quoted mail 129 | F = :forward -a # edit a forward mail to all recipients like eF 130 | f = :forward # forward mail like ef 131 | gl = :open-link # open link under cursor 132 | h = :close # close the current view and return to the message list 133 | i = :reply # reply with original mail 134 | I = :toggle-key-passthrough # toggle key passthrough 135 | j = :next-part # Switch to next part of a multipart email. 136 | k = :prev-part # Switch to previous part of a multipart email. 137 | l = :open # open 138 | o = :reply -aq # edit a reply to all with quoted mail 139 | O = :reply -q # edit a reply with quoted mail 140 | pa = :archive flat # Put mail in the archive folder 141 | pb = :move Brain # move mail in my Brain. 142 | pf = :move # move (think put or paste) mail in folder. Next character filters folders. 143 | q = :close # quit the current view 144 | ra = :reply -a # edit a reply all without quoted mail 145 | rq = :reply -q # edit a reply to new with quoted mail 146 | rr = :reply -aq # edit a reply all with quoted mail 147 | th = :toggle-headers # toggle headers 148 | w = :save # write mail to file [name]. 149 | x = :delete # delete selected mail like dd 150 | | = :pipe 151 | 152 | [view::passthrough] 153 | $noinherit = true 154 | $ex = 155 | = :toggle-key-passthrough 156 | 157 | [compose] # Keybindings used when the embedded terminal is not selected in the compose view 158 | $ex = 159 | $noinherit = true 160 | = :switch-account -p 161 | = :switch-account -n 162 | = :prev-field 163 | = :prev-tab 164 | = :next-field 165 | = :prev-field 166 | = :next-tab 167 | = :next-field 168 | 169 | [compose::editor] # Keybindings used when the embedded terminal is selected in the compose view 170 | $noinherit = true 171 | $ex = 172 | = :prev-field 173 | = :next-field 174 | = :prev-tab 175 | = :next-tab 176 | 177 | [compose::review] # Keybindings used when reviewing a mail to be sent 178 | w = :send # send 179 | s = :send # send 180 | ZZ = :abort # abort 181 | q = :abort # abort 182 | v = :preview 183 | p = :postpone 184 | d = :discard 185 | D = :discard abort 186 | e = :edit 187 | aa = :attach # attach attachment 188 | ad = :detach # detach attachment 189 | 190 | [terminal] 191 | $noinherit = true 192 | $ex = 193 | = :prev-tab 194 | = :next-tab 195 | -------------------------------------------------------------------------------- /mf.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # awk -F to specify the field separator (in this case, < or >) and print 4 | # the second field (the email address) to a file where imapfilter can read it. 5 | # Imapfilter will then use the file to filter emails. 6 | # You can also use sed or grep to do this, but I like awk. 7 | # Note: You will need to change the path to the file to match your system. 8 | # Imapfilter is a great tool for filtering emails, and it's very easy to use. 9 | # https://github.com/lefcha/imapfilter 10 | 11 | awAk -F"<|>" "/From: /{print $2}" >>"$HOME/.config/imapfilter/mf.txt" 12 | --------------------------------------------------------------------------------