I am using a code editor named as CodeRunner 4 from Mac App store. I want to set it as default code editor in git, so that when I want to do some changes in files or adding a commit message, terminal will open this default code editor for me.
I tried on my own by doing
git config --global core.editor "coderunner4 --wait"
but nothing opens when I tried doing git commit
, instead this error message shown :
Aayushs-MBP: projectd/ $ git commit
hint: Waiting for your editor to close the file... coderunner4 --wait: coderunner4: command not found
error: There was a problem with the editor 'coderunner4 --wait'.
Please supply the message using either -m or -F option.
It says that there is no command like coderunner4
. I don't know how to find command which is set by developer to open this app.
I also tried to make default editor as Visual Studio Code by doing this :
git config --global core.editor "code --wait"
but same error message shown again when I tried to git commit
upon which it should open default git editor for adding commit message :
Aayushs-MBP: projectd/ $ git commit
hint: Waiting for your editor to close the file... code --wait: code: command not found
error: There was a problem with the editor 'code --wait'.
Please supply the message using either -m or -F option.
I think there might be a problem regarding .bash_profile
in which I have to set a path for applying commands like coderunner4
[for coderunner] and code
[for vs code]
So I also modified .bash_profile by adding this snippet from SO :
code () { VSCODE_CWD="$PWD" open -n -b "com.microsoft.VSCode" --args $* ;}
but nothing happened
I also tried to change the default editor by giving full path but again the slightly different error message shown :
Aayushs-MBP: projectd/ $ git config core.editor './Applications/CodeRunner.app --wait'
Aayushs-MBP: projectd/ $ git commit
hint: Waiting for your editor to close the file... ./Applications/CodeRunner.app --wait: ./Applications/CodeRunner.app: No such file or directory
error: There was a problem with the editor './Applications/CodeRunner.app --wait'.
Please supply the message using either -m or -F option.
Please help me to change my default code editor as CodeRunner 4 for git.