himalaya/vim/README.md
Clément DOUIN e33a9a72e9
release v0.5.4 (#285)
* replace bsd3 license by bsd4

* add attachments with save and send commands (#284)

* set up tpl save and send commands

* improve msg save and send handlers

* add vim msg#add_attachment fn

* improve vim logs

* update changelog

* add attachment keybind vim doc

* reverse range order fetch envelopes (#276)

* bump version v0.5.4
2022-02-05 00:29:57 +01:00

4.6 KiB

Vim plugin

Installation

First you need to install and configure the himalaya CLI. Then you can install this plugin with your favorite plugin manager. For example with vim-plug, add to your .vimrc:

Plug 'soywod/himalaya', {'rtp': 'vim'}

Then:

:PlugInstall

It is highly recommanded to have this option on:

set hidden

Configuration

Mailbox picker provider

let g:himalaya_mailbox_picker = 'native' | 'fzf' | 'telescope'

Defines the provider used for picking mailboxes:

If no value given, the first loaded (and available) provider will be used (fzf

telescope > native).

Telescope preview

let g:himalaya_telescope_preview_enabled = 0

Should enable telescope preview when picking a mailbox with the telescope provider.

Contact completion

let g:himalaya_complete_contact_cmd = '<your completion command>'

Define the command to use for contact completion. When this is set, completefunc will be set when composing messages so that contacts can be completed with <C-x><C-u>.

The command must print each possible result on its own line. Each line must contain tab-separated fields; the first must be the email address, and the second, if present, must be the name. %s in the command will be replaced with the search query.

For example, to complete contacts with khard, you could use khard email --remove-first-line --parsable '%s' as the completion command.

Usage

List messages view

:Himalaya

gif

Function Default binding
Change the current mbox gm
Show previous page gp
Show next page gn
Read focused msg <Enter>
Write a new msg gw
Reply to the focused msg gr
Reply all to the focused msg gR
Forward the focused message gf
Download attachments from focused message ga
Copy the focused message gC
Move the focused message gM
Delete the focused message(s) gD

They can be customized:

nmap gm   <plug>(himalaya-mbox-input)
nmap gp   <plug>(himalaya-mbox-prev-page)
nmap gn   <plug>(himalaya-mbox-next-page)
nmap <cr> <plug>(himalaya-msg-read)
nmap gw   <plug>(himalaya-msg-write)
nmap gr   <plug>(himalaya-msg-reply)
nmap gR   <plug>(himalaya-msg-reply-all)
nmap gf   <plug>(himalaya-msg-forward)
nmap ga   <plug>(himalaya-msg-attachments)
nmap gC   <plug>(himalaya-msg-copy)
nmap gM   <plug>(himalaya-msg-move)
nmap gD   <plug>(himalaya-msg-delete)

List mailboxes

Default behaviour (basic prompt):

screenshot

With telescope support:

screenshot

With fzf support:

screenshot

Read message view

gif

Function Default binding
Write a new msg gw
Reply to the msg gr
Reply all to the msg gR
Forward the message gf
Download all msg attachments ga
Copy the message gC
Move the message gM
Delete the message gD

They can be customized:

nmap gw <plug>(himalaya-msg-write)
nmap gr <plug>(himalaya-msg-reply)
nmap gR <plug>(himalaya-msg-reply-all)
nmap gf <plug>(himalaya-msg-forward)
nmap ga <plug>(himalaya-msg-attachments)
nmap gC <plug>(himalaya-msg-copy)
nmap gM <plug>(himalaya-msg-move)
nmap gD <plug>(himalaya-msg-delete)

Write message view

gif

Function Default binding
Add attachment ga

They can be customized:

nmap ga <plug>(himalaya-msg-add-attachment)

When you exit this special buffer, you will be prompted 4 choices:

  • Send: sends the message
  • Draft: saves the message into the Drafts mailbox
  • Quit: quits the buffer without saving
  • Cancel: goes back to the message edition