diff --git a/home/modules/shells.nix b/home/modules/shells.nix index 5b48292..970d30c 100644 --- a/home/modules/shells.nix +++ b/home/modules/shells.nix @@ -42,25 +42,21 @@ } def edit [user_file?: path] { - let file = if ($user_file | is-empty) or ($user_file == null) { - pwd + let file = if ($user_file | is-empty) { + "." } else { $user_file } let git_result = do { git rev-parse --show-toplevel } | complete - if $git_result.exit_code == 0 { let root = $git_result.stdout | str trim let flake_path = $root | path join "flake.nix" - if not ($flake_path | path exists) { nvim $file return } - cd $root - # Pass nvim directly as the command instead of wrapping in bash -c nix develop . --command nvim $file } else { nvim $file