nvimcord
nvimcord copied to clipboard
Another Neovim Discord RPC plugin
nvimcord
A Discord Rich Presence plugin for Neovim written in Lua.
Installation
lazy.nvim
{
'ObserverOfTime/nvimcord',
opts = {
...
}
}
pckr.nvim
{
'ObserverOfTime/nvimcord',
config = function()
require('nvimcord').setup {
...
}
end
}
Configuration
These are the default values:
-- Start the RPC manually (boolean)
autostart = false
-- Set the client ID (string)
client_id = '954365489214291979'
-- Update workspace on chdir (boolean)
dynamic_workspace = false
-- Use the filetype as the large icon (boolean)
large_file_icon = true
-- Set the log level (vim.log.levels.*)
log_level = vim.log.levels.INFO
-- Get the workspace name (function|string)
workspace_name = function()
return --[[git root or cwd basename]]
end
-- Get the workspace URL (function|string)
workspace_url = function()
return --[[git remote URL]]
end
Options can also be configured using Vim variables.
This can be useful when using exrc or a project plugin.
let g:nvimcord#autostart = v:false
let g:nvimcord#client_id = '954365489214291979'
let g:nvimcord#dynamic_workspace = v:false
let g:nvimcord#large_file_icon = v:true
let g:nvimcord#log_level = 2
" NOTE: these can only be defined as strings
let g:nvimcord#workspace_name = ''
let g:nvimcord#workspace_url = ''
Filetypes
local fts = require 'nvimcord.filetypes'
-- NOTE: the asset can also be an image URL
-- override options
fts.filetype['vim'].name = 'Vim Script'
fts.filetype['vim'].asset = 'neovim'
-- new filetype
fts.filetype['teal'] = {name = 'Teal', asset = 'lua'}
-- new pattern
fts.pattern['^%.gitkeep$'] = {name = 'git keep', asset = 'git'}
-- ignore filetype
fts.ignore.filetype['vim'] = true
-- ignore filename
fts.ignore.filename['init.vim'] = true
Commands
:NvimcordUpdate
Start or update the rich presence.
:NvimcordStop
Stop the rich presence.
:NvimcordFiletypes
List the supported filetypes.
:NvimcordAssets
List the supported assets.
TODO
- [x] Ignore by filename
- [ ] Cache filename patterns
- [x] Detect workspace through git
- [x] Warn when pipe doesn't exist
- [ ] Set idle status after some time
Assets
The assets are available here.
Sources
Palette
The icons use the basic colours from file-icons/atom.
red
green
yellow
blue
maroon
purple
orange
cyan
pink
grey
Alternatives
- lpturmel/discord.nvim (Lua + Rust)
- IogaMaster/neocord (Lua)
- Cyuria/discord.nvim (Lua + C++)
- andweeb/presence.nvim (Lua)
- aurieh/discord.nvim (Remote Python)
- Stoozy/vimcord Python
- sardonicism-04/nvim-rich-presence (VimL + Rust)
- LeonardSSH/coc-discord-rpc (TypeScript)
- vbe0201/vimdiscord (Python)
- goopey7/vdrpc (VimL + C)
- amiralies/coc-discord (TypeScript)
- SamJakob/coc-discord-presence (TypeScript)
- GabeFrahm/vim-presence (Python)
- TCL100K/vim-discord-rpc (Python)