Unable to change the default editor in terminal

后端 未结 9 1677
南笙
南笙 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:13

    Since things have changed in MAC X you will have to add following in .profile file in base directory of the user

    export EDITOR='vim'
    

    you can follow following instructions:

    1> open terminal
    
    2> type - cd  [hit return/enter (this will take you to base directory)]
    
    3> type - echo "export EDITOR='vim'" >> .profile (hit return/enter and you are done)
    
    4>  (restart terminal)
    

    =========================

    OR just type:

    echo "export EDITOR='vim'" >> ~/.profile
    

    hit enter and restart

提交回复
热议问题