Code Monkey home page Code Monkey logo

presence.nvim's Introduction

presence.nvimโ€‹

Features | Installation | Configuration | Troubleshooting | Development | Contributing

Discord Rich Presence plugin for Neovim

demo.gif

Features

  • Light and unobtrusive
  • No Python/Node providers (or CoC) required
  • Cross-platform support: macOS, nixOS, Linux*, Windows*, WSL*
  • Startup time is fast(er than other Rich Presence plugins, by kind of a lot)
  • Written in Lua and highly configurable in Lua (but also configurable in VimL if you want)
  • Manages Rich Presence across multiple Neovim instances in various environments (tmux panes/windows, ssh sessions, terminal tabs/windows, etc.)

Installation

Use your favorite plugin manager

Notes

  • Requires Neovim 0.5 or higher
  • Rich Presence should work automatically after installation (unless you're using WSL, in which case see here)
  • If you're using an unofficial Discord package on Linux (flatpak, snap, etc.), you may need to follow some instructions to expose the Discord socket on your system (e.g. flatpak instructions)

Configuration

Configuration is not necessary for Rich Presence to work. But for those that want to override the default configs, the following options are available to configure in either Lua or VimL.

Lua

Require the plugin and call setup with a config table with one or more of the following keys:

-- The setup config table shows all available config options with their default values:
require("presence").setup({
    -- General options
    auto_update         = true,                       -- Update activity based on autocmd events (if `false`, map or manually execute `:lua package.loaded.presence:update()`)
    neovim_image_text   = "The One True Text Editor", -- Text displayed when hovered over the Neovim image
    main_image          = "neovim",                   -- Main image display (either "neovim" or "file")
    client_id           = "793271441293967371",       -- Use your own Discord application client id (not recommended)
    log_level           = nil,                        -- Log messages at or above this level (one of the following: "debug", "info", "warn", "error")
    debounce_timeout    = 10,                         -- Number of seconds to debounce events (or calls to `:lua package.loaded.presence:update(<filename>, true)`)
    enable_line_number  = false,                      -- Displays the current line number instead of the current project
    blacklist           = {},                         -- A list of strings or Lua patterns that disable Rich Presence if the current file name, path, or workspace matches
    buttons             = true,                       -- Configure Rich Presence button(s), either a boolean to enable/disable, a static table (`{{ label = "<label>", url = "<url>" }, ...}`, or a function(buffer: string, repo_url: string|nil): table)
    file_assets         = {},                         -- Custom file asset definitions keyed by file names and extensions (see default config at `lua/presence/file_assets.lua` for reference)
    show_time           = true,                       -- Show the timer

    -- Rich Presence text options
    editing_text        = "Editing %s",               -- Format string rendered when an editable file is loaded in the buffer (either string or function(filename: string): string)
    file_explorer_text  = "Browsing %s",              -- Format string rendered when browsing a file explorer (either string or function(file_explorer_name: string): string)
    git_commit_text     = "Committing changes",       -- Format string rendered when committing changes in git (either string or function(filename: string): string)
    plugin_manager_text = "Managing plugins",         -- Format string rendered when managing plugins (either string or function(plugin_manager_name: string): string)
    reading_text        = "Reading %s",               -- Format string rendered when a read-only or unmodifiable file is loaded in the buffer (either string or function(filename: string): string)
    workspace_text      = "Working on %s",            -- Format string rendered when in a git repository (either string or function(project_name: string|nil, filename: string): string)
    line_number_text    = "Line %s out of %s",        -- Format string rendered when `enable_line_number` is set to true (either string or function(line_number: number, line_count: number): string)
})

VimL

Or if global variables are more your thing, you can use any of the following instead:

" General options
let g:presence_auto_update         = 1
let g:presence_neovim_image_text   = "The One True Text Editor"
let g:presence_main_image          = "neovim"
let g:presence_client_id           = "793271441293967371"
let g:presence_log_level
let g:presence_debounce_timeout    = 10
let g:presence_enable_line_number  = 0
let g:presence_blacklist           = []
let g:presence_buttons             = 1
let g:presence_file_assets         = {}
let g:presence_show_time           = 1

" Rich Presence text options
let g:presence_editing_text        = "Editing %s"
let g:presence_file_explorer_text  = "Browsing %s"
let g:presence_git_commit_text     = "Committing changes"
let g:presence_plugin_manager_text = "Managing plugins"
let g:presence_reading_text        = "Reading %s"
let g:presence_workspace_text      = "Working on %s"
let g:presence_line_number_text    = "Line %s out of %s"

Troubleshooting

  • Ensure that Discord is running
  • Ensure that your Neovim version is 0.5 or higher
  • Ensure Game Activity is enabled in your Discord settings
  • Enable logging and inspect the logs after opening a buffer
  • If there is a Failed to determine Discord IPC socket error, your particular OS may not yet be supported
    • If you don't see an existing issue or card for your OS, create a prefixed issue (e.g. [Void Linux])
  • Still not working and need help? Create a new issue!

Development

  • Clone the repo: git clone https://github.com/andweeb/presence.nvim.git
  • Enable logging and ensure that presence.nvim is not in the list of vim plugins in your config
  • Run nvim with your local changes: nvim --cmd 'set rtp+=path/to/your/local/presence.nvim' file.txt
  • Ensure that there are no luacheck errors: luacheck lua

Contributing

Pull requests are very welcome, feel free to open an issue to work on any of the open todo items or message droob#1322 on Discord!

Asset additions and changes are also welcome! Supported file types can be found in file_assets.lua and their referenced asset files can be found in this folder.

presence.nvim's People

Contributors

andweeb avatar brw avatar coryshaw1 avatar initial1ze avatar kylechui avatar mcauley-penney avatar minebill avatar nullishamy avatar saecki avatar sitiom avatar vhyrro avatar williamwelsh avatar withs avatar wuelnerdotexe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

presence.nvim's Issues

Add support for ssh remote urls

When editing a file in a repository with a ssh remote url like [email protected]:owner/repo, this plugin fails to add the view repository button, because it isn't a valid uri:
[presence.nvim] Failed to set activity in Discord: Received error event - child "activity" fails because [child "buttons" fails because ["buttons" at position 0 fails because [child "url" fails because ["url" must be a valid uri]]]] (code 4000)

As a result no rich presence status is shown at all.

Nvim hangs after closing if Telescope is opened while Presence is running but Discord isn't

Hi! This is the weirdest issue I've ever written. Let's give it a try!

First of all, here are my dotfiles in case you want to try them to replicate the error. Here's how to reproduce the error:

  • Open an nvim session with Presence and Telescope plugins while there are no Discord processes runing.
  • Open any Telescope window (like Telescope find_files).
  • Close the Telescope window either by escaping or by selecting a result.
  • Quit nvim.
  • The interface closes but the process in hung indefinitely and has to be ^C killed.

I've tried opening Discord to see the plugin's output when using Telescope but I've found that it doesn't hang after closing if Discord is open. What's also curious is that it doesn't hang if I open Discord before opening Telescope. My guess here is that Presence is trying to keep the RPC connection open or that it can't close it at all, but that's just a hunch.

I know this is a very weird edge case, so don't worry if it can't be fixed or it's set as the lowest priority issue :)

Stop sending updates after x time of idling

Hello, would it be possible to add a setting to stop sending updates to discord presence after x seconds/minutes of idling?

Thank you for doing my previous request so quickly ๐Ÿ˜

only works when i use nerdtree for example

I just installed it but it didn't work. I left it installed and realized that it only works when I use nerdtree or :PlugStatus for example.

i use Manjaro linux.
NVIM v0.5.0
config presence:
let g:presence_auto_update = 1
let g:presence_log_level = "debug"

log:
[presence.nvim] Currently authorizing with Discord, scheduling callback for late
r...
[presence.nvim] Not canceling presence due to switching to a window within the s
ame instance...
[presence.nvim] Currently authorizing with Discord, scheduling callback for late
r...
[presence.nvim] Parsed filename init.vim with vim extension
[presence.nvim] Getting project name for /home/enzotorr/.config/nvim...
[presence.nvim] Not a git repository, skipping...
[presence.nvim] Setting activity for /home/enzotorr/.config/nvim/init.vim...
[presence.nvim] Using file asset: { "Vim", "vim" }
[presence.nvim] No project detected
[presence.nvim] Sync activity to all peers...
[presence.nvim] Setting Discord activity...
[presence.nvim] Activity already set for /home/enzotorr/.config/nvim/init.vim, s
kipping...
[presence.nvim] Wrote message to pipe
[presence.nvim] Set activity in Discord for init.vim
[presence.nvim] Handling FocusGained event...
[presence.nvim] Currently authorizing with Discord, scheduling callback for late
r...
[presence.nvim] Activity already set for /home/enzotorr/.config/nvim/init.vim, s
kipping...
r...
[presence.nvim] Parsed filename NERD_tree_1 with no extension
[presence.nvim] Getting project name for /home/enzotorr/.config/nvim...
[presence.nvim] Not a git repository, skipping...
[presence.nvim] Setting activity for /home/enzotorr/.config/nvim/NERD_tree_1...
[presence.nvim] No project detected
[presence.nvim] Sync activity to all peers...
[presence.nvim] Setting Discord activity...
[presence.nvim] Activity already set for /home/enzotorr/.config/nvim/NERD_tree_1
, skipping...
[presence.nvim] Activity already set for /home/enzotorr/.config/nvim/NERD_tree_1
, skipping...
[presence.nvim] Activity already set for /home/enzotorr/.config/nvim/NERD_tree_1
, skipping...
[presence.nvim] Activity already set for /home/enzotorr/.config/nvim/NERD_tree_1
, skipping...
[presence.nvim] Wrote message to pipe
[presence.nvim] Activity already set for /home/enzotorr/.config/nvim/NERD_tree_1
, skipping...
[presence.nvim] Set activity in Discord for NERD_tree_1
[presence.nvim] Handling WinLeave event...
[presence.nvim] Handling WinEnter event...
[presence.nvim] Handling BufEnter event...
[presence.nvim] Set activity in Discord for init.vim
[presence.nvim] Got nvim socket paths: {}
[presence.nvim] No other remote nvim instances
[presence.nvim] Handling WinLeave event...
[presence.nvim] Handling WinEnter event...
[presence.nvim] Handling BufAdd event...
[presence.nvim] Handling BufEnter event...
[presence.nvim] Currently authorizing with Discord, scheduling callback for late
r...
[presence.nvim] Handling BufAdd event...
[presence.nvim] Handling BufEnter event...
[presence.nvim] Currently authorizing with Discord, scheduling callback for late
r...
[presence.nvim] Handling TextChanged event...
[presence.nvim] Currently authorizing with Discord, scheduling callback for late
r...
[presence.nvim] Not canceling presence due to switching to a window within the s
ame instance...
[presence.nvim] Currently authorizing with Discord, scheduling callback for late
r...
[presence.nvim] Currently authorizing with Discord, scheduling callback for late
r...
[presence.nvim] Currently authorizing with Discord, scheduling callback for late

[Arch Linux] When opening multiple instances of neovim, and keeping them open presence.nvim shows the first opened instance in Discord

Description

presence.nvim shows the first opened (and still open) instance of nvim, not the most recently interacted with

Solution
I would like some configurable setting as a threshold to switch to the more recently interacted instance. A sane default would be something like 20-30 seconds, so that opening a config file or something similar for a few seconds does not trigger switching.

Neovim version

NVIM v0.7.0-dev+923-gecec95712
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3

OS information

Arch Linux

Steps to reproduce

  1. Setup nvim.presence with default settings
  2. Open nvim with a random file (keep this instance running)
  3. Open a second instance with a different file
  4. Notice how Discord is still showing the file from 2., no matter how long you use the instance of 3. (it does switch if you close the instance of 2.)

Logs

As reported in #52 (thanks @Gilgames000!):

Logs from the first instance I opened:

[presence.nvim] Setting up plugin for linux
[presence.nvim] Using runtime path: /run/user/1000
[presence.nvim] Using Discord IPC socket path: /run/user/1000/discord-ipc-0
[presence.nvim] Checking Discord IPC socket at /run/user/1000/discord-ipc-0...
[presence.nvim] Using id 33a37ae3-377b-40fe-8529-6e63b70ffce9
[presence.nvim] Completed plugin setup
[presence.nvim] Getting nvim socket paths...
[presence.nvim] Executing command: `netstat -u|grep --color=never "nvim.*/0"`
[presence.nvim] Checked Discord IPC socket, looks good!
[presence.nvim] Handling BufEnter event...
[presence.nvim] Connecting to Discord...
[presence.nvim] Connected to Discord
[presence.nvim] Authorizing with Discord...
[presence.nvim] Handling FocusGained event...
[presence.nvim] Skipping presence update for FocusGained event triggered by tmux...
[presence.nvim] Wrote message to pipe
[presence.nvim] Got nvim socket paths: {}
[presence.nvim] No other remote nvim instances
[presence.nvim] Authorized with Discord for Gilgames
[presence.nvim] Parsed filename foo with no extension
[presence.nvim] Getting project name for /home/gilgames/presence-test1...
[presence.nvim] Not a git repository, skipping...
[presence.nvim] Setting activity for /home/gilgames/presence-test1/foo...
[presence.nvim] No project detected
[presence.nvim] Sync activity to all peers...
[presence.nvim] Setting Discord activity...
[presence.nvim] Wrote message to pipe
[presence.nvim] Set activity in Discord for foo

Then I switched to another tmux session and opened another neovim instance:



[presence.nvim] Setting up plugin for linux
[presence.nvim] Using runtime path: /run/user/1000
[presence.nvim] Using Discord IPC socket path: /run/user/1000/discord-ipc-0
[presence.nvim] Checking Discord IPC socket at /run/user/1000/discord-ipc-0...
[presence.nvim] Using id dd6d178c-01e7-4e81-bb0c-14ec72e08018
[presence.nvim] Completed plugin setup
[presence.nvim] Getting nvim socket paths...
[presence.nvim] Executing command: `netstat -u|grep --color=never "nvim.*/0"`
[presence.nvim] Checked Discord IPC socket, looks good!
[presence.nvim] Handling BufEnter event...
[presence.nvim] Connecting to Discord...
[presence.nvim] Connected to Discord
[presence.nvim] Authorizing with Discord...
[presence.nvim] Handling FocusGained event...
[presence.nvim] Skipping presence update for FocusGained event triggered by tmux...
[presence.nvim] Wrote message to pipe
[presence.nvim] Got nvim socket paths: {}
[presence.nvim] No other remote nvim instances
[presence.nvim] Authorized with Discord for Gilgames
[presence.nvim] Parsed filename bar with no extension
[presence.nvim] Getting project name for /home/gilgames/presence-test2...
[presence.nvim] Not a git repository, skipping...
[presence.nvim] Setting activity for /home/gilgames/presence-test2/bar...
[presence.nvim] No project detected
[presence.nvim] Sync activity to all peers...
[presence.nvim] Setting Discord activity...
[presence.nvim] Wrote message to pipe
[presence.nvim] Set activity in Discord for bar

but discord was still showing that I am editing foo on the first instance. So then I went back to the first one and closed it, switched back to the second instance and those lines appeared in the logs:

[presence.nvim] Handling FocusGained event...
[presence.nvim] Activity already set for /home/gilgames/presence-test2/bar, skipping...
[presence.nvim] Handling FocusGained event...
[presence.nvim] Activity already set for /home/gilgames/presence-test2/bar, skipping...
[presence.nvim] Handling FocusGained event...
[presence.nvim] Activity already set for /home/gilgames/presence-test2/bar, skipping...
[presence.nvim] Handling FocusGained event...
[presence.nvim] Activity already set for /home/gilgames/presence-test2/bar, skipping...
[presence.nvim] Handling FocusGained event...
[presence.nvim] Activity already set for /home/gilgames/presence-test2/bar, skipping...

Doesn't Work

When i open nvim, it says in the at the bottum:

[presence.nvim] no other nvim instances

but if i run any shortcut even in nvim such as dd it says:

[presence.nvim] Failed to connect to Discord: ENOENT

heres the logs

[presence.nvim] Setting up plugin for linux
[presence.nvim] Using runtime path: /run/user/1000
[presence.nvim] Using Discord IPC socket path: /run/user/1000/discord-ipc-0
[presence.nvim] Checking Discord IPC socket at /run/user/1000/discord-ipc-0...
[presence.nvim] Using id 773772b6-c6f2-40b5-9ecf-69fa290ebe53
[presence.nvim] Failed to get socket information: ENOENT: no such file or directory: /run/user/1000/discord-ipc-0
[presence.nvim] Completed plugin setup
[presence.nvim] Getting nvim socket paths...
[presence.nvim] Executing command: `ss -lx|grep "nvim.*/0"`
[presence.nvim] Custom setup not detected, using defaults
[presence.nvim] Handling BufEnter event...
[presence.nvim] Connecting to Discord...
[presence.nvim] Failed to connect to Discord: ENOENT
[presence.nvim] Got nvim socket paths: {}
[presence.nvim] No other remote nvim instances
[presence.nvim] Handling FocusGained event...
[presence.nvim] Connecting to Discord...
[presence.nvim] Failed to connect to Discord: ENOENT
[presence.nvim] Handling FocusGained event...
[presence.nvim] Connecting to Discord...
[presence.nvim] Failed to connect to Discord: ENOENT
[presence.nvim] Handling FocusGained event...
[presence.nvim] Connecting to Discord...
[presence.nvim] Failed to connect to Discord: ENOENT
[presence.nvim] Handling FocusGained event...
[presence.nvim] Connecting to Discord...
[presence.nvim] Failed to connect to Discord: ENOENT
[presence.nvim] Handling FocusGained event...
[presence.nvim] Connecting to Discord...

Im running Kubuntu no wsl stuff what is the issue?

Add support for icon themes

The current icon seem to be not beautiful, can we have icon from material or someway to custom the icon. I would be nice if we can have other icon themes.

Add commands that toggle presence

Is there a way to enable/disable the presence without uninstalling/installing the plugin? Something such as :PresenceEnable, :PresenceDisable or :PresenceToggle.

Allow configuring a custom main image with a custom Discord app client id

Description

I don't know what's wrong, I changed the Client ID and the main image and stuff but the image doesn't load on the presence. I already uploaded an image with the same name as the main image and the image size is 512x512 (the minimum file size) but it still didn't work.

Client ID: 940986515591417917
Main Image: largeshino

I don't know if I'm doing it wrong but I use the VimL

let g:presence_auto_update         = 1
let g:presence_neovim_image_text   = "Coding"
let g:presence_main_image          = "largeshino"
let g:presence_client_id           = "940986515591417917"
let g:presence_debounce_timeout    = 10
let g:presence_enable_line_number  = 0
let g:presence_blacklist           = []
let g:presence_buttons             = 1
let g:presence_file_assets         = {}

" Rich Presence text options
let g:presence_editing_text        = "Editing %s"
let g:presence_file_explorer_text  = "Browsing %s"
let g:presence_git_commit_text     = "Committing changes"
let g:presence_plugin_manager_text = "Managing plugins"
let g:presence_reading_text        = "Reading %s"
let g:presence_workspace_text      = "Working on %s"
let g:presence_line_number_text    = "Line %s out of %s"

I put this inside my nvim config file because I don't know where to put it. Other things works like the title and stuff but the image doesn't.

Neovim version

NVIM v0.7.0-dev+1018-g8215c0594
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3

OS information

Windows 11 Home Insider Preview 22543.1000

Steps to reproduce

  1. Make new application in https://discord.com/developers/applications

  2. Upload Image

  3. Copy Client Id

  4. Go to neovim config file (~/AppData/Local/nvim/init.vim)

  5. Paste let g:presence_auto_update = 1
    let g:presence_neovim_image_text = "Coding"
    let g:presence_main_image = "largeshino"
    let g:presence_client_id = "940986515591417917"
    let g:presence_debounce_timeout = 10
    let g:presence_enable_line_number = 0
    let g:presence_blacklist = []
    let g:presence_buttons = 1
    let g:presence_file_assets = {}

    " Rich Presence text options
    let g:presence_editing_text = "Editing %s"
    let g:presence_file_explorer_text = "Browsing %s"
    let g:presence_git_commit_text = "Committing changes"
    let g:presence_plugin_manager_text = "Managing plugins"
    let g:presence_reading_text = "Reading %s"
    let g:presence_workspace_text = "Working on %s"
    let g:presence_line_number_text = "Line %s out of %s"

  6. Save and close

  7. Run a file with nvim

  8. Check Discord

Logs

I'm sorry but where do I check logs?

I don't quite understand the prompt: The full list of :messages from one or more nvim instances

[EndeavourOS / Arch Linux] Opening file with NERDTree does not work

Hi again :) Okay so im having another issue now D:
Running only nvim and selecting the file I want to edit with the NERDTree plugin, I get this error

