How To Avoid Getting Stuck in Vim as a New git User

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 t…


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


Print Share Comment Cite Upload Translate Updates
APA

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/

MLA
" » How To Avoid Getting Stuck in Vim as a New git User." Sam E. Lawrence | Sciencx - Tuesday May 11, 2021, https://www.scien.cx/2021/05/11/how-to-avoid-getting-stuck-in-vim-as-a-new-git-user/
HARVARD
Sam E. Lawrence | Sciencx Tuesday May 11, 2021 » How To Avoid Getting Stuck in Vim as a New git User., viewed ,<https://www.scien.cx/2021/05/11/how-to-avoid-getting-stuck-in-vim-as-a-new-git-user/>
VANCOUVER
Sam E. Lawrence | Sciencx - » How To Avoid Getting Stuck in Vim as a New git User. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/05/11/how-to-avoid-getting-stuck-in-vim-as-a-new-git-user/
CHICAGO
" » How To Avoid Getting Stuck in Vim as a New git User." Sam E. Lawrence | Sciencx - Accessed . https://www.scien.cx/2021/05/11/how-to-avoid-getting-stuck-in-vim-as-a-new-git-user/
IEEE
" » How To Avoid Getting Stuck in Vim as a New git User." Sam E. Lawrence | Sciencx [Online]. Available: https://www.scien.cx/2021/05/11/how-to-avoid-getting-stuck-in-vim-as-a-new-git-user/. [Accessed: ]
rf:citation
» How To Avoid Getting Stuck in Vim as a New git User | Sam E. Lawrence | Sciencx | 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.

You must be logged in to translate posts. Please log in or register.