nushell helix
This commit is contained in:
33
nushell/modules/pj_helix.nu
Normal file
33
nushell/modules/pj_helix.nu
Normal file
@@ -0,0 +1,33 @@
|
||||
export-env {
|
||||
$env.PJ_HELIX_CONFIG_PATH = $env.NU_POLYJUICE_PATH | path join ".." "helix" "config.toml"
|
||||
}
|
||||
|
||||
export def hx [...rest: string] {
|
||||
if (which ^helix | is-not-empty) {
|
||||
^helix -c $env.PJ_HELIX_CONFIG_PATH ...$rest
|
||||
} else if (which ^hx | is-not-empty) {
|
||||
^hx -c $env.PJ_HELIX_CONFIG_PATH ...$rest
|
||||
} else {
|
||||
print "Helix editor not found."
|
||||
if ($env.OS == "Windows_NT") {
|
||||
print "You can install Helix via `winget install Helix.Helix`"
|
||||
} else {
|
||||
print "You can install Helix from package managers."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export def helix [...rest: string] {
|
||||
if (which ^helix | is-not-empty) {
|
||||
^helix -c $env.PJ_HELIX_CONFIG_PATH ...$rest
|
||||
} else if (which ^hx | is-not-empty) {
|
||||
^hx -c $env.PJ_HELIX_CONFIG_PATH ...$rest
|
||||
} else {
|
||||
print "Helix editor not found."
|
||||
if ($env.OS == "Windows_NT") {
|
||||
print "You can install Helix via `winget install Helix.Helix`"
|
||||
} else {
|
||||
print "You can install Helix from package managers."
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user