[presence.nvim] Activity already set for /home/roby/NERD_tree_1, skipping... [presence.nvim] Activity already set for /home/roby/NERD_tree_1, skipping... [presence.nvim] Activity already set for /home/roby/NERD_tree_1, skipping... [presence.nvim] Setting activity for /home/roby/frontend/tests/e2e/specs/files/avatar.spec.js... [presence.nvim] Parsed filename avatar.spec.js with js extension [presence.nvim] Using file asset: { "JavaScript", "javascript" } [presence.nvim] Detected project: frontend [presence.nvim] Failed to set activity in Discord: Pipe write error - EPIPE [presence.nvim] Pipe was closed Press ENTER or type command to continue

Running nvim frontend/tests/e2e/specs/file.js worked tho!
Is there anyway to make it work with the NERDTree aswell?

Presence not opening

The presence installed just fine. However, on Discord, it doesn't show the presence on my user. I'm using NeoVim on my Windows machine, but I'm using a Linux terminal.

I turned the activity status on, I made sure Discord was running, and I'm using NeoVim 5.1.

[Error] Error executing vim.schedule lua callback: Vim:E731: using Dictionary as a String

I'm getting the following error again and again, if I start using presence.nvim:

Error executing vim.schedule lua callback: Vim:E731: using Dictionary as a String

