diff --git a/content/tips/emails-md-fr.md b/content/tips/emails-md-fr.md index 4bbc6d2..2153819 100644 --- a/content/tips/emails-md-fr.md +++ b/content/tips/emails-md-fr.md @@ -1,7 +1,7 @@ --- Title: Écrire son courriel en markdown avec vim Date: 2019-04-22 19:00 -Modified: 2019-04-24 09:35 +Modified: 2023-10-14 19:00 Author: Fabrice Category: astuces Tags: emails, pandoc, Vim @@ -24,7 +24,11 @@ pandoc -t html5 -s | xclip -selection clipboard Ainsi, en ajoutant ce raccourci dans votre fichier de configuration pour les markdown dans vim (pour ma part il est dans `ftplugin/pandoc.vim`): ```vim -map :w !pandoc -t html5 -s \| xclip -selection clipboard +map :w !pandoc -t html5 -s \| xclip -selection clipboard +``` +ou en version plus moderne (lua + wayland): +```lua +vim.keymap.set('n', , ':w !pandoc -t html5 -s | wl-copy', { noremap = true, silent = true }) ``` on peut alors directement coller le contenu du *buffer* courant formatée par [pandoc](https://pandoc.org/) dans thunderbird. Bien entendu, vous pouvez décorer cette commande à l’aide de vos options favorites. diff --git a/content/tips/emails-md.md b/content/tips/emails-md.md index 78e8c42..c7e6931 100644 --- a/content/tips/emails-md.md +++ b/content/tips/emails-md.md @@ -1,7 +1,7 @@ --- Title: Write your emails in markdown with vim Date: 2019-04-22 19:00 -Modified: 2019-04-24 09:35 +Modified: 2023-10-14 19:00 Author: Fabrice Category: tips Tags: emails, pandoc, Vim @@ -26,6 +26,10 @@ Therefore, adding: ```vim map :w !pandoc -t html5 -s \| xclip -selection clipboard ``` +or a more modern version using `lua` and `wayland`: +```lua +vim.keymap.set('n', , ':w !pandoc -t html5 -s | wl-copy', { noremap = true, silent = true }) +``` in your vim `ftplugin/pandoc.vim` configuration file allows you to copy directly the output of [pandoc](https://pandoc.org/) on you opened buffer into your clipboard and thus past it directly into thunderbird. Of course, you can customize this command line as you want. For instance my base-header-level is 4, as I think that first-level titles are a bit too much for emails. You can even use some simple [css rules](https://perfectmotherfuckingwebsite.com/) in a separated style sheet along with the `--self-contained` option of pandoc to be able to do basic general formating (for a newsletter for instance).