Git Default/Core Editor - Nano

0

Each time my cloud9 ec2 instance is booted up, it changes my git core.editor to "nano". I want my git core.editor to be "vim".

I have tried to set it up by directly editing the ~/.gitconfig file and also issuing the command git config --global core.editor "vim". While that works temporarily, it reverts back to "nano" when the ec2 instance is rebooted either by me or by aws.

How do I permanently change my git core.editor to "vim" in Cloud9?

已提問 1 年前檢視次數 300 次
1 個回答
0
已接受的答案

The .bashrc of the Linux user of Cloud9 contains a setting to force nano, so you can force vim by making the following changes.

$ vim ~/.bashrc  

~omission (of middle part of a text)~

# modifications needed only in interactive mode
if [ "$PS1" != "" ]; then
    # Set default editor for git
    #git config --global core.editor nano                      ## <--- Comment out
    git config --global core.editor 'vim -c "set fenc=utf-8"'  ## <--- Add
profile picture
專家
已回答 1 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南