which is pretty annoying. Here are my settings:

local presence = require("presence")

presence:setup ({
    auto_update         = true,
    neovim_image_text   = "Vimming makes fun :)",
    main_image          = "neovim",
    client_id           = "793271441293967371",
    log_level           = nil,
    debounce_timeout    = 10,
    enable_line_number  = true,

    -- Rich Presence text options
    editing_text        = "Vimming %s",
    file_explorer_text  = "Browsing %s",
    git_commit_text     = "Committing changes",
    plugin_manager_text = "Managing plugins",
    reading_text        = "Reading %s",
    workspace_text      = "Working on %s",
    line_number_text    = "Line %s out of %s",
})

[Bug] Startify gives error "Pipe was closed" and no presence

Hi,

I use the Startify plugin, and whenever I open Neovim into Startify, I get the log error "Pipe was closed". I assume this might be because Startify does not have a proper "filename"/"filetype". I tried digging around in your code to fix this myself, but couldn't figure it out. Would love a fix for this so that I can get presence again :). Btw, I think this worked previously, and only recently stopped working.

Retain elapsed time across events

Hello! Have you ever considered adding an option to retain elapsed time across events?

Currently, the elapsed time will always reset whenever the focus is moved from buffer X to buffer Y and so on. With the option set, the elapsed time will instead keep on going regardless of the events.

