Science and technology

Use Vim to ship e mail and test your calendar

Last yr, I introduced you 19 days of latest (to you) productiveness instruments for 2019. This yr, I am taking a unique strategy: constructing an atmosphere that may help you be extra productive within the new yr, utilizing instruments you might or could not already be utilizing.

Doing (nearly) all of the issues with Vim, half 1

I take advantage of two textual content editors commonly—Vim and Emacs. Why each? They have completely different use instances, and I am going to discuss a few of them within the subsequent few articles on this collection.

OK, so why do every thing in Vim? Because if there’s one software that’s on each machine I’ve entry to, it is Vim. And in case you are like me, you in all probability already spend quite a lot of time in Vim. So why not use it for all of the issues?

Before that, although, you could do some issues. The first is to be sure to have Ruby assist in Vim. You can test that with vim –version | grep ruby. If the consequence is just not +ruby, that must be mounted. This may be difficult, and it’s best to test your distribution’s documentation for the appropriate package deal to put in. On MacOS, that is the official MacVim (not from Brew), and on most Linux distributions, that is both vim-nox or vim-gtk—NOT vim-gtk3.

I take advantage of Pathogen to autoload my plugins and bundles. If you employ Vundle or one other Vim package deal supervisor, you may want to regulate the instructions beneath to work with it.

Do your e mail in Vim

beginning place for making Vim a much bigger a part of your productiveness plan is utilizing it to ship and obtain e mail with Notmuch utilizing abook to entry your contact record. You want to put in some issues for this. All the pattern code beneath is on Ubuntu, so you may want to regulate for that in case you are utilizing a unique distribution. Do the setup with:

sudo apt set up notmuch-vim ruby-mail
curl -o ~/.vim/plugin/abook --create-dirs https://uncooked.githubusercontent.com/dcbaker/vim-abook/grasp/plugin/abook.vim

So far, so good. Now begin Vim and execute :NotMuch. There could also be some warnings as a result of older model of the mail library notmuch-vim was written for, however on the whole, Vim will now be a full-featured Notmuch mail consumer.

If you need to carry out a seek for a particular tag, kind t, enter the identify of the tag, and press Enter. This will pull up an inventory of all messages with that tag. The s key mixture brings up a Search: immediate that may do a full search of the Notmuch database. Navigate the message record with the arrow keys, press Enter to show the chosen merchandise, and enter q to exit the present view.

To compose mail, use the c keystroke. You will see a clean message. This is the place the abook.vim plugin is available in. Hit Esc and enter :AbookQuery <SomeName>, the place <SomeName> is part of the identify or e mail deal with you need to search for. You will get an inventory of entries within the abook database that match your search. Select the deal with you need by typing its quantity so as to add it to the e-mail’s deal with line. Finish typing and enhancing the e-mail, press Esc to exit edit mode, and enter ,s to ship.

If you need to change the default folder view when :NotMuch begins up, you’ll be able to add the variable g:notmuch_folders to your .vimrc file:

let g:notmuch_folders = [
      [ 'new', 'tag:inbox and tag:unread' ],
      [ 'inbox', 'tag:inbox' ],
      [ 'unread', 'tag:unread' ],
      [ 'News', 'tag:@sanenews' ],
      [ 'Later', 'tag:@sanelater' ],
      [ 'Patreon', 'tag:@patreon' ],
      [ 'LivestockConservancy', 'tag:livestock-conservancy' ],
    ]

There are many extra settings lined within the Notmuch plugin’s documentation, together with establishing keys for tags and utilizing alternate mail applications.

Consult your calendar in Vim

Sadly, there don’t look like any calendar applications for Vim that use the vCalendar or iCalendar codecs. There is Calendar.vim, which may be very nicely carried out. Set up Vim to entry your calendar with:

cd ~/.vim/bundle
git clone git@github.com:itchyny/calendar.vim.git

Now, you’ll be able to see your calendar in Vim by coming into :Calendar. You can change between yr, month, week, day, and clock views with the < and > keys. If you need to begin with a selected view, use the -view= flag to inform it which one you want to see. You may also add a date to any of the views. For instance, if I need to see what’s going on the week of July four, 2020, I might enter :Calendar -view week 7 four 2020. The assistance is fairly good and may be accessed with the ? key.

Calendar.vim additionally helps Google Calendar (which I want), however in December 2019 Google disabled the entry for it. The creator has posted a workaround in the issue on
GitHub
.

So there you’ve got it, your mail, addresses, and calendars in Vim. But you are not carried out but; you may do much more with Vim tomorrow!

Most Popular

To Top