Skip to content

Commit

Permalink
Merge branch 'main' into lazy-plugin-manager
Browse files Browse the repository at this point in the history
  • Loading branch information
Maritsu authored Apr 6, 2024
2 parents 49f1f94 + fee2f8d commit 8b18beb
Show file tree
Hide file tree
Showing 15 changed files with 2,432 additions and 2,106 deletions.
59 changes: 55 additions & 4 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,98 @@
name: Issue report
description: Report any errors, bugs, or unexpected behaviors related to presence.nvim
title: "[Bug]: "
labels: [bug]
assignees:
- jiriks74
body:
- type: markdown
attributes:
value: |
Before reporting, please search [existing issues](https://github.com/andweeb/presence.nvim/issues) and make sure that presence.nvim is updated to the latest version.
- type: checkboxes
attributes:
label: Are you on the latest version?
options:
- label: I have updated to the latest version.
required: true

- type: checkboxes
attributes:
label: Have you tried it with default config?
options:
- label: I have tried the default config.
required: true

- type: textarea
attributes:
label: "Description"
description: "A short summary of the error, bug, or unexpected behavior you're facing."
validations:
required: true

- type: textarea
attributes:
label: "Neovim version"
description: "Output of `nvim --version`"
render: markdown
placeholder: |
NVIM v0.6.0-dev+209-g0603eba6e
NVIM: v0.6.0-dev+209-g0603eba6e
Build type: Release
LuaJIT 2.1.0-beta3
LuaJIT: 2.1.0-beta3
value: |
NVIM:
Build type:
LuaJIT:
validations:
required: true

- type: input
attributes:
label: "OS information"
placeholder: "macOS 12.0.1"
validations:
required: true

- type: textarea
attributes:
label: "Steps to reproduce"
description: "Steps to reproduce the issue with your config(s) if applicable"
description: "Steps to reproduce the issue with your config(s) if applicable."
placeholder: |
1. Setup presence.nvim with `require("presence"):setup({...})`
2. Run Neovim with `nvim test.txt`
3. ...
validations:
required: true

- type: textarea
attributes:
label: "Logs"
description: "The full list of `:messages` from one or more `nvim` instances"
description: "The full list of `:messages` from one or more `nvim` instances.\nPlease insert the logs into code blocks."
placeholder: |
<details>
```
[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...
```
</details>
value: |
<details>
```
```
</details>
validations:
required: true

- type: textarea
attributes:
label: "Aditional info"
description: "If you'd like to add anything else put it here."
validations:
required: false
20 changes: 0 additions & 20 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

34 changes: 34 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Feature request
description: Report any errors, bugs, or unexpected behaviors related to presence.nvim
title: "[FEAT]: "
labels: [enhancement]
assignees:
- jiriks74
body:
- type: textarea
attributes:
label: Is your feature request related to a problem?
description: A clear and concise description of what the problem is. Ex. I'm always frustrated when...
validations:
required: true

- type: textarea
attributes:
label: Describe the solution you'd like
description: A clear and concise description of what you want to happen.
validations:
required: false

- type: textarea
attributes:
label: Describe alternatives you've considered
description: A clear and concise description of any alternative solutions or features you've considered.
validations:
required: false

- type: textarea
attributes:
label: Additional context
description: Add any other context or screenshots about the feature request here.
validations:
required: false
14 changes: 0 additions & 14 deletions .github/workflows/CI.yml

This file was deleted.

10 changes: 10 additions & 0 deletions .github/workflows/luacheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Luacheck
on: [push, pull_request]
jobs:
Luacheck:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Luacheck linter
uses: lunarmodules/luacheck@v1
15 changes: 15 additions & 0 deletions .github/workflows/stylua.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: StyLua
on: [push, pull_request]
jobs:
StyLuacheck:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: StyLua check
uses: JohnnyMorganz/stylua-action@v3
with:
token: ${{ secrets.GH_TOKEN }}
version: v0.18.2 # NOTE: we recommend pinning to a specific version in case of formatting changes
# CLI arguments
args: --check .
123 changes: 86 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,63 @@
<img src="https://gist.githubusercontent.com/andweeb/df3216345530234289b87cf5080c2c60/raw/8de399cfed82c137f793e9f580027b5246bc4379/presence.nvim.png" alt="presence.nvim">&#x200B;
# ![presence.nvim](https://gist.githubusercontent.com/andweeb/df3216345530234289b87cf5080c2c60/raw/8de399cfed82c137f793e9f580027b5246bc4379/presence.nvim.png)

**[Features](#features)** | **[Installation](#installation)** | **[Configuration](#configuration)** | **[Troubleshooting](#troubleshooting)** | **[Development](#development)** | **[Contributing](#contributing)**
This repository uses
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?logo=conventionalcommits&logoColor=white)](https://conventionalcommits.org)

**[Features](#features)** | **[Installation](#installation)** |
**[Configuration](#configuration)** | **[Troubleshooting](#troubleshooting)** |
**[Development](#development)** | **[Contributing](#contributing)**

> Discord [Rich Presence](https://discord.com/rich-presence) plugin for [Neovim](https://neovim.io)
<img src="https://gist.githubusercontent.com/andweeb/df3216345530234289b87cf5080c2c60/raw/ad916fec8de921d0021801a0af877a5349621e7e/presence-demo-a.gif" width="100%" alt="demo.gif">
![Presence demo](https://gist.githubusercontent.com/andweeb/df3216345530234289b87cf5080c2c60/raw/ad916fec8de921d0021801a0af877a5349621e7e/presence-demo-a.gif)

## Features
* Light and unobtrusive
* No Python/Node providers (or CoC) required
* Cross-platform support: macOS, nixOS, Linux[\*](#notes), Windows[\*](https://github.com/andweeb/presence.nvim/projects/1#card-60537963), WSL[\*](https://github.com/andweeb/presence.nvim/wiki/Rich-Presence-in-WSL)
* Startup time is fast(er than other Rich Presence plugins, by [kind of a lot](https://github.com/andweeb/presence.nvim/wiki/Plugin-Comparisons))
* Written in Lua and [highly configurable](#configuration) 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.)

- Light and unobtrusive
- No Python/Node providers (or CoC) required
- Cross-platform support: macOS, nixOS, Linux[\*](#notes),
Windows, WSL
- Startup time is fast(er than other Rich Presence plugins, by
[kind of a lot](https://github.com/andweeb/presence.nvim/wiki/Plugin-Comparisons))
- Written in Lua and [highly configurable](#configuration) 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.)
- Now with Flatpak support!

## Installation

Use your favorite plugin manager
* [vim-plug](https://github.com/junegunn/vim-plug): `Plug 'andweeb/presence.nvim'`
* [packer.nvim](https://github.com/wbthomason/packer.nvim): `use 'andweeb/presence.nvim'`

- [vim-plug](https://github.com/junegunn/vim-plug): `Plug 'jiriks74/presence.nvim'`
- [packer.nvim](https://github.com/wbthomason/packer.nvim): `use 'jiriks74/presence.nvim'`
- [lazy.nvim](https://github.com/folke/lazy.nvim):

```lua
{
'andweeb/presence.nvim',
event = 'UIEnter',
}
"jiriks74/presence.nvim",
event = "UIEnter",
},
```

#### Notes
* Requires [Neovim 0.5](https://github.com/neovim/neovim/releases/tag/v0.5.0) or higher
* Rich Presence should work automatically after installation (unless you're using WSL, in which case [see here](https://github.com/andweeb/presence.nvim/wiki/Rich-Presence-in-WSL))
* If you're using an unofficial Discord package on Linux ([flatpak](https://flathub.org/apps/details/com.discordapp.Discord), [snap](https://snapcraft.io/discord), etc.), you may need to follow some instructions to expose the Discord socket on your system (e.g. [flatpak instructions](https://github.com/flathub/com.discordapp.Discord/wiki/Rich-Precense-(discord-rpc)))
### Notes

- Requires [Neovim 0.5](https://github.com/neovim/neovim/releases/tag/v0.5.0)
or higher
- Rich Presence should work automatically after installation
(unless you're using WSL, in which case
[see here](https://github.com/andweeb/presence.nvim/wiki/Rich-Presence-in-WSL))

## 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.

Configuration is not necesary unless you want to override the default config.

If you want to change the default config here are your options in Lua and VimL:

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

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

```lua
-- The setup config table shows all available config options with their default values:
Expand All @@ -44,7 +66,7 @@ require("presence").setup({
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)
client_id = "1172122807501594644", -- 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
Expand All @@ -65,13 +87,15 @@ require("presence").setup({
```

### VimL

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

```viml
" 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_client_id = "1172122807501594644"
let g:presence_log_level
let g:presence_debounce_timeout = 10
let g:presence_enable_line_number = 0
Expand All @@ -91,23 +115,48 @@ 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
* Set the [`log_level`](#lua) setup option or [`g:presence_log_level`](#viml) to `"debug"`
* Load a file and inspect the logs with `:messages`
* 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](https://github.com/andweeb/presence.nvim/issues) or [card](https://github.com/andweeb/presence.nvim/projects/1#column-14183588) for your OS, create a prefixed [issue](https://github.com/andweeb/presence.nvim/issues/new) (e.g. `[Void Linux]`)
* Still not working and need help? Create a new [issue](https://github.com/andweeb/presence.nvim/issues)!

- 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
- Set the [`log_level`](#lua) setup option or [`g:presence_log_level`](#viml)
to `"debug"`
- Load a file and inspect the logs with `:messages`
- 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](https://github.com/jiriks74/presence.nvim/issues)
or [card](https://github.com/jiriks74/presence.nvim/projects/1#column-14183588)
for your OS, create a prefixed
[issue](https://github.com/jiriks74/presence.nvim/issues/new)
(e.g. `[Void Linux]`)
- Still not working and need help? Create a new
[issue](https://github.com/jiriks74/presence.nvim/issues)!

## Development
* Clone the repo: `git clone https://github.com/andweeb/presence.nvim.git`
* Enable [logging](#configuration) 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](https://github.com/mpeterv/luacheck/) errors: `luacheck lua`

- Clone the repo: `git clone https://github.com/jiriks74/presence.nvim.git`
- Enable [logging](#configuration) 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](https://github.com/mpeterv/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](https://github.com/andweeb/presence.nvim/projects/1?add_cards_query=is%3Aopen) or message [droob#1322](https://discordapp.com/users/241953146232897550) on Discord!

Asset additions and changes are also welcome! Supported file types can be found in [`file_assets.lua`](lua/presence/file_assets.lua) and their referenced asset files can be found [in this folder](https://www.dropbox.com/sh/j8913f0gav3toeh/AADxjn0NuTprGFtv3Il1Pqz-a?dl=0).
**Please use [Conventional Commits](https://www.conventionalcommits.org/)
if you want to contribute.
It makes everyones jobs easier.**

**This project uses [StyLua](https://github.com/JohnnyMorganz/StyLua).
Please format your code using StyLua for better readability**

Pull requests are very welcome, feel free to open an issue to work on
or message [me (@jiriks74)](https://discordapp.com/users/517810049360461837) on my
[Discord server](https://discord.gg/cCq3qcB4jB)!

Asset additions and changes are also welcome! Supported file types can be found in
[`file_assets.lua`](lua/presence/file_assets.lua) and their referenced asset files
can be found [in this folder](https://www.dropbox.com/sh/j8913f0gav3toeh/AADxjn0NuTprGFtv3Il1Pqz-a?dl=0).
Loading

0 comments on commit 8b18beb

Please sign in to comment.