[Gentoo] im getting a lot of errors and i dont know why

Error executing vim.schedule lua callback: ...are/nvim/plugged/presence.nvim/lua/presence/init.lua:768: bad argument #2 to 'format' (strin
g expected, got nil)                                                                                                                      
stack traceback:                                                                                                                          
        [C]: in function 'format'                                                                                                         
        ...are/nvim/plugged/presence.nvim/lua/presence/init.lua:768: in function 'update_for_buffer'                                      
        ...are/nvim/plugged/presence.nvim/lua/presence/init.lua:946: in function <...are/nvim/plugged/presence.nvim/lua/presence/init.lua:
945>                                                                                                                                      
Press ENTER or type command to continue

how would i fix this?

[Bug] Presence does not show up on Discord on initial nvim startup

Hi,
I recently installed presence.nvim on Neovim v0.5.0-dev+1354-ga282a177d. Running :messages gave me no visible errors and indicated that everything is working properly but when actually coming onto discord, no presence can be seen.

Here's my :messages:

image

Here's what is happening on Discord:

image

Any ideas on fixing it or at least debugging what went wrong?

Using Discord RPC on WSL2

I've been using instructions from this gist for a while now. It works except some occasional bugs. I think this can be put in the wiki.

EDIT:
I just realized that was the exact instructions for WSL1. That's mean it works for both systems.

