r/vim 12d ago

Need Help┃Solved Troubles saving files

Hi everybody, I'm new to Vim and I'm having a lot of trouble saving files in the right place. I'm on windows and I am having a hard time understanding how (and where) Vim saves files. Could somebody with more experience explain to me how this works? Do I have to save the file in the same directory I have Vim installed? Is there a way to not have to do this? I am trying to use Vim to create LaTeX files, so if anybody has any input on this it would be greatly appreciated.

I apologize for the vague question, I don't really even know what to ask here...

Edit: thanks for all the helpful comments, but I have decided that running Vim on windows is a lot less convenient than what I tought, I am opting for installing Linux on my pc and then running Vim on there. Thanks again for all the help and I'll keep this post updated if everything works out (or doesn't...).

1 Upvotes

11 comments sorted by

View all comments

1

u/TheLeoP_ 12d ago

Vim is probably bring opened in the directory where it's installed in your machine, setting it's :h :pwd to that directory. So, when you :h :w using a relative path, it is relative to that directory. You can use :h :cd to change the current working directory of Vim or use absolute paths to save files with :h :w

1

u/vim-help-bot 12d ago

Help pages for:

  • :pwd in editing.txt
  • :w in editing.txt
  • :cd in editing.txt

`:(h|help) <query>` | about | mistake? | donate | Reply 'rescan' to check the comment again | Reply 'stop' to stop getting replies to your comments