cord-nvim 2.0.3

🚀 The most extensible Discord Rich Presence plugin for Neovim, powered by Rust.
<div align="center">
  <h1>🧩 <strong>Cord</strong> – Tailor Your Presence Like Never Before</h1>
  <div>
    <a href="https://github.com/vyfor/cord.nvim/stargazers"><img src="https://img.shields.io/github/stars/vyfor/cord.nvim?style=for-the-badge&color=8281f3&labelColor=242529&logo=data:image/svg%2bxml;base64,PHN2ZyB3aWR0aD0iODAwcHgiIGhlaWdodD0iODAwcHgiIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJtMTEuMDc1IDMuMjU1OGMwLjMzOTMtMC44MjczOCAxLjUxMTEtMC44MjczOCAxLjg1MDQgMGwxLjcyNDEgNC4yMDM3YzAuMTQzNyAwLjM1MDI0IDAuNDcyOCAwLjU4OTM0IDAuODUwMiAwLjYxNzcybDQuNTMwOCAwLjM0MDcxYzAuODkxNyAwLjA2NzA2IDEuMjUzOCAxLjE4MTQgMC41NzE4IDEuNzU5OGwtMy40NjUyIDIuOTM4OGMtMC4yODg3IDAuMjQ0OC0wLjQxNDQgMC42MzE3LTAuMzI0NyAwLjk5OTVsMS4wNzYgNC40MTQzYzAuMjExOCAwLjg2ODgtMC43MzYyIDEuNTU3NS0xLjQ5NyAxLjA4NzZsLTMuODY1Ny0yLjM4NzVjLTAuMzIyMS0wLjE5ODktMC43Mjg5LTAuMTk4OS0xLjA1MSAwbC0zLjg2NTcgMi4zODc1Yy0wLjc2MDg1IDAuNDY5OS0xLjcwODgtMC4yMTg4LTEuNDk3LTEuMDg3NmwxLjA3Ni00LjQxNDNjMC4wODk2NS0wLjM2NzgtMC4wMzYwNS0wLjc1NDctMC4zMjQ3Ni0wLjk5OTVsLTMuNDY1Mi0yLjkzODhjLTAuNjgyMDItMC41NzgzOC0wLjMxOTk0LTEuNjkyOCAwLjU3MTgxLTEuNzU5OGw0LjUzMDgtMC4zNDA3MWMwLjM3NzQ4LTAuMDI4MzggMC43MDY1OC0wLjI2NzQ4IDAuODUwMjItMC42MTc3MmwxLjcyNDEtNC4yMDM3eiIgc3Ryb2tlPSIjODI4MWYzIiBzdHJva2Utd2lkdGg9IjIiLz48L3N2Zz4=" alt="Stargazers"></a>
    <a href="https://neovim.io/"><img src="https://img.shields.io/badge/Neovim-%20%3E%3D%200.6.0-ffffff?style=for-the-badge&logo=neovim&color=8281f3&labelColor=242529&logoColor=8281f3" alt="Neovim Logo"></a>
    <a href="https://github.com/vyfor/cord.nvim/forks"><img src="https://img.shields.io/github/forks/vyfor/cord.nvim?style=for-the-badge&color=8281f3&labelColor=242529&logo=data:image/svg%2bxml;base64,PHN2ZyBmaWxsPSIjODI4MWYzIiB2aWV3Qm94PSItNCAtMiAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNOCAxOGExIDEgMCAxIDAgMC0yIDEgMSAwIDAgMCAwIDJ6bTEuMDMzLTMuODE3QTMuMDAxIDMuMDAxIDAgMSAxIDcgMTQuMTd2LTEuMDQ3YzAtLjA3NC4wMDMtLjE0OC4wMDgtLjIyMWExIDEgMCAwIDAtLjQ2Mi0uNjM3TDMuNDYgMTAuNDJBMyAzIDAgMCAxIDIgNy44NDVWNS44MjlhMy4wMDEgMy4wMDEgMCAxIDEgMiAwdjIuMDE2YTEgMSAwIDAgMCAuNDg3Ljg1OGwzLjA4NiAxLjg0NmEzIDMgMCAwIDEgLjQ0My4zMjQgMyAzIDAgMCAxIC40NDQtLjMyNGwzLjA4Ni0xLjg0NmExIDEgMCAwIDAgLjQ4Ny0uODU4VjUuODQxQTMuMDAxIDMuMDAxIDAgMCAxIDEzIDBhMyAzIDAgMCAxIDEuMDMzIDUuODE3djIuMDI4YTMgMyAwIDAgMS0xLjQ2IDIuNTc1bC0zLjA4NiAxLjg0NmExIDEgMCAwIDAtLjQ2Mi42MzdjLjAwNS4wNzMuMDA4LjE0Ny4wMDguMjJ2MS4wNnpNMyA0YTEgMSAwIDEgMCAwLTIgMSAxIDAgMCAwIDAgMnptMTAgMGExIDEgMCAxIDAgMC0yIDEgMSAwIDAgMCAwIDJ6Ii8+PC9zdmc+" alt="Forks"></a>
  </div>
  <br/>
  <img src="https://github.com/user-attachments/assets/8e684058-f3ea-4010-817e-529b47730abb" alt="Cord Logo" width="200px">
  <h3>🚀 The most extensible Discord Rich Presence plugin for Neovim, powered by Rust.
  </h3>
  <img src="https://github.com/user-attachments/assets/df73221e-565b-49e5-9dad-1c60aed6f9c3" alt="Cord Banner">
</div>

<div align="center">
  <a href="#-install">Installation</a>
  <span> • </span>
  <a href="#-documentation">Documentation</a>
  <span> • </span>
  <a href="https://discord.gg/q9rC4bjCHv">Discord</a>
