Solution 1: Run the following command select-editor Solution 2: Set environment variables Add the following variables in ~/.bashrc export EDITOR=vim export VISUAL=vim source ~/.bashrc