From c415bc54dace096f4276bb98df6cb056cc9f587f Mon Sep 17 00:00:00 2001 From: Paul Walker Date: Mon, 8 Dec 2025 14:27:16 +0000 Subject: [PATCH] mailcap: use dump-docx.py to dump .docx files --- bin/dump-docx.py | 14 ++++++++++++++ mailcap | 2 ++ vimrc | 9 +++++++++ 3 files changed, 25 insertions(+) create mode 100755 bin/dump-docx.py diff --git a/bin/dump-docx.py b/bin/dump-docx.py new file mode 100755 index 0000000..e809555 --- /dev/null +++ b/bin/dump-docx.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python +import sys + +# python-docx +import docx + +if len(sys.argv) < 2: + print(f"Usage: {sys.argv[0]} [document ...]") + +for fn in sys.argv[1:]: + print(f"\n{fn}:\n") + doc = docx.Document(fn) + for p in doc.paragraphs: + print(p.text) diff --git a/mailcap b/mailcap index f552431..29b6ce2 100644 --- a/mailcap +++ b/mailcap @@ -16,3 +16,5 @@ application/pgp-encrypted; gpg -q -d ; copiousoutput # text/calendar; khal import -a 1c4af6ff-2ace-40c4-b626-81902099e590 %s # application/ics; khal import -a 1c4af6ff-2ace-40c4-b626-81902099e590 %s application/pdf; mupdf %s + +application/vnd.openxmlformats-officedocument.wordprocessingml.document; dump-docx.py %s; copiousoutput diff --git a/vimrc b/vimrc index 27a5d44..fb44272 100644 --- a/vimrc +++ b/vimrc @@ -167,6 +167,15 @@ set background=dark " colorscheme dracula colorscheme solarized8 +" For packages, versions 8.2 and later will autoload `start` packages +" correctly even in your vimrc. +if v:version < 802 + packadd! dracula_pro +endif +syntax enable +let g:dracula_colorterm = 0 +" colorscheme dracula_pro + set ignorecase smartcase set incsearch