</div>

>[!IMPORTANT]
> Cord no longer requires Rust to be installed. Rust component will be automatically downloaded from GitHub Releases.

## 💎 Features  
- 🌐 **Client-Server Design** — Handles multiple Neovim instances with a single connection to Discord.
- ⚡ **Performance in Mind** — Lightweight, dependency-free, with blazingly-fast startup.
- 🚀 **Event-Driven Architecture** — Instant presence updates with zero delays.  
- 🎨 **Customizable Templates** — Dynamic string templates with custom variables.
- 🔧 **Unmatched Configurability** — Function-based configuration for infinite customization possibilities.
- 🧠 **Automated State Handling** — Automatically manages activities across all instances.
- 💤 **Smart Idle Detection** — Identifies idle sessions and switches to the most recent non-idle session.
- 🛠️ **Built-in Git Integration** — Detects repositories and workspaces based on VCS files without relying on command-line tools.
- 🗃️ **Custom Assets** — Extendable with fully customizable assets for any file/buffer type.
- ⚙️ **Robust User Commands** - Quickly manage Cord and its features through user commands and easily create your own keybindings.
- 🔌 **Plugin System** — Extendable with custom plugins, with a plethora of built-in ones out of the box.
- 📦 **Wide Compatibility** - Compatible with various Discord installations (Snap, Flatpak) and able to work inside [WSL](https://github.com/vyfor/cord.nvim/wiki/Troubleshooting#running-inside-wsl) and [Discord in browser](https://github.com/vyfor/cord.nvim/wiki/Troubleshooting#using-discord-in-browser).
- 🌍 **Cross-Platform** — Supports Windows, Linux, macOS, and FreeBSD.
- 🌸 **Rich Icon Collection** — Features 120+ uniquely designed themed icons for 200+ file types and plugins.
- 🔁 **Automatic Reconnection** — Able to reconnect to Discord if the connection is lost.


## 📦 Install 

### Considerations
<details>
<summary>Expand</summary>

Cord requires the server executables to be present. To get it, you can either:
- **Fetch from GitHub**: Invoking `:Cord build [fetch]` (async, recommended). Make sure you have **[`curl`](https://curl.se)** installed.
- **Download from GitHub**: Get latest release from https://github.com/vyfor/cord.nvim/releases/latest, rename it to cord[.exe] and place it under `nvim-data-dir/cord/bin`
- [**Build from source**](#️-build-from-source)

</details>

### Installation
<details>
<summary>Using <strong>lazy.nvim</strong></summary>

```lua
{
  'vyfor/cord.nvim',
  build = ':Cord update',
  -- opts = {}
}
```

</details>

<details>
<summary>Using <strong>packer.nvim</strong></summary>

```lua
use {
  'vyfor/cord.nvim',
  run = ':Cord update',
  -- config = function()
  --   require('cord').setup {}
  -- end
}
```

</details>

<details>
<summary>Using <strong>rocks.nvim</strong></summary>

Cord is available on [LuaRocks](https://luarocks.org/modules/vyfor/cord.nvim).

```vim
:Rocks install cord.nvim
```

Invoke `:Cord update` whenever the plugin is updated.

</details>

<details>
<summary>Using <strong>Vim packages</strong></summary>

**Unix:**
```bash
git clone --single-branch https://github.com/vyfor/cord.nvim ~/.local/share/nvim/site/pack/plugins/start/cord.nvim
```

**Windows:**
```powershell
git clone --single-branch https://github.com/vyfor/cord.nvim $LOCALAPPDATA/nvim-data/site/pack/plugins/start/cord.nvim
```

Invoke `:Cord update` whenever the plugin is updated.

</details>

<details>
<summary>Other</summary>

Invoke `:Cord update` whenever the plugin is updated.

</details>

## 🎨 Themes  
Cord features over 120 beautifully designed icons for languages and components with distinct themes, with more to come!

👉 [**Explore the Showcase**](https://github.com/vyfor/icons#showcase)  

## 📖 Documentation  
- [**Configuration Guide**](./.github/wiki/Configuration.md): Everything you need to customize Cord.  
- [**Examples**](./.github/wiki/Examples.md): Creative ways to customize your Discord presence.
- [**Migration Guide**](./.github/wiki/Migration.md): Smooth migration from Cord v1.
- [**Wiki**](https://github.com/vyfor/cord.nvim/wiki): Examples, best practices, and FAQs.

## 🤝 Contributing  
We welcome contributions to make Cord even better!
- Check out our [**Contribution Guidelines**](https://github.com/vyfor/cord.nvim/wiki/Contributing).  

## ❓ FAQ  
Have questions or issues?  
- [**Troubleshooting Guide**](./.github/wiki/Troubleshooting)  

## 🛠️ Build From Source
>[!NOTE]
> Make sure you have **[Rust](https://www.rust-lang.org/tools/install)** >= 1.85.0 installed.

To build Cord from source, you can run `:Cord update build` (async) which will install the server binary from crates.io by running the following command:

```bash
cargo install --path . --root path/to/nvim-data-dir/cord/bin --force
```

Alternatively, you can use `cargo b --release` to build the binary, then place it under `nvim-data-dir/cord/bin`.

---

<div align="center">  
  <p>💬 Questions? Post in <a href="https://github.com/vyfor/cord.nvim/discussions">Discussions</a> or reach me out on Discord: <a href="https://discord.com/users/446729269872427018"><strong>vyfor</strong></a></p>
  <div><a href="https://discord.gg/q9rC4bjCHv"><img src="https://discord.com/api/guilds/1322899307925602366/widget.png?style=banner3" alt="cord.nvim"/></a></div>
</div>