Skip to content

Commit 4d858ae

Browse files
committed
book: Add completion item kinds configuration
editor.completion-item-kinds section and theming information
1 parent 88d2e4f commit 4d858ae

File tree

2 files changed

+89
-0
lines changed

2 files changed

+89
-0
lines changed

book/src/editor.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## Editor
22

33
- [`[editor]` Section](#editor-section)
4+
- [`[editor.completion-item-kinds]` Section](#editorcompletion-item-kinds-section)
45
- [`[editor.statusline]` Section](#editorstatusline-section)
56
- [`[editor.lsp]` Section](#editorlsp-section)
67
- [`[editor.cursor-shape]` Section](#editorcursor-shape-section)
@@ -55,6 +56,91 @@
5556
| `jump-label-alphabet` | The characters that are used to generate two character jump labels. Characters at the start of the alphabet are used first. | `"abcdefghijklmnopqrstuvwxyz"`
5657
| `end-of-line-diagnostics` | Minimum severity of diagnostics to render at the end of the line. Set to `disable` to disable entirely. Refer to the setting about `inline-diagnostics` for more details | "disable"
5758
| `clipboard-provider` | Which API to use for clipboard interaction. One of `pasteboard` (MacOS), `wayland`, `x-clip`, `x-sel`, `win-32-yank`, `termux`, `tmux`, `windows`, `termcode`, `none`, or a custom command set. | Platform and environment specific. |
59+
| `completion-item-kinds` | Text to show for the completion menu item kind. By default helix displays the kind in `kebab-case` | `{}` (empty) |
60+
61+
### `[editor.completion-item-kinds]` Section
62+
63+
These are used to override completion item kinds text. The same text that displays
64+
what kind of completion is inside the completion menu.
65+
66+
<details>
67+
<summary>Here are the completion item kinds for the <b>LSP</b> completion menu:</summary>
68+
- `text`
69+
- `method`
70+
- `function`
71+
- `constructor`
72+
- `field`
73+
- `variable`
74+
- `class`
75+
- `interface`
76+
- `module`
77+
- `property`
78+
- `unit`
79+
- `value`
80+
- `enum`
81+
- `keyword`
82+
- `snippet`
83+
- `color`
84+
- `file`
85+
- `reference`
86+
- `folder`
87+
- `enum-member`
88+
- `constant`
89+
- `struct`
90+
- `event`
91+
- `operator`
92+
- `type-parameter`
93+
</details>
94+
95+
<details>
96+
<summary>Here are the completion item kinds for the <b>path</b> completion menu:</summary>
97+
- `file`
98+
- `folder`
99+
- `link`
100+
</details>
101+
102+
<br>
103+
104+
The value of the map is the text to display inside of the completion menu. By
105+
default, helix will use the key.
106+
107+
108+
<details>
109+
110+
<summary>Example configuration with <a href="https://nerdfonts.com">Nerd Fonts</a> </summary>
111+
112+
```toml
113+
[editor.completion-item-kinds]
114+
text = ""
115+
method = "󰆧"
116+
function = "󰊕"
117+
constructor = ""
118+
field = "󰇽"
119+
variable = "󰂡"
120+
class = "󰠱"
121+
interface = ""
122+
module = ""
123+
property = "󰜢"
124+
unit = ""
125+
value = "󰎠"
126+
enum = ""
127+
keyword = "󰌋"
128+
snippet = ""
129+
color = "󰏘"
130+
file = "󰈙"
131+
reference = ""
132+
folder = "󰉋"
133+
link = "󱧮"
134+
enum-member = ""
135+
constant = "󰏿"
136+
struct = ""
137+
event = ""
138+
operator = "󰆕"
139+
type-parameter = "󰅲"
140+
141+
```
142+
143+
</details>
58144

59145
### `[editor.clipboard-provider]` Section
60146

book/src/themes.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,8 @@ These scopes are used for theming the editor interface:
316316
| `ui.menu` | Code and command completion menus |
317317
| `ui.menu.selected` | Selected autocomplete item |
318318
| `ui.menu.scroll` | `fg` sets thumb color, `bg` sets track color of scrollbar |
319+
| `ui.completion.kind` | Default completion menu item kind color |
320+
| `ui.completion.kind.{kind}` | Completion menu item kind for `kind`. These are the same as [completion item kinds][cik] |
319321
| `ui.selection` | For selections in the editing area |
320322
| `ui.selection.primary` | |
321323
| `ui.highlight` | Highlighted lines in the picker preview |
@@ -337,3 +339,4 @@ These scopes are used for theming the editor interface:
337339
| `diagnostic.deprecated` | Diagnostics with deprecated tag (editing area) |
338340

339341
[editor-section]: ./configuration.md#editor-section
342+
[cik]: ./editor.md#editorcompletion-item-kinds-section

0 commit comments

Comments
 (0)