LinuxWizardry
  • Home
  • Tutorials
  • News
  • Ubuntu
  • Centos
  • Tools
No Result
View All Result
LinuxWizardry
  • Home
  • Tutorials
  • News
  • Ubuntu
  • Centos
  • Tools
No Result
View All Result
LinuxWizardry
No Result
View All Result

How to Make Vim the Default Editor for Git and OS in Ubuntu and Macos

Git all the things!

by Robert Keller
November 11, 2022
in Tips
ShareTweetShareShare

Most git commands require you to either write or update a message. Typically, when you resolve a merge conflict or you try to modify a commit it opens up an editor for you to make the change. While this is not particular to Linux, on Linux systems you ussually have the option of using Emacs or Vim. By default git will use Emacs which in some cases can be annoying if you don’t know how to use it.

In this article we are going to learn how to change the default editor to Vim so that any time you need to update a commit message or anything like that you get Vim to open up. Besically using the command below you can change the default editor to Vim

git config --global core.editor "vim"

This updates systemwide so you never have to worry about using Emac or any other editor.

Additionally, there’s a way to also set Vim for other programs as well, set the standardized VISUAL and EDITOR environment variables in your terminal resource file (.zshrc, .bashrc, config.fish etc.)

export VISUAL=vim
export EDITOR="$VISUAL"

That’s all folks! Next time you use git, Vim becomes the default editor!

ShareTweetShareShare
Previous Post

Linus Torvalds Officially Kicks off Development Cycle for Linux Kernel 6, Release Candidate (RC) Announced

Next Post

How to Run Metabase and Nginx as a Reverse Proxy on Rocky Linux 9

Next Post
How to Run Metabase and Nginx as a Reverse Proxy on Rocky Linux 9

How to Run Metabase and Nginx as a Reverse Proxy on Rocky Linux 9

Discussion about this post

Copyright © 2022 LinuxWizardry.com

No Result
View All Result
  • #682 (no title)

Copyright © 2022 LinuxWizardry.com

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In