Iris: a simple mail client for Vim

栏目: IT技术 · 发布时间: 5年前

内容简介:Simple mail client for Vim, inspired by (Neo)Mutt and Alpine.(Neo)Mutt and Alpine are very good terminal mail clients, but they lack of Vim mappings. You can emulate, but it requires a lot of time, patience and configuration. Why trying to emulate, when yo

:mailbox: Iris.vim

Simple mail client for Vim, inspired by (Neo)Mutt and Alpine.

Iris: a simple mail client for Vim

Table of contents

Motivation

(Neo)Mutt and Alpine are very good terminal mail clients, but they lack of Vim mappings. You can emulate, but it requires a lot of time, patience and configuration. Why trying to emulate, when you can have it in Vim? VimL and Python are strong enough to do so. The aim of Iris is to provide a simple mail client that:

  • Allows you to manage your mails inside Vim
  • Does not slow down neither Vim nor your workflow (async+lazy)
  • Is built on the top of a robust Python IMAP client to avoid implementing IMAP protocol logic

Requirements

You need either Neovim or Vim8+ with:

:echo has("python3")
:echo has("job")
:echo has("channel")

Installation

For eg. with vim-plug :

Plug "soywod/iris.vim"

Configuration

Before using Iris, you need to configure it:

Identity (required)

let g:iris_name  = "My name"
let g:iris_mail = "your@mail.com"

IMAP (required)

let g:iris_imap_host  = "your.imap.host"
let g:iris_imap_port  = 993
let g:iris_imap_login = "Your IMAP login" "Default to g:iris_mail

SMTP (required)

let g:iris_smtp_host  = "your.smtp.host" "Default to g:iris_imap_host
let g:iris_smtp_port  = 587
let g:iris_smtp_login = "Your IMAP login" "Default to g:iris_mail

Passwords

On startup, Iris always asks for your IMAP and SMTP passwords. To avoid this, you can save your password in a file and encrypt it via GPG :

gpg --encrypt --sign --armor --output myfile.gpg myfile
let g:iris_imap_passwd_filepath = "/path/to/imap.gpg"
let g:iris_smtp_passwd_filepath = "/path/to/smtp.gpg"

If you want to use something else than GPG, you can set up your custom command. For eg., with the MacOSX security tool:

let g:iris_imap_passwd_show_cmd = "security find-internet-password -gs IMAP_KEY -w"
let g:iris_smtp_passwd_show_cmd = "security find-internet-password -gs SMTP_KEY -w"

Idle mode

On startup, Iris spawns two Python jobs: one for the API, one for the idle mode . The last one allows you to receive notifications on new mails. You can disable this option or change the default timeout (every 15s):

let g:iris_idle_enabled = 1
let g:iris_idle_timeout = 15

Pagination

By default, Iris fetches your last 50 mails:

let g:iris_emails_chunk_size = 50

Note: the pagination is based on message sequences which is not necessary consecutive. It makes the pagination less accurate (doesn't fetch always the same amount of mails) but more performant.

Attachments

let g:iris_download_dir = "~/Downloads"

Usage

Email list

:Iris
Function Default keybind Override
Preview (text) <Enter> nmap <cr> <plug>(iris-preview-text-email)
Preview (html) gp (for go preview ) nmap gp <plug>(iris-preview-html-email)
Download attachments ga (for go attachments ) nmap ga <plug>(iris-download-attachments)
New mail gn (for go new ) nmap gn <plug>(iris-new-email)
Previous page <Ctrl+b> (for page backward ) nmap <c-b> <plug>(iris-prev-page-emails)
Next page <Ctrl+f> (for page forward ) nmap <c-f> <plug>(iris-next-page-emails)
Change folder gf (for go folder ) nmap gf <plug>(iris-change-folder)

Email text preview

From the email list, press <Enter> to preview the targeted email.

Function Default keybind Override
Reply gr (for go reply ) nmap gr <plug>(iris-reply-email)
Reply all gR (for go reply all ) nmap gR <plug>(iris-reply-all-email)
Forward gf (for go forward ) nmap gf <plug>(iris-forward-email)

Email composition

Iris is based on the builtin mail.vim filetype and syntax. An email should contains a list of headers followed by the message:

To: mail@test.com
Subject: Welcome

Hello world!
Function Default keybind Override
Save draft :w
Send gs (for go send ) nmap gs <plug>(iris-send-email)

Folder

:IrisFolder

Contacts

In order to autocomplete addresses, Iris keeps a .contacts file that contains emails of your contacts. It's updated each time you send a new email (only the To header is used). You can extract existing addresses from all your emails:

:IrisExtractContacts

Note: the completion may need to be triggered manually via <C-x><C-u> , see :h i_CTRL-X_CTRL-U .

Contributing

Git commit messages follow the Angular Convention , but contain only a subject.

Use imperative, present tense: “change” not “changed” nor “changes” Don't capitalize first letter No dot (.) at the end

Code should be as clean as possible, variables and functions use the snake case convention. A line should never contain more than 80 characters.

Tests should be added for each new functionality. Be sure to run tests before proposing a pull request.

Credits


以上所述就是小编给大家介绍的《Iris: a simple mail client for Vim》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

图论导引

图论导引

韦斯特 / 机械工业出版社 / 2006-2 / 65.00元

图论起源于著名的哥尼斯堡七桥问题,在计算科学、社会科学和自然科学等各个领域都有广泛应用。本书是本科生或研究生一学期或两学期的图论课程教材。内容全面,证明与应用实例并举,不仅包括对证明技巧的讨论、1200多道习题、400多幅插图以及许多例题,而且对所有定理都给出了详细完整的证明。可以作为高等院校数学系本科生和研究生、计算机专业和其他专业研究生的图论课程教材,也可以作为有关教师和工程技术人员的参考书。......一起来看看 《图论导引》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具