Can't copy or move files with netrw

1,179 views
Skip to first unread message

Federico Panico

unread,
May 13, 2014, 9:25:42 AM5/13/14
to vim...@googlegroups.com
I hope someone can help with this. The title says it clearly.

In netrw, first I choose the file with mf, then select the target directory (not entering into it) with mt and finally press mm. The move is not successful and this error appears: **error** (netrw) tried using g:netrw_localmovecmd<mv>; it doesn't work!

I'm using linux and g:netrw_localmovecmd is set to mv.

Charles E Campbell

unread,
May 13, 2014, 8:22:51 PM5/13/14
to vim...@googlegroups.com
That error shows up when executable(g:netrw_localmovecmd) returns a zero.

Presumably, when you're in vim,

:echo executable("mv")

is returning zero. That's an odd thing to have happen under a Linux
system. So, the question is why?

* check your path
* check your shell
* do you have permission to execute?

That should be a beginning, at least.

Regards,
C Campbell

Federico Panico

unread,
May 14, 2014, 2:41:16 PM5/14/14
to vim...@googlegroups.com
Hi, DrChip. Thanks for asking.

> :echo executable("mv")

That returns a 1.

> * check your path

'which mv' return /usr/bin/mv

> * check your shell

Currently using zsh. Tried changing it to bash (chsh, logout, login) and still I get the same error.

> * do you have permission to execute?

I have write permissions on the files that I want to move and /usr/bin/mv is owned by root but everybody has permission to execute.

Charles E Campbell

unread,
May 16, 2014, 9:50:43 PM5/16/14
to vim...@googlegroups.com
Does :!mv file folder work?

The full test used is:

if !executable(g:netrw_localmovecmd) && g:netrw_localmovecmd !~
'^'.expand("$COMSPEC").'\s'
call
netrw#ErrorMsg(s:ERROR,"g:netrw_localmovecmd<".g:netrw_localmovecmd.">
not executable on your system, aborting",90)
return
endif

Please try

vim .
:echo !executable(g:netrw_localmovecmd) && g:netrw_localmovecmd !~
'^'.expand("$COMSPEC").'\s'

That's the only place in netrw that issues the message about localmvcmd
not being executable.

Regards,
Chip Campbell

P.S. netrw is up to v153a
(http://www.drchip.org/astronaut/vim/index.html#NETRW). You could try
:help netrw-debug but, as I said, that code snippet above is the only
place that message you're getting is given.

Federico Panico

unread,
May 17, 2014, 11:43:43 AM5/17/14
to vim...@googlegroups.com
El viernes, 16 de mayo de 2014 22:50:43 UTC-3, DrChip escribió:
> Does :!mv file folder work?

Yes.

> vim .
> :echo !executable(g:netrw_localmovecmd) && g:netrw_localmovecmd !~
> '^'.expand("$COMSPEC").'\s'

Returns 0.

$COMSPEC is not a variable in my arch linux installation.

Charles E Campbell

unread,
May 17, 2014, 3:03:41 PM5/17/14
to vim...@googlegroups.com
Federico Panico wrote:
> El viernes, 16 de mayo de 2014 22:50:43 UTC-3, DrChip escribió:
>> Does :!mv file folder work?
> Yes.
>
>> vim .
>> :echo !executable(g:netrw_localmovecmd) && g:netrw_localmovecmd !~
>> '^'.expand("$COMSPEC").'\s'
> Returns 0.
>
> $COMSPEC is not a variable in my arch linux installation.

I would have been surprised if it had -- its a Windows thing.

I suggest trying the "big debugging gun" -- follow the directions in
:help netrw-debug, generate a debugging trace, and we'll see what its
saying. I suggest you upgrade to the latest netrw first, too
(http://www.drchip.org/astronaut/vim/index.html) - that way, we're both
using the same plugin.

Regards,
Chip Campbell

Reply all
Reply to author
Forward
0 new messages