Question

I've got Vim73 on Windows, and I'm trying to move files through the file browser.

It had been giving me an error about "move" not being executable (see this post). After some debugging I discovered the issue was in my vim73\autoload\netrw.vim file. I got the move command working, but there's another issue - apparently the directory that I'm browsing in with :Ex is not my current working directory, so the mv.exe command (from UnxUtils) can't find the source or destination.

The line from netrw that causes the problems is this one:

 let ret= system(g:netrw_localmovecmd." ".shellescape(fname)." ".shellescape(s:netrwmftgt))

I tried wrapping the shellescape() functions in expand(), but that didn't seem to help.

Any idea how I can get the absolute path for the source and destinations?

Was it helpful?

Solution 2

Well, as it turns out, when your cursor is on the .. in the file list it considers that a directory.

All I really needed to do was move the cursor into the banner area before trying to mt - or mt from the parent directory.

Whoops!

OTHER TIPS

Rather than trying for the absolute path, would setting g:netrw_keepdir to 0 work for you? It's not exactly what you want (which I suspect is to take the vim CWD and apply it to netrw instead of the other way 'round), but if you're OK with using netrw to manage your vim CWD, your commands might just work as-is.

Edit: Look at :help netrw-c for the verbose explanation. The c command in netrw might be enough.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top