Suddenly stops

The rich presence suddenly disappears, how can I debug that?

Also, any commands to restart the plugin?

Where do you set the "Neovim" title

Hi,

Could you point me to where in the code is the title "Neovim" set?

image

I would like to change it, as far as i know this is not an option so i need to do it manually in code?

[Bug] Status not updating after closing file explorer

OS: Ubuntu 20.04
Latest nightly of Neovim

When I open Nvim-tree.lua, my status updates to say Editing NvimTree, as expected. However, when I close the tree, it doesn't automatically revert back to the file that I have open. Rather, I have to edit the file that I have open and delete text before it registers that I'm no longer in the file tree. For example, I would need to delete a few words from test.lua before it would say Editing test.lua, otherwise it would stay as Editing NvimTree.

Side feature request: Can we have a LaTeX logo for .tex files as well?

Workspace section not showing up in discord

Hello,
I really like this plugin.
However, the workspace part of the discord RP doesn't seem to be working for me.
I am using neovim nightly and on macOS.

Thanks for the help.

[presence.nvim] Failed to connect to Discord: ENOENT

I just installed the plugin using vim-plug and i always get this error (debug mode):
[presence.nvim] Failed to connect to Discord: ENOENT

versions:
NVIM v0.6.0-dev
Discord 0.0.15
Lua 5.1.5

