
It’s not in C:\ nor in the $HOME directory. However, since this is in Windows, we need to figure out where the etc folder is. This makes sense since the etc folder is where Linux systems place a lot of their configuration.


When I execute :scriptnames in Vim running in Git Bash, I see /etc/vimrc at the very top of the list. To find all scripts (remember that configuration is set via initialization scripts) you can use the command :scriptnames. Be aware that Vim already has default configuration set that is targeted towards programmers. There are many more configuration changes you can make. To check that it worked, open up the same file in Vim again and look for the line numbers. Save these changes by pressing esc to leave Insert Mode and then enter :wq to write the changes and then quit Vim. Then, enter Insert Mode by pressing i and enter three lines: " Custom Vim configuration Open the vimrc file using Vim: $ vim $HOME/.vim/vimrc To make sure it’s working, I’ll add a command to turn on line numbering. Then create the vimrc file: $ touch $HOME/.vim/vimrcĪt this point, we have our empty initialization file for Vim. Since Git Bash uses msys2 to imitate a Unixy/Linuxy style system, Vim running inside Git Bash will be following Unix’s Conventions, rather than MS-Windows’.Īlso let’s follow Vim’s recommendation for using the $HOME/.vim/ directory for configuration files. $HOME/.vim/ directory ($HOME/vimfiles/ for MS-Windows). RECOMMENDATION: Put all your Vim configuration stuff in the The files are searched in the order specified above and only the first MS-Windows $HOME/_vimrc, $HOME/vimfiles/vimrcĪmiga s.vimrc, home.vimrc, home:vimfiles:vimrc Places for your personal initializations: Then, in command mode, open the configuration help information with :help vimrc.Īt this point we can see where Vim will look for custom vimrc files. We can find out more information by using help commands inside Vim.įirst, open a Git Bash terminal and then open vim. They run at initialization when Vim is opened. These files are scripts written in Vimscript. Vim’s configuration can be customized with vimrc files. ( esc, : then q! to quit without saving, btw) Configuring Vim in Git Bash

Thankfully, my previous experience with exiting Vim saved me from an embarrassing search query in my browser history. And firing up vim from there is straightforward. And, lo! Git Bash has Vim.įiring up a quick Git Bash session is simple enough.
USING GIT BASH TUTORIAL PDF WINDOWS
Git for Windows comes with the ever useful, Git Bash. Though if you have Git for Windows installed, then you already have Vim available. This has a GUI interface and an installer executable. There is a Vim on Windows release available. I work primarily in Windows environments so, though the desire exists, there aren’t many good opportunities to build Vim habits. Occasionally I become enamored with the idea of becoming a Vim expert, or at least a competent Vim user.
