Newsboat rss reader enable vim key bindings

NapoleonWils0n

Well-Known Member

Reaction score: 149
Messages: 275

Newsboat is a RSS/Atom feed reader for the text console

Newsboat install

Bash:
# pkg install newsboat

Here's how to change the Newsboats to use vim style key bindings

Create the newsboat config file

Bash:
vi ~/.newsboat/config

Then add the code below to the config file and save

Code:
# general settings
auto-reload yes
max-items 50

# externel browser
browser "/usr/local/bin/w3m %u"
macro m set browser "/usr/local/bin/mpv %u"; open-in-browser ; set browser "/usr/local/bin/w3m %u"
macro l set browser "/usr/local/bin/firefox %u"; open-in-browser ; set browser "/usr/local/bin/w3m %u"

# unbind keys
unbind-key ENTER
unbind-key j
unbind-key k
unbind-key J
unbind-key K

# bind keys - vim style
bind-key j down
bind-key k up
bind-key l open
bind-key h quit

# solarized
color background         default   default
color listnormal         default   default
color listnormal_unread  default   default
color listfocus          black     cyan
color listfocus_unread   black     cyan
color info               default   black
color article            default   default

# highlights
highlight article "^(Title):.*$" blue default
highlight article "https?://[^ ]+" red default
highlight article "\\[image\\ [0-9]+\\]" green default

We set the default browser to w3m and then define 2 other external browser which we can invoke with a keyboard shortcut

The macro key is the , comma character which is used together with another key that you define when writing the set browser macro

mpv is set as an external browser so we can open video, audio or youtube links from an rss feed
the keyboard shortcut to open a link with mpv is the , comma character followed the letter m

Firefox is set as an external browser and can be invoked by using the keyboard shortcut , comma character followed by the letter l

Then we change the key bindings to use vim style h,j,k,l for movement
note that pressing the h key on the main window will quit newsboat

And lastly we change the color scheme to solarized dark,
other color scheme are also available

Next we need to create the ~/.newsboat/urls file which will contain a list of the rss feeds we want

Bash:
vi ~/.newsboat/urls

Here are rss feeds for the Freebsd forum main page and how to sections,
as well as the Freebsd now youtube channel

Bash:
# freebsd forum
https://forums.freebsd.org/forums/-/index.rss
https://forums.freebsd.org/forums/howtos-and-faqs-moderated.39/index.rss

# freebsd now
https://www.youtube.com/feeds/videos.xml?playlist_id=PLUW3LUwQvegyqk2Iqi-YD7Do-AyD4W0s1
 
Top