How to Add and edit a .vimrc file in cygwin

0

Recently I downloaded the cygwin file setup-x86_64.exe and run it, and I selected all the vim packages and install them as well. Now i'm trying to edit the vimrc file to install some Plugins, but when i type :e $MYVIMRC in vim, vim just opens a new file named $MYVIMRC.

Questions are:

  1. where and how do i find and edit my vimrc to edit it and install the plugins I want?
  2. Do i need to make a new .vimrc?

Acording to: Install Vim in Cygwin Cygwin does not have a .vimrc file.

notes:

  1. I use a Windows 10 Machine, 64bit operating systems, x64-based processor.
  2. I intend to program in Python3 and what to use vim as my text editor.

noer

Posted 2017-09-07T09:04:56.997

Reputation: 3

Answers

2

First, you have to locate your home folder. For example open vim and enter the command :

:!echo $HOME

Then, you just have to put your .vimrc file in the right location which is $HOME/.vimrc.

hugoShaka

Posted 2017-09-07T09:04:56.997

Reputation: 136

1The ! is not necessary, since Vim has an internal :echo command and $HOME is an environmental variable that is visible within Vim. – Heptite – 2017-09-08T16:49:12.890

1

The :edit (:e) command does not expand environmental variables. Try this:

:exe "e " . $MYVIMRC

Make sure you include the space after the e before the ".

But the easiest way to do it is just use the ~ expansion that does work with :e:

:e ~/.vimrc

Heptite

Posted 2017-09-07T09:04:56.997

Reputation: 16 267