All Projects → rlch → github-notifications.nvim

rlch / github-notifications.nvim

Licence: other
Statusline + Telescope integration for viewing and interacting with GitHub notifications

Programming Languages

lua
6591 projects

Projects that are alternatives of or similar to github-notifications.nvim

Lualine.nvim
A blazing fast and easy to configure neovim statusline written in pure lua.
Stars: ✭ 198 (+182.86%)
Mutual labels:  statusline, neovim-plugin
feline.nvim
A minimal, stylish and customizable statusline for Neovim written in Lua
Stars: ✭ 867 (+1138.57%)
Mutual labels:  statusline, neovim-plugin
Lsp Status.nvim
Utility functions for getting diagnostic status and progress messages from LSP servers, for use in the Neovim statusline
Stars: ✭ 201 (+187.14%)
Mutual labels:  statusline, neovim-plugin
nvim-hardline
A simple Neovim statusline
Stars: ✭ 122 (+74.29%)
Mutual labels:  statusline, neovim-plugin
neovimfiles
My Neovim configuration written in Lua
Stars: ✭ 52 (-25.71%)
Mutual labels:  telescope, lualine
comment-box.nvim
✨ Clarify and beautify your comments using boxes and lines.
Stars: ✭ 91 (+30%)
Mutual labels:  neovim-plugin
fzf-checkout.vim
Manage branches and tags with fzf
Stars: ✭ 187 (+167.14%)
Mutual labels:  neovim-plugin
winshift.nvim
Rearrange your windows with ease.
Stars: ✭ 230 (+228.57%)
Mutual labels:  neovim-plugin
openrgb.nvim
Bring RGB to life in Neovim
Stars: ✭ 39 (-44.29%)
Mutual labels:  neovim-plugin
sad.nvim
Space Age seD in Neovim. A project-wide find and replace plugin for Neovim.
Stars: ✭ 38 (-45.71%)
Mutual labels:  neovim-plugin
stabilize.nvim
Neovim plugin to stabilize window open/close events.
Stars: ✭ 295 (+321.43%)
Mutual labels:  neovim-plugin
SimpleSnippets.vim
Simple snippet support for your Vim and Neovim
Stars: ✭ 86 (+22.86%)
Mutual labels:  neovim-plugin
critiq.vim
Github code reviews from Neovim
Stars: ✭ 69 (-1.43%)
Mutual labels:  neovim-plugin
telescope-repo.nvim
🦘 Jump into the repositories (git, mercurial…) of your filesystem with telescope.nvim, without any setup
Stars: ✭ 99 (+41.43%)
Mutual labels:  telescope
session-lens
A session-switcher extension for rmagatti/auto-session using Telescope.nvim
Stars: ✭ 143 (+104.29%)
Mutual labels:  neovim-plugin
onestatus
an api to customize tmux from vim
Stars: ✭ 82 (+17.14%)
Mutual labels:  neovim-plugin
bolt.nvim
⚡ Ultrafast multi-pane file manager for Neovim with fuzzy matching
Stars: ✭ 100 (+42.86%)
Mutual labels:  neovim-plugin
aerial.nvim
Neovim plugin for a code outline window
Stars: ✭ 485 (+592.86%)
Mutual labels:  neovim-plugin
hotpot.nvim
🍲 Carl Weathers #1 Neovim Plugin.
Stars: ✭ 183 (+161.43%)
Mutual labels:  neovim-plugin
tmuxjump.vim
A plugin to open file from file paths printed in sibling tmux pane
Stars: ✭ 50 (-28.57%)
Mutual labels:  telescope

github-notifications.nvim 🔔

A lightweight, unobstructive, yet WIP neovim plugin for viewing GitHub notifications in your statusline + Telescope popup. All requests are processed asynchronously, debounced and cached to ensure no delays in your UI! 🚀

Preview

Installation

Use your favourite package manager:

use {
  'rlch/github-notifications.nvim',
  config = [[require('config.github-notifications')]],
  requires = {
    'nvim-lua/plenary.nvim',
    'nvim-telescope/telescope.nvim',
  },
}

Getting Started

Using gh CLI (recommended)

Install the CLI and you're off!

Make sure you authenticate with gh auth login.

Using personal access token

Call setup with your personal access token with the Notifications scope. You can make one here.

local secrets = require 'secrets'

require('github-notifications').setup {
  username = secrets.username,
  token = secrets.token,
}

Default config:

local defaults = {
  username = nil, -- GitHub username
  token = nil, -- Your personal access token with `notifications` scope
  icon = '', -- Icon to be shown in statusline
  hide_statusline_on_all_read = true,
  hide_entry_on_read = false, -- Whether to hide the Telescope entry after reading (buggy)
  debounce_duration = 60, -- Minimum time until next refresh
  cache = false, -- Opt in/out of caching
  sort_unread_first = true,
  mappings = {
    mark_read = '<CR>',
    hide = 'd', -- remove from Telescope picker, but don't mark as read
    -- open_in_browser = 'o', (WIP)
  },
  prompt_mappings = {
    mark_all_read = '<C-r>'
  } -- keymaps that apply on a Telescope prompt level (insert mode)
}

Lua-based statusline

Statusline

I've only tested this with lualine, but it should work with any Lua-based statusline that takes a Lua function as an argument for displaying data.

require('lualine').setup {
  ...
  sections = {
    ...
    lualine_b = { 'branch', require('github-notifications').statusline_notification_count },
    ...
  },
  ...
}

You can also use statusline_notifications() and build your own formatter:

  local ghn_formatter = function()
    local data = require('github-notifications').statusline_notifications()
    if data.count > 10 then
      return data.icon .. ' purge time'
    elseif data.count == 0 then
      return ''
    end
    return data.icon .. tostring(data.count)
  end

Telescope

Optionally load the extension using:

require('telescope').load_extension 'ghn'

So that require('telescope').extensions.ghn.notifications() can open the popup.

Otherwise, you can simply call:

require('github-notifications.menu').notifications()

I'm aware my API design is abysmal

TODOs

  • Add support for CI status for current branch in statusline
  • Redirect to follow-up URL (instead of API url)
  • Refresh UI on state changes (i.e. when marking notifications as read)
  • Add highlights to Telescope entries
  • Improve Telescope preview UI instead of being lazy with markdown
  • Hide notifications without Telescope shitting itself

Contributing 👌

Please lmao

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].