File tree Expand file tree Collapse file tree 1 file changed +27
-7
lines changed
Expand file tree Collapse file tree 1 file changed +27
-7
lines changed Original file line number Diff line number Diff line change 1515
1616## setup
1717
18- 1 . install topiary-cli (0.6.0+ suggested)
19- 2 . clone this repo to ` $env.XDG_CONFIG_HOME/topiary `
20- 3 . set environment variables
21-
2218``` nushell
19+ # install topiary-cli (0.6.0+ suggested)
20+ # for example, installing with cargo
21+ cargo install --git https://github.com/tweag/topiary topiary-cli
22+
23+ # clone this repo to `$env.XDG_CONFIG_HOME/topiary`
24+ git clone https://github.com/blindFS/topiary-nushell ($env.XDG_CONFIG_HOME | path join topiary)
25+
26+ # set environment variables
2327$env.TOPIARY_CONFIG_FILE = ($env.XDG_CONFIG_HOME | path join topiary languages.ncl)
2428$env.TOPIARY_LANGUAGE_DIR = ($env.XDG_CONFIG_HOME | path join topiary languages)
25-
2629```
30+
2731## usage
2832
29- + ` topiary format script.nu `
30- + neovim: format on save with [ conform.nvim] ( https://github.com/stevearc/conform.nvim ) :
33+ ``` nushell
34+ topiary format script.nu
35+ ```
36+
37+ ### neovim
38+
39+ Format on save with [ conform.nvim] ( https://github.com/stevearc/conform.nvim ) :
3140
3241``` lua
3342-- lazy.nvim setup
@@ -49,6 +58,17 @@ $env.TOPIARY_LANGUAGE_DIR = ($env.XDG_CONFIG_HOME | path join topiary languages)
4958},
5059```
5160
61+ ### helix
62+
63+ To format on save in Helix, add this configuration to your ` helix/languages.toml ` .
64+
65+ ``` toml
66+ [[language ]]
67+ name = " nu"
68+ auto-format = true
69+ formatter = { command = " topiary" , args = [" format" , " --language" , " nu" ] }
70+ ```
71+
5272## contribute
5373
5474Help to find format issues with following method (dry-run, detects parsing/idempotence/semantic breaking):
You can’t perform that action at this time.
0 commit comments