Skip to content

Commit

Permalink
chore: release v2.0.0
Browse files Browse the repository at this point in the history
refactor: Split codebase into client-server architecture
  • Loading branch information
vyfor authored Jan 31, 2025
2 parents b5adb22 + dca8918 commit a0e1000
Show file tree
Hide file tree
Showing 218 changed files with 14,395 additions and 2,815 deletions.
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ body:
spec = {
{
'vyfor/cord.nvim',
branch = 'client-server',
build = ':Cord update',
},
},
Expand Down
8 changes: 0 additions & 8 deletions .github/ISSUE_TEMPLATE/icon-request.yml

This file was deleted.

1 change: 1 addition & 0 deletions .github/server-version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.0.0-beta.30
93 changes: 93 additions & 0 deletions .github/wiki/Assets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# 📂 Custom Assets

## Structure

Cord allows the customization and addition of custom assets. To do so, you need to modify the `assets` table in the setup configuration of the plugin:

```lua
require('cord').setup {
assets = {
-- key: string = value: string or table
},
}
```

## Asset Configuration

| Option | Type | Description |
| ----------- | --------------------- | ------------------------------------------------------------------------------------------------------------ |
| **(key)** | `string` | The key can be a Vim filetype (like `lua`), a filename (like `Cargo.toml`), or a file extension (like `.rs`) |
| **(value)** | `string \| table` | This can either be a string pointing to the icon or a table with options below |
| `icon` | `string \| function ` | A direct URL to the icon image or the name of the rich presence asset (in case you use your own application) |
| `tooltip` | `string \| function` | Text that appears when hovering over the icon |
| `name` | `string \| function` | An optional override for the icon name. Redundant for `language` types |
| `text` | `string \| function` | An optional override for the icon text. Unlike other options, this will fully override the text |
| `type` | `string` | Specifies the context of the asset. |

Available types:
- `language` (default)
- `docs`
- `plugin_manager`
- `lsp_manager`
- `file_browser`
- `vcs`
- `workspace`
- `dashboard`
- `notes`
- `debug`
- `test`
- `diagnostics`
- `games`
- `terminal`

**Examples**:
```lua
['.rs'] = 'rust_icon'
```
```lua
lazy = {
name = 'Lazy', -- `config.text.plugin_manager + name` = "Managing plugins in Lazy"
icon = 'https://example.com/lazy.png',
tooltip = 'lazy.nvim',
type = 'plugin_manager'
}
```
> Use Cord's existing icon
```lua
['.settings'] = require('cord.api.icon').get('gear') -- or { icon = require(...) }
```
> In the below configuration, only the tooltip for Lua files is changed, while the icon and name remain as provided by Cord's defaults.
```lua
lua = {
-- Overrides default tooltip and text only
tooltip = '.lua file',
text = 'Writing in Lua' -- `config.text.editing` is ignored
}
```

Some languages cannot be identified solely by their filename or extension. In such cases, we can utilize the `vim.filetype.add` function to add extra patterns for filetype detection:

```lua
vim.filetype.add {
pattern = {
['.*/waybar/config'] = 'jsonc',
['.*/hypr/.*%.conf'] = 'hyprlang',
-- ...
},
}
```

## Overriding Defaults

In addition to setting icons for specific filetypes or extensions, you can also define icons for generic scenarios:

- `['Cord.new']`: Sets the icon for a new buffer when Neovim is opened without any file arguments.
- `['Cord.unknown']`: Used when the filetype is not detected by the editor or not supported in Cord at the moment.
- `['Cord.override']`: Overrides all of the existing icons.

**Example**:
```lua
['Cord.new'] = 'default_icon'
['Cord.unknown'] = 'unknown_icon'
['Cord.override'] = 'rust' -- Rust... Rust everywhere...
```
456 changes: 456 additions & 0 deletions .github/wiki/Configuration.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md → .github/wiki/Contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ First off, thank you for your interest in contributing to cord.nvim! We welcome

### Reporting Bugs

- Before submitting a bug report, make sure to go through the [**🔧 Troubleshooting**](https://github.com/vyfor/cord.nvim/wiki/Troubleshooting) section of the wiki, and check for [existing issues](https://github.com/vyfor/cord.nvim/issues) to see if the problem has already been reported.
- Before submitting a bug report, make sure to go through the [**🔧 Troubleshooting**](./Troubleshooting.md) section of the wiki, and check for [existing issues](https://github.com/vyfor/cord.nvim/issues) to see if the problem has already been reported.
- If you're unable to find an open issue addressing the problem, [open a new one](https://github.com/vyfor/cord.nvim/issues/new). Be sure to include a clear title and description, along with as much relevant information as possible.

### Suggesting Enhancements
Expand Down
Loading

0 comments on commit a0e1000

Please sign in to comment.