Changing working directory of gvim launched from nautilus

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
tenta

Changing working directory of gvim launched from nautilus

Post by tenta »

Hi,

when I open a text file in nautilus (version 2.32.0), it is opened in gvim,
like desired. But the working directory of gvim is $HOME, not the current
directory. This is annoying, since I often load and save files from/to the
current directory.

How can I convince nautilus to set the working directory for gvim to the
currently opened directory?

Linux Mint 10 (Julia)

Regards
Marco
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
tenta

Re: Changing working directory of gvim launched from nautilu

Post by tenta »

Any ideas?
pompom

Re: Changing working directory of gvim launched from nautilu

Post by pompom »

Welcome to Linux Mint!

One way is to add "set autochdir" in your .vimrc file, but some plugins may complain.

Cheers,

pompom
tenta

Re: Changing working directory of gvim launched from nautilu

Post by tenta »

It's not a perfect solution, but a good workaround.

Nonetheless I would like to know the reason for this behaviour. I have a second system (debian). There the working directory is the directory I see in nautilus (older version). .vimrc is the same.

Anyway, thanks for the response.

Regards
Marco
Locked

Return to “Software & Applications”