Skip to content

Commit f8929b3

Browse files
committed
doc: document the magic strings
1 parent fb1211e commit f8929b3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

+10
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Lightweight yet powerful formatter plugin for Neovim
1010
- [Setup](#setup)
1111
- [Formatters](#formatters)
1212
- [Customizing formatters](#customizing-formatters)
13+
- [Magic strings](#magic-strings)
1314
- [Recipes](#recipes)
1415
- [Debugging](#debugging)
1516
- [Advanced topics](#advanced-topics)
@@ -461,6 +462,15 @@ require("conform").formatters.shfmt = {
461462
}
462463
```
463464

465+
### Magic strings
466+
467+
The following magic strings are available in `args` and `range_args`. They will be dynamically replaced at runtime with the relevant value.
468+
469+
- `$FILENAME` - absolute path to the file
470+
- `$DIRNAME` - absolute path to the directory that contains the file
471+
- `$RELATIVE_FILEPATH` - relative path to the file
472+
- `$EXTENSION` - the file extension, e.g. `.py`
473+
464474
## Recipes
465475

466476
<!-- RECIPES -->

0 commit comments

Comments
 (0)