Cygwin Vim vimrc Location

Just wanted to say this:

In Vim under Cygwin the user’s vimrc is not looked up as ~/.vimrc.

One of the correct locations is ~/.vim/vimrc. It will be read whether you start your editor as “vi” or as “vim”. You can use a template to start with:

Markku@T540p ~
$ mkdir .vim

Markku@T540p ~
$ cp /usr/share/vim/vim74/vimrc_example.vim .vim/vimrc

Markku@T540p ~
$

If you are interested in all the possible places vi or vim checks for the virc or vimrc file, use the command “vi -V” or “vim -V” and check the first lines of the output. Example:

Markku@T540p ~
$ vi -V
chdir(/etc)
fchdir() to previous dir
could not source "/etc/virc"
chdir(/home/Markku)
fchdir() to previous dir
could not source "$HOME/.virc"
chdir(/home/Markku/.vim)
fchdir() to previous dir
sourcing "~/.vim/vimrc"
finished sourcing ~/.vim/vimrc
Press ENTER or type command to continue

At least in my Cygwin installation using the default vimrc template enables the arrow keys to work correctly.

Updated: November 24, 2023 — 22:18

1 Comment

Add a Comment
  1. Thank you. Thank you so much…

Leave a Reply to RannaMyszaCancel reply