Use default launcher if vim not found (#559)

This commit is contained in:
Nathan Thomas 2024-01-13 22:49:07 -08:00 committed by GitHub
parent 4c210b9e52
commit 8bc87a4b74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -222,8 +222,11 @@ def config_open(ctx, vim):
if vim:
if shutil.which("nvim") is not None:
subprocess.run(["nvim", config_path])
else:
elif shutil.which("vim") is not None:
subprocess.run(["vim", config_path])
else:
logger.error("Could not find nvim or vim. Using default launcher.")
click.launch(config_path)
else:
click.launch(config_path)