From 053780106593f243a252233f63fc8487a2e04e13 Mon Sep 17 00:00:00 2001 From: Andrew Kwon Date: Mon, 1 Mar 2021 09:34:30 -0800 Subject: [PATCH] Add README --- README.md | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..7259457 --- /dev/null +++ b/README.md @@ -0,0 +1,62 @@ +presence.nvim​ +=== + +Discord [Rich Presence](https://discord.com/rich-presence) plugin for Neovim. + +demo.gif + +## Features +* Simple and unobtrusive +* No Python/Node providers (or CoC) required +* 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 configurable in Lua (but also configurable in VimL if you want) + +## Installation +Use your favorite plugin manager +* [packer](https://github.com/wbthomason/packer.nvim): `use 'andweeb/presence.nvim'` +* [vim-plug](https://github.com/junegunn/vim-plug): `Plug 'andweeb/presence.nvim'` + +#### Notes +* Requires [Neovim nightly (v0.5)](https://github.com/neovim/neovim/releases/tag/nightly) +* Linux and macOS is supported, but Windows is **WIP** ([help wanted!](#contributing)) + +## Configuration +Rich Presence works right out of the box after installation. To override default behaviors, configuration options are available in both Lua and VimL. + +### Lua +Require the plugin and call `setup` with a config table with any of the following keys: + +```lua +Presence = require("presence"):setup({ + -- This config table shows all available config options with their default values + auto_update = true, -- Update activity based on autocmd events (if `false`, map or manually execute `:lua Presence:update()`) + editing_text = "Editing %s", -- Editing format string (either string or function(filename, path): string) + workspace_text = "Working on %s", -- Workspace format string (either string or function(project_name, path): string) + 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") +}) +``` + +### VimL +Or if global variables are more your thing, you can use any of the following instead: +```viml +let g:presence_auto_update = 1 +let g:presence_editing_text = "Editing %s" +let g:presence_workspace_text = "Working on %s" +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 +``` + +## Contributing +Pull requests are very welcome! Here some open todo items: +- [ ] Use named pipes to support Windows +- [ ] Expose file assets table as a configurable option +- [ ] Retry connection after initial setup or a closed pipe (i.e. after quitting Discord app) +- [ ] Attempt to connect to a range of pipes from `discord-ipc-0` to `discord-ipc-9` (see [note](https://github.com/discord/discord-rpc/blob/master/documentation/hard-mode.md#notes)) +- [ ] Set activity on other autocommands (`:h events`) + +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 assets can be found [in this folder](https://www.dropbox.com/sh/j8913f0gav3toeh/AADxjn0NuTprGFtv3Il1Pqz-a?dl=0).