diff --git a/README.md b/README.md index bf2d7d7..f3e1fe3 100644 --- a/README.md +++ b/README.md @@ -18,5 +18,4 @@ This project is currently a work-in-progress. Only the fish shell is supported a - Double wh does an la, not ls - Git Repo detection for ls - Clipboard functionality - - sudo vim - Binary File MIME Types diff --git a/do_what.py b/do_what.py index e3ee5df..3baab68 100644 --- a/do_what.py +++ b/do_what.py @@ -141,7 +141,10 @@ elif ( (not active and len(sys.argv) == 2) or (active and len(sys.argv) == 3) ): if ( is_binary_file(path) ): print("echo Binary file.") else: - print(edit_file+" "+path) + if ( os.access(path, os.W_OK) ): + print(edit_file+" "+path) + else: + print("sudo "+edit_file+" "+path) else: # check if file is a path program, then list using which/man on active diff --git a/what.config b/what.config deleted file mode 100644 index dcef7e5..0000000 --- a/what.config +++ /dev/null @@ -1,5 +0,0 @@ -[DEFAULT] -print_file = cat -pretty_print_file = less -R -edit_file = vim -list_directory = ls --color=auto