non important commit
This commit is contained in:
parent
5fa8c51008
commit
3b264457e9
1 changed files with 9 additions and 6 deletions
|
|
@ -41,26 +41,29 @@
|
||||||
fastfetch
|
fastfetch
|
||||||
}
|
}
|
||||||
|
|
||||||
def edit [file?: path] {
|
def edit [user_file?: path] {
|
||||||
if ($file | is-empty) or ($file == null) {
|
let file = if ($user_file | is-empty) or ($user_file == null) {
|
||||||
$file = pwd
|
pwd
|
||||||
|
} else {
|
||||||
|
$user_file
|
||||||
}
|
}
|
||||||
|
|
||||||
let git_result = do { git rev-parse --show-toplevel } | complete
|
let git_result = do { git rev-parse --show-toplevel } | complete
|
||||||
|
|
||||||
if $git_result.exit_code == 0 {
|
if $git_result.exit_code == 0 {
|
||||||
let root = $git_result.stdout | str trim
|
let root = $git_result.stdout | str trim
|
||||||
|
|
||||||
let flake_path = $root | path join "flake.nix"
|
let flake_path = $root | path join "flake.nix"
|
||||||
|
|
||||||
if not ($flake_path | path exists) {
|
if not ($flake_path | path exists) {
|
||||||
nvim $file
|
nvim $file
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
cd $root
|
cd $root
|
||||||
nix develop . --command bash -c $"nvim ($file)"
|
# Pass nvim directly as the command instead of wrapping in bash -c
|
||||||
|
nix develop . --command nvim $file
|
||||||
} else {
|
} else {
|
||||||
nvim $file
|
nvim $file
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue