2
0

More than 1 year has passed since last update.

AWS Cloud9でGitのエディターを永続的にnanoからvimに変更する

Last updated at Posted at 2022-06-29

概要

  • Cloud9でTerminalからgitでコンフリクト修正やrebaseする際に起動するエディタをnanoからvimに変更する方法です。
  • Cloud9の場合、git configによるnanoエディタの指定が.bashrcに記載されています。
  • そのため、普通にgitコマンドでエディタ設定を変更(git config ~)してもログインの度に元に戻ってしまうため、.bashrc側を修正する必要があります。

設定方法

  • .bashrcの20行目あたりの以下部分を修正
.bashrc
$ vim ~/.bashrc  

~中略~

# 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

~中略~

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0