LoginSignup
5
0

More than 1 year has passed since last update.

【Git】VimをGitのエディタのdefaultに設定する方法

Last updated at Posted at 2022-07-09

はじめに

VimをGitのエディタのdefaultに設定する方法を書いておきます。

本記事を書こうと思った背景

自宅のPCでTerraformのコードを触っている中でgit rebaseを実施しようとした際に、「atomのコマンドは存在しない」というエラーが表示されたため。

% git rebase -i --autosquash 9fd7947
hint: Waiting for your editor to close the file... atom --wait: atom: command not found
error: There was a problem with the editor 'atom --wait'.
%

既にatomはアンインストール済みですが、Git側の設定を変更することを忘れておりました。

対応

Vimをgitのエディタのdefaultに設定する。

コマンド
git config --global core.editor vim

設定確認は以下になります。

設定確認
% git config --global --list | grep editor
core.editor=vim
%

こちらの設定をすることで、git rebasegit commitを使用するとデフォルトでVimが起動されるようになります。

参考記事

5
0
1

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
5
0