You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`patchy` is a tool which makes it easy to declaratively manage personal forks by automatically merging pull requests.
Check it out here: https://github.com/NikitaRevenco/patchy
@@ -9,6 +10,35 @@ Typable commands are used from command mode and may take arguments. Command mode
9
10
10
11
{{#include ./generated/typable-cmd.md}}
11
12
13
+
14
+
### Using variables in typable commands
15
+
16
+
Helix provides several variables that can be used when typing commands or creating custom shortcuts. These variables are listed below:
17
+
18
+
| Variable | Description |
19
+
| --- | --- |
20
+
|`%{basename}` or `%{b}`| The name and extension of the currently focused file. |
21
+
|`%{dirname}` or `%{d}`| The absolute path of the parent directory of the currently focused file. |
22
+
|`%{cwd}`| The absolute path of the current working directory of Helix. |
23
+
|`%{repo}`| The absolute path of the VCS repository helix is opened in. Fallback to `cwd` if not inside a VCS repository|
24
+
|`%{filename}` or `%{f}`| The absolute path of the currently focused file. |
25
+
|`%{filename:rel}`| The relative path of the file according to `cwd` (will give absolute path if the file is not a child of the current working directory) |
26
+
|`%{filename:repo_rel}`| The relative path of the file according to `repo` (will give absolute path if the file is not a child of the VCS directory or the cwd) |
27
+
|`%{ext}`| The extension of the current file |
28
+
|`%{lang}`| The language of the current file |
29
+
|`%{linenumber}`| The line number where the primary cursor is positioned. |
30
+
|`%{cursorcolumn}`| The position of the primary cursor inside the current line. |
31
+
|`%{selection}`| The text selected by the primary cursor. |
32
+
|`%sh{cmd}`| Executes `cmd` with the default shell and returns the command output, if any. |
33
+
34
+
#### Example
35
+
36
+
```toml
37
+
[keys.normal]
38
+
# Print blame info for the line where the main cursor is.
Static commands take no arguments and can be bound to keys. Static commands can also be executed from the command picker (`<space>?`). The built-in static commands are:
0 commit comments