kevin lu
kevin lu

Reputation: 17

Where are my files saved in vim for windows

I have been using the gvim command :w to save and it works fine saving it to the desktop. However with the vim program, when I use the command :w, I cannot find where the saved file is located.

Upvotes: 1

Views: 6878

Answers (4)

Vedant Roy
Vedant Roy

Reputation: 11

C:\Users\"windows user"\AppData\Local\Packages\KaliLinux.54290C8133FEE_ey8k8hqnwqnmg\LocalState\rootfs\home\"WSL user"

Upvotes: 1

dlmeetei
dlmeetei

Reputation: 10381

Adding another answer to get the filename as well. As mentioned by Cary and Jeen, vim saves your file to the directory from where it is started. You can get the directory where it is saved using :pwd.

If you are interested to get name of the file, it can be done by ctrl + g when your laststatus=1, which is the default value. I usually set laststatus=2 which always show the filename.

Upvotes: 0

Jeen Broekstra
Jeen Broekstra

Reputation: 22042

As said by others: by default it saves in the directory where you started it. But if you aren't aware in which directory you started, then a way to find out is to use the :pwdcom in vim. This will output the current directory. That's where vim will store the file.

Upvotes: 2

Cary Shindell
Cary Shindell

Reputation: 1386

It should save to whatever directory you started writing it in (you can see that in the command line). You can also use your computer's file search to locate it and then inspect for the file path.

Upvotes: 2

Related Questions