forked from anned20/vimsence
-
Notifications
You must be signed in to change notification settings - Fork 25
/
vimsence.txt
144 lines (113 loc) · 6.19 KB
/
vimsence.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
*vimsence.txt* Discord rich presence for Vim
__ ___ ____ ~
\ \ / (_)_ __ ___ / ___| ___ _ __ ___ ___ ~
\ \ / /| | '_ ` _ \\___ \ / _ \ '_ \ / __/ _ \ ~
\ V / | | | | | | |___) | __/ | | | (_| __/ ~
\_/ |_|_| |_| |_|____/ \___|_| |_|\___\___| ~
==============================================================================
CONTENTS *Vimsence-contents*
1. Introduction .................................. |VimSenceIntroduction|
2. Usage ......................................... |VimSenceUsage|
Manually updating your presence .............. |DiscordUpdatePresence|
Reconnecting to Discord ...................... |DiscordReconnect|
Disconnecting from Discord ................... |DiscordDisconnect|
Ignoring file types or folders ............... |VimSenceIgnore|
Flatpak support (Linux) ...................... |VimSenceFlatpak|
3. License ....................................... |VimSenceLisence|
4. Bugs .......................................... |VimSenceBugs|
5. Contributing .................................. |VimSenceContributing|
==============================================================================
1. Introduction *VimSenceIntroduction*
VimSence updates the Discord "now playing" status with what you're currently
editing in Vim. This way you can show all your friends how cool you are
programming in Vim.
==============================================================================
2. Usage *VimSenceUsage*
You just need to have this plugin installed and Discord running, the rest
will work automatically.
There are still some commands, and some config options that can be set.
------------------------------------------------------------------------------
*DiscordUpdatePresence* *UpdatePresence*
Manually updating your presence ~
If you have to manually update your presence, you can use this:
>
:DiscordUpdatePresence
<
This will force update the Discord presence with what you're currently
editing.
------------------------------------------------------------------------------
*DiscordReconnect*
Reconnecting to Discord ~
Manually reconnecting to Discord can be done with this command:
>
:DiscordReconnect
<
This will also attempt to close an existing session, if one exists. This also
refreshes your presence. The purpose of this command is avoiding the need to
reboot Vim because the Discord presence socket was disconnected, which can
happen under various circumstances.
------------------------------------------------------------------------------
*DiscordDisconnect*
Disconnecting from Discord ~
It's also possible to manually disconnect, which effectively disables the
plugin and prevents your status from showing up. This command can be used for
that:
>
:DiscordDisconnect
<
------------------------------------------------------------------------------
*g:vimsence_ignored_directories* *g:vimsence_ignored_filetypes*
*VimSenceIgnore*
Ignoring directories or file types ~
Both file types and directories can be ignored, which means they won't be
displayed on Discord. Note that the file type variant uses file types, not
file extensions. See `:echo &filetype` for the filetype of the current buffer.
The variable names used are:
>
g:vimsence_ignored_directories
g:vimsence_ignored_file_types
<
These are expected to be arrays of strings. By default, these do not exclude
any folders or file types.
------------------------------------------------------------------------------
*g:vimsence_discord_flatpak*
*VimSenceFlatpak*
Support for Flatpak ~
(Note: This only applies to Linux, and specifically distros Flatpak supports.
Having the option enabled on Linux without running the flatpak version will
cause the connection to fail)
Flatpak support can be enabled with:
>
let g:vimsence_discord_flatpak=1
>
Discord's Flatpak package exports its socket differently. Without
`let g:vimsence_discord_flatpak=1`, vimsence will try to connect to the
location the non-flatpak version exports its socket. This is typically
`$XDG_RUNTIME_DIR`. The Flatpak version of Discord is forced to export the RPC
socket under `$XDG_RUNTIME_DIR/app/com.discordapp.Discord/` because of how the
sandboxing works. Unfortunately, this breaks vimsence, because the socket is
set up in a different location than expected.
A typical way to work around this is by symlinking the socket where it
normally would be, but since the directory is deleted and regenerated on
login/logout, it becomes inefficient.
This is where `g:vimsence_discord_flatpak` comes in. With the option enabled,
vimsence will connect to the socket by looking for the socket where the Flatpak
version exports it. This is covered in slightly more detail on Discord's flatpak
wiki:
https://github.com/flathub/com.discordapp.Discord/wiki/Rich-Precense-(discord-rpc)
The option also makes it possible to bypass symlinking entirely.
TL;DR: `let g:vimsence_discord_flatpak=1` to fix issues with Flatpak and
Discord's RPC socket
==============================================================================
3. License *VimSenceLicense*
VimSense is licensed under the MIT license.
==============================================================================
4. Bugs *VimSenceBugs*
If you find a bug please post it on the issue tracker:
https://github.com/hugolgst/vimsence/issues
==============================================================================
5. Contributing *VimSenceContributing*
Think you can make this plugin better? Awesome! Fork it on GitHub and send a
pull request.
GitHub: https://github.com/vimsence/vimsence
vim:tw=78:ts=8:ft=help:norl: