Home

Awesome

<div align="center"> <img src="./logo.svg" alt="Logo" width="128" height="128" /> <h1>📫 Himalaya Vim</h1> <p> <strong>Vim front-end</strong> for the email client <a href="https://github.com/pimalaya/himalaya">Himalaya CLI</a> </p> <p> <a href="https://github.com/pimalaya/himalaya/releases/latest"><img alt="Release" src="https://img.shields.io/github/v/release/pimalaya/himalaya?color=success"/></a> <a href="https://repology.org/project/himalaya/versions"><img alt="Repology" src="https://img.shields.io/repology/repositories/himalaya?color=success"></a> <a href="https://matrix.to/#/#pimalaya:matrix.org"><img alt="Matrix" src="https://img.shields.io/matrix/pimalaya:matrix.org?color=success&label=chat"/></a> </p> </div>

Installation

First you need to install and configure the Himalaya CLI. Then you can install this plugin with your favorite plugin manager:

Using packer

use "https://github.com/pimalaya/himalaya-vim"
:PackerSync

Using vim-plug

Plug 'https://github.com/pimalaya/himalaya-vim'
:PlugInstall

Configuration

It is highly recommanded to have those Vim options on:

syntax on
filetype plugin on
set hidden

g:himalaya_executable

Defines a custom path for the himalaya binary. Defaults to himalaya.

g:himalaya_config_path

Override the default TOML configuration file.

g:himalaya_folder_picker

Defines the provider used for selecting folders (default keybind: gm):

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

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

g:himalaya_folder_picker_telescope_preview

Enables folder preview when picking a folder with the telescope.nvim provider.

let g:himalaya_folder_picker_telescope_preview = 1

g:himalaya_complete_contact_cmd

Defines the command to use for contact completion. When this is set, completefunc will be set when composing emails 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.

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

Usage

Folder listing

With the native picker (default):

screenshot

With the telescope.nvim picker:

screenshot

With the fzf.vim picker:

screenshot

Envelope listing, filtering and sorting

:Himalaya
FunctionKeybind
Change the current foldergm
Show previous pagegp
Show next pagegn
Read email under cursor<Enter>
Write a new emailgw
Reply to the email under cursorgr
Reply all to the email under cursorgR
Forward the email under cursorgf
Download all attachments of email under cursorga
Copy the email under cursorgC
Move the email under cursorgM
Delete email(s) under cursor or visual selectiongD
Filter and sort envelopes according to the given queryg/

Keybinds can be customized:

nmap gm   <plug>(himalaya-folder-select)
nmap gp   <plug>(himalaya-folder-select-previous-page)
nmap gn   <plug>(himalaya-folder-select-next-page)
nmap <cr> <plug>(himalaya-email-read)
nmap gw   <plug>(himalaya-email-write)
nmap gr   <plug>(himalaya-email-reply)
nmap gR   <plug>(himalaya-email-reply-all)
nmap gf   <plug>(himalaya-email-forward)
nmap ga   <plug>(himalaya-email-download-attachments)
nmap gC   <plug>(himalaya-email-copy)
nmap gM   <plug>(himalaya-email-move)
nmap gD   <plug>(himalaya-email-delete)
nmap g/   <plug>(himalaya-set-list-envelopes-query)

Note: see the documentation for more detailed information about the query API.

Message reading

FunctionKeybind
Write a new emailgw
Reply to the emailgr
Reply all to the emailgR
Forward the emailgf
Download all email attachmentsga
Copy the emailgC
Move the emailgM
Delete the emailgD

Keybinds can be customized:

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

Message writing

FunctionKeybind
Add attachmentga

Keybinds can be customized:

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

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

Development

The development environment is managed by Nix. Running nix-shell will spawn a shell with everything you need to get started with this plugin:

# starts a nix shell
$ nix-shell

# starts Vim and the :Himalaya command
$ vim +Himalaya

# starts Neovim and the :Himalaya command
$ nvim +Himalaya

Sponsoring

nlnet

Special thanks to the NLnet foundation and the European Commission that helped the project to receive financial support from:

If you appreciate the project, feel free to donate using one of the following providers:

GitHub Ko-fi Buy Me a Coffee Liberapay thanks.dev PayPal