Command-line email

Can we use Neovim as an email client? Yes, this is actually possible using Himalaya!

As a first step, though, we should enable Himalaya itself using Nix. home-manager provides a module for that. Without much ado:

  programs.himalaya = {
    enable = true;
  }; = {
    icloud = {
      primary = true;
      himalaya.enable = true;
      address = "";
      realName = "Sridhar Ratnakumar";
      userName = "happyandharmless";
      passwordCommand = "op item get iCloud --fields label=himalaya";
      imap = {
        host = "";
        port = 993;
        tls.enable = true;
      smtp = {
        host = "";
        port = 587;
        tls.enable = true;

I added my iCloud account details. Note that passwordCommand uses 1Password’s CLI tool, which uses Mac’s Touch ID authentication. I generated an App-specific password and put it under the β€œhimalaya” label of the iCloud entry in 1Password. As a result, we get a no-fuss way to read email!


Vim extension

Installing the Vim extension is fairly simple:

      (pkgs.vimUtils.buildVimPlugin {
        name = "himalaya";
        src = inputs.himalaya + /vim;

The Vim extension is not bad. But it does bring up the Mac Touch ID prompt upon every email operation, which needs to be fixed.

#neovim #email