Coder Social home page Coder Social logo

nvim-rss's Introduction


NVIM-RSS

A simple rss reader for neovim written in lua.


Intro

nvim-rss aims to be similar to the excellent vnews and, if you squint hard enough while looking sideways, then perhaps elfeed.

Ideally, if you have a bunch of feeds and simply wish to view the latest entries in neovim instead of browsers or dedicated apps, then this plugin should help you out.

Demo (v0.2)

nvim-rss-v0.2.mp4

Pre-requisites

  1. neovim
  2. curl | Usually pre-installed on most systems
  3. sqlite3 | Usually pre-installed on some systems
  4. tami5/sqlite.lua | Either as plugin or luarock
  5. tomasguisasola/luaexpat | From luarocks

Installation

Tested on linux, may work on macos. Probably won't work on windows.

If using packer.nvim (recommended) then

use {
  "empat94/nvim-rss",
  requires = { "tami5/sqlite.lua" },
  rocks = { "luaexpat" },
  config = function() require("nvim-rss").setup({...}) end
}

Else if using vim-plug then

Plug `tami5/sqlite.lua`

Plug 'empat94/nvim-rss'
luarocks install luaexpat
lua << EOF
  require("nvim-rss").setup({...})
EOF

Else your usual way of installing plugins and luarocks

Setup

require("nvim-rss").setup({   -- set nothing to use defaults

  feeds_dir = "/home/user",   -- ensure has write permissions (use full path to dir)

  date_format = "%x %r",      -- man date for more formats; updates when feed is refreshed

})

If using init.vim, wrap the code inside lua << EOF ... EOF

Usage

By default, no mappings/commands present. All functions are exposed so you may use them as you like!

  • Open RSS file: open_feeds_tab()

    Opens nvim.rss file where all the feeds are listed. By default ~/nvim.rss, see Setup to change default dir.

  • Fetch and view a feed: fetch_feed()

    Pulls updates for the feed under cursor and opens a vertical split to show the entries.

  • Fetch feeds by category: fetch_feeds_by_category()

    Pulls update for all feeds in the category (paragraph) under cursor.

  • Fetch feeds by visual range: fetch_selected_feeds()

    Pulls update for all feeds that are selected in visual range.

  • Fetch all feeds: fetch_all_feeds()

    Fetches data for all feeds in nvim.rss and updates the corresponding counts if nvim.rss is loaded in a buffer.

  • View a feed: view_feed()

    Opens entries for feed under cursor in a vertical split. This does not fetch data from server, instead pulling stored content from database.

  • Clean a feed: clean_feed()

    Removes all entires associated with a particular feed. Useful if you are encountering SQL errors.

  • Reset everything: reset_db()

    Truncates all tables. Use with caution. Might be useful when there is an unforeseen db-related error occurs. If this doesn't work, delete nvim.rss.db and restart neovim instance.

  • Import OPML file: import_opml(opml_file)

    Parses the supplied file, extracts feed links if they exist and dumps them under "OPML Import" inside nvim.rss. They are not added to database unless you explicitly fetch feeds for the links!


To use above functions, write the usual mapping or command syntax. Example -

vim.cmd [[ -- no need for vim.cmd if vim file

  command! OpenRssView lua require("nvim-rss").open_feeds_tab()

  command! FetchFeed lua require("nvim-rss").fetch_feed()

  command! FetchAllFeeds lua require("nvim-rss").fetch_all_feeds()

  command! FetchFeedsByCategory lua require("nvim-rss").fetch_feeds_by_category()

  command! -range FetchSelectedFeeds lua require("nvim-rss").fetch_selected_feeds()

  command! ViewFeed lua require("nvim-rss").view_feed()

  command! CleanFeed lua require("nvim-rss").clean_feed()

  command! ResetDB lua require("nvim-rss").reset_db()

  command! -nargs=1 ImportOpml lua require("nvim-rss").import_opml(<args>)

]]

NOTE: The command ImportOpml requires a full path and surrounding quotes.

:ImportOpml "/home/user/Documents/rss-file.opml"

Checkout my feeds list here

Todos

  • Star favourite entries
  • OPML export
  • Console browser (lynx, w3m) integration
  • Most viewed, most recent, favorite feeds view
  • Highlight entries (new, read, starred)
  • Windows support

Personal Goals

  1. Learn lua (I plan to make a few more plugins!)
  2. Learn how to make a neovim plugin
  3. Contribute to the awesome neovim ecosystem
  4. Share some open-source love <3

nvim-rss's People

Contributors

empat94 avatar

Stargazers

Kento Okura avatar hitsz-qfy avatar Daniel avatar Guilherme avatar kekscode avatar Rolf avatar oeyoews avatar Will Hopkins avatar Aquib Javed avatar Kshamendra avatar Tomo avatar ldz avatar Nícolas Catarina Parreiras avatar  avatar AYOUB EL MHAMDI avatar  avatar

Watchers

James Cloos avatar  avatar

nvim-rss's Issues

Error when installing on ubuntu

Using this in packer:
use {
"empat94/nvim-rss",
requires = { "tami5/sqlite.lua" },
rocks = { "luaexpat" },
config = function() require("nvim-rss").setup({}) end
}

Hitting this error on load:
packer.nvim: Error running config for nvim-rss: ...im/site/pack/packer/start/sqlite.lua/lua/sqlite/defs.lua:31: libsqlite3.so: cannot open shared object file: No such file or directory

Running on Ubuntu 22 on Windows WSL

Ability to view entries beyond simple excerpts

Currently, opening a feed shows entries' excerpts in a vertical split. If the full entry is to be read, the link must be opened in a browser.

Need to see if it is possible to get full content of the entry and view it within neovim (or optionally open the same in browser) or open the link itself in a terminal browser like lynx. Either way, it must be possible to open the full entry using a function defined inside nvim-rss.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.