mirror of
https://github.com/pimalaya/himalaya.git
synced 2026-06-17 13:17:55 +08:00
102 lines
2.7 KiB
Markdown
102 lines
2.7 KiB
Markdown
# Vim plugin
|
|
|
|
## Installation
|
|
|
|
First you need to install and configure the [himalaya
|
|
CLI](https://github.com/soywod/himalaya#installation). Then you can install
|
|
this plugin with your favorite plugin manager. For example with
|
|
[vim-plug](https://github.com/junegunn/vim-plug), add to your `.vimrc`:
|
|
|
|
```viml
|
|
Plug 'soywod/himalaya', {'rtp': 'vim'}
|
|
```
|
|
|
|
Then:
|
|
|
|
```viml
|
|
:PlugInstall
|
|
```
|
|
|
|
## Usage
|
|
|
|
### List messages view
|
|
|
|
```vim
|
|
:Himalaya
|
|
```
|
|
|
|

|
|
|
|
| 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 all focused msg attachments | `ga` |
|
|
|
|
They can be customized:
|
|
|
|
```vim
|
|
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)
|
|
```
|
|
|
|
### List mailboxes
|
|
|
|
Default behaviour (basic prompt):
|
|
|
|

|
|
|
|
With [telescope](https://github.com/nvim-telescope/telescope.nvim) support:
|
|
|
|

|
|
|
|
With [fzf](https://github.com/junegunn/fzf) support:
|
|
|
|

|
|
|
|
### Read message view
|
|
|
|

|
|
|
|
| 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` |
|
|
|
|
They can be customized:
|
|
|
|
```vim
|
|
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)
|
|
```
|
|
|
|
### Write message view
|
|
|
|

|
|
|
|
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
|