Minor changes in neomutt config

This commit is contained in:
Thomas Dehaeze 2019-08-23 10:02:42 +02:00
parent 9d6806d08e
commit 1da087bb42

View File

@ -681,30 +681,11 @@ Labels
macro attach W <save-entry><kill-line>~/Downloads/<enter>y "Save entry" macro attach W <save-entry><kill-line>~/Downloads/<enter>y "Save entry"
#+end_src #+end_src
*** TODO Compose
#+BEGIN_SRC conf
bind compose p postpone-message
bind compose R rename-attachment
bind compose a attach-file
#+END_SRC
Attach multiple files using ranger Attach multiple files using ranger
#+begin_src conf #+begin_src conf
macro compose A "<shell-escape>bash $HOME/.config/neomutt/bin/rangerpick<enter><enter-command>source /tmp/rangerpick<enter><shell-escape>bash $HOME/.config/neomutt/bin/rangerpick clean<enter>" "Attach with Ranger" macro compose A "<shell-escape>bash $HOME/.config/neomutt/bin/rangerpick<enter><enter-command>source /tmp/rangerpick<enter><shell-escape>bash $HOME/.config/neomutt/bin/rangerpick clean<enter>" "Attach with Ranger"
#+end_src #+end_src
Write html emails using markdown
#+BEGIN_SRC conf
# macro compose M "F pandoc -s -f markdown -t html \ny^T^Utext/html; charset=us-ascii\n"
#+END_SRC
Open another instance of neomutt in readonly mode while composing
#+BEGIN_SRC conf
macro compose M "<shell-escape>termite -e \"neomutt -R\"<enter>"
#+END_SRC
**** Attach with Ranger Script **** Attach with Ranger Script
:PROPERTIES: :PROPERTIES:
:header-args: :tangle ~/.config/neomutt/bin/rangerpick :header-args: :tangle ~/.config/neomutt/bin/rangerpick
@ -720,6 +701,25 @@ Open another instance of neomutt in readonly mode while composing
fi fi
#+end_src #+end_src
*** TODO Compose
#+BEGIN_SRC conf
bind compose p postpone-message
bind compose R rename-attachment
bind compose a attach-file
#+END_SRC
Write html emails using markdown
#+BEGIN_SRC conf
# macro compose M "F pandoc -s -f markdown -t html \ny^T^Utext/html; charset=us-ascii\n"
#+END_SRC
Open another instance of neomutt in readonly mode while composing
#+BEGIN_SRC conf
macro compose M "<shell-escape>termite -e \"neomutt -R\"<enter>"
#+END_SRC
*** Browser *** Browser
#+begin_src conf #+begin_src conf
bind browser l select-entry bind browser l select-entry
@ -778,6 +778,34 @@ Use =urlview= to extract urls from the mail.
#+begin_src conf #+begin_src conf
macro index,pager S "<pipe-message>$HOME/scripts/mutt-save-org-link.py\n" macro index,pager S "<pipe-message>$HOME/scripts/mutt-save-org-link.py\n"
#+end_src #+end_src
**** Link mail to orgmode - Script
:PROPERTIES:
:header-args: :tangle ~/scripts/mutt-save-org-link.py
:header-args+: :comments both :mkdirp yes
:header-args+: :shebang "#!/usr/bin/env python3"
:END:
#+begin_src python
import sys
import email
import subprocess
import urllib.parse
# Parse the email from standard input
message_bytes = sys.stdin.buffer.read()
message = email.message_from_bytes(message_bytes)
# Grab the relevant message headers
message_id = urllib.parse.quote(message['message-id'].strip()[1:-1])
subject = message['subject'].replace('[', '{').replace(']', '}')
# Ask emacsclient to save a link to the message
p = subprocess.Popen([
'emacsclient',
f'org-protocol://store-link?url=message://{message_id}&title={subject}'
])
p.wait()
#+end_src
** Colors ** Colors
*** Basic colors *** Basic colors
@ -1353,31 +1381,3 @@ Libreoffice
application/wordperfect; libreoffice --nologo --writer '%s'; copiousoutput application/wordperfect; libreoffice --nologo --writer '%s'; copiousoutput
text/rtf; libreoffice --nologo --writer '%s'; copiousoutput text/rtf; libreoffice --nologo --writer '%s'; copiousoutput
#+end_src #+end_src
** Link mail to orgmode
:PROPERTIES:
:header-args: :tangle ~/scripts/mutt-save-org-link.py
:header-args+: :comments both :mkdirp yes
:header-args+: :shebang "#!/usr/bin/env python3"
:END:
#+begin_src python
import sys
import email
import subprocess
import urllib.parse
# Parse the email from standard input
message_bytes = sys.stdin.buffer.read()
message = email.message_from_bytes(message_bytes)
# Grab the relevant message headers
message_id = urllib.parse.quote(message['message-id'].strip()[1:-1])
subject = message['subject'].replace('[', '{').replace(']', '}')
# Ask emacsclient to save a link to the message
p = subprocess.Popen([
'emacsclient',
f'org-protocol://store-link?url=message://{message_id}&title={subject}'
])
p.wait()
#+end_src