Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.
/ cordkt.nvim Public archive

Discord Rich Presence for Neovim. Started as a first Neovim plugin written in Kotlin, moved to:

License

Notifications You must be signed in to change notification settings

vyfor/cordkt.nvim

Repository files navigation

Warning

This project has been rewritten in Rust, and now resides here.

🧩 Cord

cord_banner

🚀 Cord is a Discord Rich Presence plugin designed for Neovim, written in Kotlin/Native.

💎 Features

  • Lightweight
  • Cross-platform compatibility (Windows, Linux, macOS)
  • Blazingly fast startup due to non-blocking, asynchronous nature
  • Highly configurable in Lua
  • Offers a rich icon set for various components
  • Automatically detects working directory based on VCS files as well as the Git repository
  • Identifies problems across active buffers
  • Supports configurable idle status detection
  • Respects the ratelimit of one update per 15 seconds
  • Written in native code, uses Lua FFI for integration

🔌 Requirements

  • Neovim compiled with LuaJIT

📦 Installation

lazy.nvim
{
  'vyfor/cord.nvim',
  build = './gradlew linkReleaseSharedNative --no-daemon --no-build-cache'
}

If the build fails with message Process was killed because it reached the timeout, try increasing the timeout in Lazy's configuration:

require('lazy').setup(..., {
  git = {
    timeout = 600
  }
})
pckr.nvim
{
  'vyfor/cord.nvim',
  run = './gradlew linkReleaseSharedNative --no-daemon --no-build-cache'
}
other

Same steps apply to other plugin managers. Just make sure to add/run this build command:

./gradlew linkReleaseSharedNative --no-daemon --no-build-cache

🔧 Configuration

require('cord').setup({
  usercmds = true,                              -- Enable user commands
  timer = {
    enable = true,                              -- Enable timer
    interval = 1500,                            -- Timer's update interval in milliseconds (min 500)
    reset_on_idle = false,                      -- Reset start timestamp on idle
    reset_on_change = false,                    -- Reset start timestamp on presence change
  },
  editor = {
    image = nil,                                -- Image ID or URL in case a custom client id is provided
    client = 'neovim',                          -- vim, neovim, lunarvim, nvchad or your application's client id
    tooltip = 'The Superior Text Editor',       -- Text to display when hovering over the editor's image
  },
  display = {
    show_time = true,                           -- Display start timestamp
    show_repository = true,                     -- Display 'View repository' button linked to repository url, if any
    show_cursor_position = true,                -- Display line and column number of cursor's position
  },
  lsp = {
    show_problem_count = false,                 -- Display number of diagnostics problems
    severity = 1,                               -- 1 = Error, 2 = Warning, 3 = Info, 4 = Hint
    scope = 'workspace',                        -- buffer or workspace
  }
  idle = {
    show_idle = true,                           -- Enable idle status
    timeout = 300000,                           -- Timeout in milliseconds after which the idle status is set, 0 to display immediately
    disable_on_focus = true,                    -- Do not display idle status when neovim is focused
    text = 'Idle',                              -- Text to display when idle
    tooltip = '💤',                             -- Text to display when hovering over the idle image
  },
  text = {
    viewing = 'Viewing $s',                     -- Text to display when viewing a readonly file
    editing = 'Editing $s',                     -- Text to display when editing a file
    file_browser = 'Browsing files in $s',      -- Text to display when browsing files (Empty string to disable)
    plugin_manager = 'Managing plugins in $s',  -- Text to display when managing plugins (Empty string to disable)
    workspace = 'In $s',                        -- Text to display when in a workspace (Empty string to disable)
  }
})

⌨️ User commands (WIP)

  • :CordConnect - Initialize presence client internally and connect to Discord
  • :CordReconnect - Reconnect to Discord
  • :CordDisconnect - Disconnect from Discord
  • :CordTogglePresence - Toggle presence
  • :CordShowPresence - Show presence
  • :CordHidePresence - Hide presence

🌱 Contributing

This project is in beta. Feel free to open an issue or pull request for missing icons or features. You can also contact me on Discord vyfor if you have any questions.

About

Discord Rich Presence for Neovim. Started as a first Neovim plugin written in Kotlin, moved to:

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published