This content originally appeared on DEV Community and was authored by Sam E. Lawrence
If you're like me, when you get a new machine from work, the first thing you do is slap zsh on it, pull down your new repos, and start digging. It's all fun and games until you run git branch
and BLAM, you're stuck in Vim-land now, hope you brought a towel. I've seen more than a few new developers get stuck here, and I've had to embarrassingly ask for help myself, so if you're finding yourself stuck in this situation, know that you're not alone and you'll be ok. Just type :wq
and you should return to the terminal. However, if you want to prevent this happening again, read on.
WARNING: This change is global and will affect all your git repositories. See the link below for details if you want to control this setting per repo.
git config --global core.pager cat
This command modifies the global git configuration to use the tool cat
as the terminal pager for all your future git commands. By default, on a new Mac with zsh installed, Vi is used... or Vim... I still don't really understand the difference, but it's one of them and you can't get out without :wq
.
Remember that after changing any configurations, you will need to re-launch your terminal to see changes take effect.
Source: StackOverflow
This content originally appeared on DEV Community and was authored by Sam E. Lawrence
Sam E. Lawrence | Sciencx (2021-05-11T20:44:10+00:00) How To Avoid Getting Stuck in Vim as a New git User. Retrieved from https://www.scien.cx/2021/05/11/how-to-avoid-getting-stuck-in-vim-as-a-new-git-user/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.