Unable to change the default editor in terminal

后端 未结 9 1674
南笙
南笙 2020-12-09 07:55

My default editor is pico at my server. I use Bash and Linux.

I tried to change Vim to be my default editor unsuccessfully by

echo vim > $EDITOR
         


        
9条回答
  •  再見小時候
    2020-12-09 08:07

    You can use the git config option core.editor to set the editor of your liking, eg nano

    $ git config [--global] core.editor "nano"
    

    You can also change this by editing the .gitconfig file in your home directory (global) or git repo (create it if it doesn't exist) if you don't have shell access:

    ...
    [user]
      name = Your Name
      email = your@email.address
    [core]
      editor = nano
    ...
    

提交回复
热议问题