Skip to content

Commit 1a7651e

Browse files
committed
[init.lua] Install presence.nvim (discord RPC)...
- autocmd on BufWritePre xresources.
1 parent 3375b8a commit 1a7651e

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

init.lua

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ vim.opt.rtp:prepend(lazypath)
228228
--
229229
-- NOTE: Here is where you install your plugins.
230230
require('lazy').setup({
231+
'andweeb/presence.nvim',
231232
-- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link).
232233
'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically
233234

@@ -968,6 +969,30 @@ require('lazy').setup({
968969
},
969970
})
970971

972+
-- The setup config table shows all available config options with their default values:
973+
require('presence').setup {
974+
-- General options
975+
auto_update = true, -- Update activity based on autocmd events (if `false`, map or manually execute `:lua package.loaded.presence:update()`)
976+
neovim_image_text = 'The One True Text Editor', -- Text displayed when hovered over the Neovim image
977+
main_image = 'neovim', -- Main image display (either "neovim" or "file")
978+
client_id = '793271441293967371', -- Use your own Discord application client id (not recommended)
979+
log_level = nil, -- Log messages at or above this level (one of the following: "debug", "info", "warn", "error")
980+
debounce_timeout = 10, -- Number of seconds to debounce events (or calls to `:lua package.loaded.presence:update(<filename>, true)`)
981+
enable_line_number = false, -- Displays the current line number instead of the current project
982+
blacklist = {}, -- A list of strings or Lua patterns that disable Rich Presence if the current file name, path, or workspace matches
983+
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)
984+
file_assets = {}, -- Custom file asset definitions keyed by file names and extensions (see default config at `lua/presence/file_assets.lua` for reference)
985+
show_time = true, -- Show the timer
986+
987+
-- Rich Presence text options
988+
editing_text = 'Editing %s', -- Format string rendered when an editable file is loaded in the buffer (either string or function(filename: string): string)
989+
file_explorer_text = 'Browsing %s', -- Format string rendered when browsing a file explorer (either string or function(file_explorer_name: string): string)
990+
git_commit_text = 'Committing changes', -- Format string rendered when committing changes in git (either string or function(filename: string): string)
991+
plugin_manager_text = 'Managing plugins', -- Format string rendered when managing plugins (either string or function(plugin_manager_name: string): string)
992+
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)
993+
workspace_text = 'Working on %s', -- Format string rendered when in a git repository (either string or function(project_name: string|nil, filename: string): string)
994+
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)
995+
}
971996
require('colorizer').setup()
972997

973998
local lspconfig = require 'lspconfig'
@@ -976,6 +1001,8 @@ lspconfig['pyright'].setup {
9761001
trace = 'verbose',
9771002
}
9781003

1004+
require('lspconfig').texlab.setup {}
1005+
9791006
lspconfig['denols'].setup {
9801007
trace = 'verbose',
9811008
settings = {
@@ -1016,6 +1043,13 @@ vim.api.nvim_create_autocmd('BufWritePost', {
10161043
end,
10171044
})
10181045

1046+
vim.api.nvim_create_autocmd('BufWritePost', {
1047+
pattern = 'xresources',
1048+
callback = function()
1049+
vim.cmd '!xrdb -load %'
1050+
end,
1051+
})
1052+
10191053
vim.opt.tabstop = 4
10201054
vim.opt.expandtab = true
10211055
vim.opt.shiftwidth = 4

0 commit comments

Comments
 (0)