vyfor / cord.nvim Goto Github PK
View Code? Open in Web Editor NEW๐ Discord Rich Presence plugin for Neovim written in Rust
License: Apache License 2.0
๐ Discord Rich Presence plugin for Neovim written in Rust
License: Apache License 2.0
The name of the executable could be extracted from the file name as follows:
*:EXECUTABLE;#toggleterm#*
Would be good to add Julia's icon, it is a widely used scientific programming language.
https://julialang.org/
If the git repository contains a submodule, the 'View Repository' button redirects to the submodule's url instead of the projects repository.
Arch Linux
NVIM v0.10.0
Build type: Release
LuaJIT 2.1.1716656478
Expected to redirect to the projects git repository
No response
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
if not (vim.uv or vim.loop).fs_stat(lazypath) then
vim.fn.system({
'git',
'clone',
'--filter=blob:none',
'https://github.com/folke/lazy.nvim.git',
'--branch=stable',
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require('lazy').setup({
{
'vyfor/cord.nvim',
build = './build',
opts = {
usercmds = true,
log_level = nil,
timer = {
interval = 1500,
reset_on_idle = false,
reset_on_change = false,
},
editor = {
image = nil,
client = 'neovim',
tooltip = 'The Superior Text Editor',
},
display = {
show_time = true,
show_repository = true,
show_cursor_position = false,
swap_fields = false,
swap_icons = false,
workspace_blacklist = {},
},
lsp = {
show_problem_count = false,
severity = 1,
scope = 'workspace',
},
idle = {
enable = true,
show_status = true,
timeout = 1800000,
disable_on_focus = true,
text = 'Idle',
tooltip = '๐ค',
},
text = {
viewing = 'Viewing {}',
editing = 'Editing {}',
file_browser = 'Browsing files in {}',
plugin_manager = 'Managing plugins in {}',
lsp_manager = 'Configuring LSP in {}',
vcs = 'Committing changes in {}',
workspace = 'In {}',
},
buttons = {
{
label = 'View Repository',
url = 'git',
},
},
assets = {},
},
},
}, {})
:CordWorkspace <name>
No response
Filetypes: lspinfo
, mason
/app/com.discordapp.Discord/...
/snap.discord/...
No response
The view repository button in the rpc redirects me to https://github.com/:user/repo instead of https://github.com/user/repo
Arch BTW
NVIM v0.10.0
Build type: Release
LuaJIT 2.1.1713773202
start connecting
No response
No response
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
if not (vim.uv or vim.loop).fs_stat(lazypath) then
vim.fn.system({
'git',
'clone',
'--filter=blob:none',
'https://github.com/folke/lazy.nvim.git',
'--branch=stable',
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require('lazy').setup({
{
'vyfor/cord.nvim',
build = './build',
opts = {
usercmds = true,
timer = {
enable = true,
interval = 1500,
reset_on_idle = false,
reset_on_change = false,
},
editor = {
image = nil,
client = 'neovim',
tooltip = 'The Superior Text Editor',
},
display = {
show_time = true,
show_repository = true,
show_cursor_position = true,
swap_fields = false,
workspace_blacklist = {},
},
lsp = {
show_problem_count = false,
severity = 1,
scope = 'workspace',
},
idle = {
show_idle = true,
timeout = 300000,
disable_on_focus = true,
text = 'Idle',
tooltip = '๐ค',
},
text = {
viewing = 'Viewing {}',
editing = 'Editing {}',
file_browser = 'Browsing files in {}',
plugin_manager = 'Managing plugins in {}',
workspace = 'In {}',
},
buttons = {
{
label = 'View repository',
url = 'git',
},
},
},
},
}, {})
I would appreciate it if you could add an optional feature to hide the cord's discord presence when idle and show it again when unidle.
No response
I use lazygit with lunarvim. I'm not sure how lunarvim handles lazygit, if through the plugin or something else, seems like it's calling the lazygit executable with toggleterm which is another plugin.
The expected behaviour is to have the same icon as git filetypes:
No response
I want to mask my user directory when I edit a file in it, as the folder name is basically my full name.
I've tried blocking just the username or just the whole path. Neither worked.
Windows 10 Pro 22H2 19041
NVIM v0.10.0
Build type: Release
LuaJIT 2.1.1713484068
workspace_blacklist
array.The workspace name should be hidden.
The workspace shows normally.
{
"vyfor/cord.nvim",
build = "./build",
event = LazyFile,
init = function()
local username, homepath
if vim.loop.os_uname().sysname == "Windows_NT" then
username = os.getenv("USERNAME")
homepath = os.getenv("USERPROFILE")
else
username = os.getenv("USER")
homepath = os.getenv("HOME")
end
if username == nil then
username = ""
else
username = tostring(username)
end
if homepath == nil then
homepath = ""
else
homepath = tostring(homepath)
end
require("cord").setup({
display = {
workspace_blacklist = {username, homepath},
},
})
end,
},
For example, in neocord you can toggle between the editor logo and language.
filetype: xml
filename: pom.xml
At present, the icon backgrounds have transparency, which causes inconsistencies on different Discord themes.
Currently, the zshell type files has no icons (default txt icon is displayed), for example, the .zshrc file, I tried to put it manually via the assets config like this:
assets = {
['zsh'] = 'shell',
},
But is not working as expected:
'zsh' is the type recognized by vim. Maybe I'm doing something wrong, but still, would be good to have it by default since zshell is widely used.
The current approach uses the git
command to retrieve the repository URL. Although git
is relatively fast, from what I've tested, launching a shell to execute a command is often quite slow and leads to unexpected delays in Neovim. A more efficient approach would be to directly access Git's config file to obtain the URL. On that note, I believe it's better to move this logic to the Rust codebase.
Hello just want to point out that I think run='./build' is deprecated and raises a warning, the new method is build = './build'.
{
'vyfor/cord.nvim',
run = './build',
}
Btw, thank you so much for this plugin, is the best rich presence for neovim I've ever seen.
Bash seems to be located in different places on different systems. The Unix script needs to be changed to locate it correctly.
MacOS 14.3.1
NVIM v0.10.0
Build type: Release
LuaJIT 2.1.1713773202
{
"vyfor/cord.nvim",
build = "./build",
event = "VeryLazy",
opts = {
log_level = nil,
...
}
}
Should have fallback log level when log_level
is nil
No response
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
if not (vim.uv or vim.loop).fs_stat(lazypath) then
vim.fn.system({
'git',
'clone',
'--filter=blob:none',
'https://github.com/folke/lazy.nvim.git',
'--branch=stable',
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require('lazy').setup({
{
'vyfor/cord.nvim',
build = './build',
opts = {
usercmds = true,
timer = {
enable = true,
interval = 1500,
reset_on_idle = false,
reset_on_change = false,
},
editor = {
image = nil,
client = 'neovim',
tooltip = 'The Superior Text Editor',
},
display = {
show_time = true,
show_repository = true,
show_cursor_position = true,
swap_fields = false,
workspace_blacklist = {},
},
lsp = {
show_problem_count = false,
severity = 1,
scope = 'workspace',
},
idle = {
show_idle = true,
timeout = 300000,
disable_on_focus = true,
text = 'Idle',
tooltip = '๐ค',
},
text = {
viewing = 'Viewing {}',
editing = 'Editing {}',
file_browser = 'Browsing files in {}',
plugin_manager = 'Managing plugins in {}',
workspace = 'In {}',
},
buttons = {
{
label = 'View repository',
url = 'git',
},
},
},
},
}, {})
the current code only supports git repos with urls that start with "http" as you can see here
my proposal is to also add support for urls of ssh form, e.g. [email protected]:owner/repo
, [email protected]:owner/repo
and substitute them with a https
url, https://github.com/owner/repo
(and the same for gitlab).
(I'm not a Rust expert so I don't really know the best way to implement it)
No response
Failed (1)
โ cord.nvim 3.2ms โ build
dir /Users/ravibrock/.local/share/nvim/lazy/cord.nvim
url https://github.com/vyfor/cord.nvim
branch master
commit 188840a
readme README.md
event ๎ช VeryLazy
โ [task] clone 1649.81ms
Cloning into '/Users/ravibrock/.local/share/nvim/lazy/cord.nvim'...
remote: Enumerating objects: 409, done.
remote: Counting objects: 100% (75/75), done.
remote: Compressing objects: 100% (70/70), done.
remote: Total 409 (delta 6), reused 26 (delta 2), pack-reused 334
Receiving objects: 100% (409/409), 56.87 KiB | 1021.00 KiB/s, done.
Resolving deltas: 100% (216/216), done.
โ [task] checkout 0.19ms
โ [task] docs 0ms
โ [task] build 1128.6ms
dyld[46514]: Symbol not found: __ZN4llvm10PGOOptionsC1ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES7_S7_S7_NS_18IntrusiveRefCntPtrINS_3vfs10FileSystemEEENS0_9PGOActionENS0_11CSPGOActionEbb
Referenced from: <EEB49284-2EAD-3371-9401-139E8557678B> /opt/homebrew/Cellar/rust/1.77.2_1/lib/librustc_driver-3dc17bded25d4e59.dylib
Expected in: <B0C4597F-D1E6-36D5-83FD-81D0ACE34F6C> /opt/homebrew/Cellar/llvm/18.1.4/lib/libLLVM.dylib
./build: line 3: 46514 Abort trap: 6 rustc --crate-type=cdylib -C opt-level=3 -C panic=abort -C lto=fat -o cord src/lib.rs
I'm getting a build error here after trying to reinstall the plugin โ before reinstalling it was throwing the "symbol not found" error when running Neovim. I don't know Rust, unfortunately, so I can't really speculate as to why this is happening. My configuration is below:
{
"vyfor/cord.nvim",
event = "VeryLazy",
build = "./build",
opts = {
display = {
show_repository = false,
show_cursor_position = false,
},
text = {
viewing = "Coding โ๏ธ",
editing = "Coding โ๏ธ",
file_browser = "Browsing files ๐",
plugin_manager = "Managing plugins ๐",
workspace = "",
},
},
},
MacOS Sonoma 14.4.1
NVIM v0.10.0-dev-2194+g3ab6f60dc-Homebrew
Build type: Release
LuaJIT 2.1.1713773202
cord.nvim
with lazy.nvim
Instalilng and building normally.
See issue description.
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
if not (vim.uv or vim.loop).fs_stat(lazypath) then
vim.fn.system({
'git',
'clone',
'--filter=blob:none',
'https://github.com/folke/lazy.nvim.git',
'--branch=stable',
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require('lazy').setup({
{
'vyfor/cord.nvim',
build = './build',
},
})
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.