Vnews

Vnews is a newsfeed reader built on top of Vim and MySQL.

There are lots of newsfeed readers out there, both desktop and web-based. Here are some of Vnews's advantages:

Vnews uses MySQL to store your feed data locally. It uses MySQL's MyISAM tables to provide natural-language full-text search capability.

Vnews is free and open-source.

Prerequisites

Vnews assumes a Unix environment.

To install Ruby 1.9.2, I recommend using the RVM Version Manager, which makes it easy to install and manage different versions of Ruby.

Installation

gem install vnews

Test your installation by typing vnews -h. You should see Vnews's help.

If you run into any PATH errors, try the following: Install the RVM Version Manager, then install Ruby 1.9.2 through RVM, and then run gem install vnews. This should solve any installation issues.

If you ever want to uninstall Vnews from your system, execute this command:

gem uninstall vnews

... and all traces of Vnews will removed.

New and improved versions of Vnews will be released over time. To install the latest version, just type gem install vnews again.

Setup

vnews

When you run Vnews for the first time, a .vnewsrc configuration file will be generated in your home directory. The top of this file will look like this:

host: localhost 
database: vnews 
username: root 
password: 

You must edit this file to match your MySQL settings, and then run

vnews --create-db

to generate the MySQL database that will store your feed data. Leave password: blank if you don't use a MySQL password.

Configuring your feeds

To configure your feeds, edit the bottom part of the .vnewsrc file. The bottom part of the file looks like this:

General News 
http://feedproxy.google.com/economist/full_print_edition
http://feeds.feedburner.com/TheAtlanticWire

Humor
http://feed.dilbert.com/dilbert/blog

Tech 
http://rss.slashdot.org/Slashdot/slashdot
http://feeds2.feedburner.com/readwriteweb
http://feedproxy.google.com/programmableweb
http://news.ycombinator.com/rss
http://daringfireball.net/index.xml
http://dailyvim.blogspot.com/feeds/posts/default

The configuration syntax is very simple. Feeds are organized into folders, e.g. "General News". Under each folder name, list the feeds you want to go inside that folder. You may put a feed under more than one folder. Feeds are listed by their URLs. These should point to live Atom or RSS content.

Whenever you change the feed/folder configuration, run this command:

vnews -u

This will update the Vnews datastore to reflect the changes (including removing feeds). Then Vnews will update all your feeds and start a Vnews session. If you don't want to start a Vnews session (e.g. if you want to run this as a cron job), use vnews -U instead.

Starting Vnews

vnews

will start a Vnews session. vnews -u will update all your feeds and then start a session.

To use MacVim as your Vnews Vim engine, you can run vnews like this

VNEWS_VIM=mvim vnews

or you can export VNEWS_VIM=mvim in your ~/.bash_profile and then just run vnews.

Basic navigation

After you start Vnews, you should see the feed items for all your feeds in one consolidated list.

You can also use the standard Vim window switching, rotating, and positioning commands.

Navigating feeds and folders

For all of these commands, you'll see an autocomplete window appear at the top. The standard Vim autocomplete keystrokes apply:

TIP: start typing the first 1-3 characters of the mailbox name, then press C-n, C-u or C-p until you highlight the right match, and finally press ENTER to select.

Unread items

Unread items are marked with a + symbol.

Starring items

You can star interesting feed items by using ,* or ,8 (both use the same keys, the only difference being the SHIFT key). Starred items are colored green and made available in the special Starred folder.

Starred items don't get deleted when you remove the feed they came from from your .vnewsrc configuration file.

To unstar an item, press ,* or ,8 on a starred item.

Deleting items

To delete items, use ,# or ,3.

You can also delete a range of items, e.g. if you wanted to clear out a backlog of items in a feed or folder. To delete a range of items, you can either of these methods:

See :help 10.3 to learn how to specify command line ranges.

You can use :VND as an abbreviation for :VNDelete.

Opening webpages and hyperlinks

Web hyperlinks are the URLs that begin with http:// or https://.

Under the covers, Vnews uses the command gnome-open or open to launch your external web browser. This should cover Linux Gnome desktop and OS X users. You can change the command Vnews uses to open a hyperlink by adding this to your ~/.vimrc:

let g:Vnews#browser_command = "your browser command here"

If your Vim has netrw installed, you can open a hyperlink directly in Vim by putting the cursor on a web hyperlink and typing gf, CTRL-W f or ,O (capital O). All these commands open the webpage inside your Vim session using elinks or whatever browser you set as your g:netrw_http_cmd. See :help netrw for more information.

Searching your feeds

You can use the abbreviation :VNS. If there are matches, you'll see the matching words color-highlighted.

You'll also see the match score in the column to the right of the title column. The higher the number, the more relevant the match.

Search results are sorted by publication date.

Concatenating feed items

These commands let you concatenate feed items into a single, continuous text document for printing or more leisurely reading.

So for example, if you want to concatenate all the items listed for the current feed, type :%VNConcat.

:VNC is the abbreviation for this command.

See :help 10.3 to learn how to specify command line ranges.

You can pipe out the output of :VNConcat to lpr for printing:

:w !lpr -o cpi=12 -o lpi=8 -o page-right=36 -o page-left=42 -o page-top=36 -o page-bottom=48 

Of course, it would save you typing to make a custom lprcustom script like so:

#!/bin/bash
lpr -o cpi=12 -o lpi=8 -o page-right=36 -o page-left=42 -o page-top=36 -o page-bottom=48 $1

Put this on your PATH. Then you can run this to print your concatenated view:

:w !lprcustom

Updating your feeds

Starting vnews with

vnews -u

will update all your feeds before opening the Vnews session.

vnews -U

will update all your feeds without starting a session. You might want to use this option if you want to update your feeds periodically in the background using cron.

If you're already in a Vnews session, you can update the current feed of folder by pressing u.

Updating your feeds with cron

This cron task will update your feeds every hour, at 1 minute past the hour:

1 * * * * (bash -l -c 'rvm use 1.9.2 && vnews -U') > /dev/null 2>&1

This assumes that you installed Vnews through RVM and on Ruby 1.9.2.

Reloading your item list

You might want to reload the item list that you're currently viewing without fetching updates from over the internet. There are two reasons you may want to do this:

OPML import

If you want to import an OPML export of your feed subscriptions into Vnews, use this command:

vnews --opml [file]

[file] is your OPML file.

You can easily import your Google Reader subscriptions this way. Here's a video that shows you how to export your Google Reader subscriptions to an OPML file.

Getting help

Typing ,? will open the help webpage in a browser.

Bug reports and feature requests

Vnews is very new, so there are kinks and bugs to iron out and lot of desirable features to add. If you have a bug to report or a good feature to suggest, please file it on the issue tracker. That will help a lot.

You can also join the Google Group and comment there.

How to contact the developer

My name is Daniel Choi. I am based in Cambridge, Massachusetts, USA, and you can email me at dhchoi {at} gmail.com.