rpc works with other programs so i think thats not the issue

Yaml files support

Hello I was just wondering if you could add yaml support because I don't see it in the asset folder.

Thank you

[NixOS] External command failed when looking for Nvim socket paths

Behaviour

RPC does not work at all, likely due to quarks in NixOS

Logs

Session restored from /home/enderger/.local/share/nvim/sessions/\%home\%enderger.vim
[presence.nvim] Setting up plugin for linux
[presence.nvim] Using runtime path: /run/user/1000
[presence.nvim] Using Discord IPC socket path: /run/user/1000/discord-ipc-0
[presence.nvim] Checking Discord IPC socket at /run/user/1000/discord-ipc-0...
[presence.nvim] Using id aadabdab-8a2c-46ab-ad84-a72bc963a6b5
[presence.nvim] Completed plugin setup
[presence.nvim] Getting nvim socket paths...
[presence.nvim] Executing command: `netstat -u|grep --color=never "nvim.*/0"`
[presence.nvim] Checked Discord IPC socket, looks good!
LSP[zls][Info] [notice-main] Using zig lib path '/nix/store/c0xdrg09c5xrgwz1q39c7hngpkrw07sk-zig-0.8.1/lib/zig'
LSP[zls][Info] [notice-main] zls initialized
LSP[zls][Info] [notice-main] Using offset encoding: utf16
[presence.nvim] Unable to get nvim socket paths: ^[[0m^[[1m^[[38;5;9merror^[[0m^[[1m: External command failed^[[0m
[presence.nvim] Got nvim socket paths: {}
[presence.nvim] No other remote nvim instances

[EndeavourOS / Arch Linux] Did not work "out of the box"

Hello, I have installed this plugin with Plug for my Neovim, but for some reason, nothing really happened.
What should I really do? (Linux)

Yes, I am running Neovim 0.5

โฏ nvim -v NVIM v0.5.0-dev+1282-gfbe18d9ca Build type: RelWithDebInfo LuaJIT 2.1.0-beta3

Cargo file support, update Rust and Toml image

Preview:


Some note

As the title, i just made my own a place to save my custom assets for this repo. These image can be taken from drive or github. It would be appreciate if you could take a look and update what is missing or change some default images.

Also, here is the client_id for anyone who want to see my custom image: 914799712794705961. Ye! only files that are currently supported works. ๐Ÿ˜‚

Thanks!

presence and multiple neovim instances/ tmux

I really like this plugin! It works great out of the box.

I'm using tmux to handle multiple projects and i'm switching between them constantly.
It seems like presence reports only from the neovim instance which was started first.

[Idea] Reorganising status code

I was doing some more thinking yesterday, and thought of adding new variables like reading_text and browsing_text to complement the existing editing_text. Then the get_status_text function could just return the corresponding variable depending on context, rather than repeatedly set editing_text. From my POV this has two main benefits:

  1. More customisability for the end user (as they can set more variables for more contexts)
  2. No need to deprecate editing_text, nor change any of the existing logic for the get_status_text function

Let me know what you think, and I'll start working on a test version of this code

Error when installing the plugin

As title says, new using neovim, but when I run/install again the plugin shows this error:

image

I didn't change anything or configure anything because it should work out of the box.

Any solution for this?

Not working

presence is not working here is my config file
1 -- The setup config table shows all available config options with their default values:
2 require("presence"):setup({
3 -- General options
4 auto_update = true, -- Update activity based on autocmd events (if false, map or manually execute :lua package.loaded.presence:update())
5 neovim_image_text = "The One True Text Editor", -- Text displayed when hovered over the Neovim image
6 main_image = "neovim", -- Main image display (either "neovim" or "file")
7 client_id = "793271441293967371", -- Use your own Discord application client id (not recommended)
8 log_level = nil, -- Log messages at or above this level (one of the following: "debug", "info", "warn", "error")
9 debounce_timeout = 10, -- Number of seconds to debounce events (or calls to :lua package.loaded.presence:update(<filename>, true))
10 enable_line_number = false, -- Displays the current line number instead of the current project
11 blacklist = {}, -- A list of strings or Lua patterns that disable Rich Presence if the current file name, path, or workspace matches
12 buttons = true, -- Configure Rich Presence button(s), either a boolean to enable/disable, a static table ({{ label = "<label>", url = "<url>" }, ...} , or a function(buffer: string, repo_url: string|nil): table)
13
14 -- Rich Presence text options
15 editing_text = "Editing %s", -- Format string rendered when an editable file is loaded in the buffer (either string or function(filename: string): string)
16 file_explorer_text = "Browsing %s", -- Format string rendered when browsing a file explorer (either string or function(file_explorer_name: string): string)
17 git_commit_text = "Committing changes", -- Format string rendered when committing changes in git (either string or function(filename: string): string)
18 plugin_manager_text = "Managing plugins", -- Format string rendered when managing plugins (either string or function(plugin_manager_name: string): string)
19 reading_text = "Reading %s", -- Format string rendered when a read-only or unmodifiable file is loaded in the buffer (either string or function(filename: string): s tring)
20 workspace_text = "Working on %s", -- Format string rendered when in a git repository (either string or function(project_name: string|nil, filename: string): string)
21 line_number_text = "Line %s out of %s", -- Format string rendered when enable_line_number is set to true (either string or function(line_number: number, line_count: number): string)
22 })

Add support for debuggers and allow configuring line number location

Amazing plugin and works pretty well. It offers more than any rpc for nvim. But is it possible to have more customization?

Ideas:

  • Change button label.
  • Display current line/total lines (may it be on details or lower details).
  • When using nvim-dap, display when debugging file.

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.