8000 GitHub - krobelus/kakoune-mblaze: mblaze Maildir utilities plugin for the Kakoune editor · GitHub
[go: up one dir, main page]

Skip to content

About

mblaze Maildir utilities plugin for the Kakoune editor

Resources

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

kakoune-mblaze

This plugin integrates the mblaze suite of Unix utilities for dealing with Maildir into the Kakoune editor (version v2024.05.09 or higher).

Installation

git clone https://github.com/krobelus/kakoune-mblaze \
    ~/.config/kak/autoload/kakoune-mblaze
kak -e 'doc mblaze'

Usage

Listing and showing messages

mblaze-scan pipes the output of the given shell script into mscan(1) and shows the result in an *mblaze-scan* buffer. Example:

mblaze-scan %{ mlist $(mdirs) | mthread }

Inside *mblaze-scan*, you can run

  • mblaze-show to use mshow(1) to render selected messages in an *mblaze-show* buffer

  • mblaze-refresh to update a scan buffer by re-running its command

  • mblaze-next-thread or mblaze-previous-thread to move the main cursor to the next or previous thread start

Messages in context

Most mblaze-* commands operate on the "context’s message(s)", which is defined as follows:

  • in an *mblaze-scan* buffer, the messages covered by the selections. Commands that operate on only one message only consider the main cursor.

  • in an *mblaze-show* buffer, the messages shown. Commands that operate on only one message currently fail in show buffers where multiple messages are shown.

Auto-rendering the context’s message

To show the context’s message in another client as you browse a scan buffer, set mblaze_autoshow_client. For example:

mblaze-scan %{ mlist $(mdirs) | mthread }
new evaluate-commands %{ set-option global mblaze_autoshow_client %val{client} }

Passing the context’s messages to shell commands

mblaze-pipe-to <command> writes the context’s messages to the given command’s standard input, one filename per line, and then calls mblaze-refresh if called from a scan buffer. The command’s output is currently shown in the *debug* buffer. For example:

mblaze-pipe-to %{ mrefile "$(mhdr -h maildir ~/.mblaze/profile)"/archive }

In a scan buffer with a threaded view as created by mthread(1), the mblaze-pipe-to command can be passed the -thread option, to pipe whole threads.

Writing messages

mblaze-compose wraps mcom(1) to create a draft message and edits it.

mblaze-reply and mblaze-forward wrap mrep(1) and mfwd(1) to create and edit a draft reply to or forward of the context’s messages.

mblaze-send sends the message draft in the current buffer with mcom(1).

MIME parts

mblaze-open-named-mime-parts <part_filename>…​ opens the given named MIME parts (such as attachments) from the context’s message.

mblaze-open-html-mime-part opens the unique unnamed text/html part of the context’s message.

Both commands call mblaze-open-mime-part <message_file> <part> <mime_type> which needs to be overridden by the user. For example, to save MIME parts in the current directory and open them, do:

define-command -override mblaze-open-mime-part -params 3 %{
    nop %sh{
        message_file=$1 part=$2 mime_type=$3
        mshow -n -x "$message_file" "$part"
        xdg-open "$part"
    }
}

Example mappings

Search for occurrences of mblaze in my kakrc.

History

I was previously using https://git.sr.ht/~parasrah/mblaze.kak for some of my workflows; when I finally got around to writing this plugin and using it for all my mail, I based it on https://github.com/mawww/mblaze.kak because that had fewer things I needed to change.

Status

This plugin is fairly new, so some behavior changes are expected.

Contributing

Send feedback and patches to ~krobelus/kakoune@lists.sr.ht (see public archives) or use GitHub.

About

mblaze Maildir utilities plugin for the Kakoune editor

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

0