Issue with netrw copy and move

669 views
Skip to first unread message

Bart Baker

unread,
Apr 4, 2012, 9:02:48 AM4/4/12
to vim_use
Hello,

I'm using gVim 7.3 with netrw v142 on Windows XP SP3. I am not able to
copy or move files within netrw.

After marking a target (mt) and file (mf) and attempting to move (mm),
I receive the following message:

**error** (netrw) command<move> is not executable!

Using the same procedure but instead attempting to copy (mc), the
procedure fails, but I do not receive a message.

Dropping into the source code, it looks like netrw is attempting to
use the MS-DOS commands "move" and "copy" to move the files. The whole
reason that I switched from NERDTree back to netrw was because I
thought copy functionality worked.

When I echo the vimscript command 'executable("move")' or
'executable("copy")' within gVim or Vim, both of these return '0'.

Vim does not recognize these as valid command line commands, even
though they can be used in the windows command prompt. I also made a
related discovery that these old MS-DOS commands do not show up in my
path.

Thank you for your help,
Bart

Charles Campbell

unread,
Apr 5, 2012, 10:00:37 AM4/5/12
to vim...@googlegroups.com
Hello!

v145a of netrw (available from my website as
http://www.drchip.org/astronaut/vim/index.html#NETRW) has the following
variables:

g:netrw_localmovecmd
g:netrw_localcopycmd
g:netrw_localrmdir
g:netrw_localmkdir

(v144 and earlier style names were in the format g:netwr_local_movecmd,
etc)

You might want to consider setting these with whatever works for you.

Regards,
Chip Campbell

Bart Baker

unread,
Apr 10, 2012, 1:28:50 PM4/10/12
to vim...@googlegroups.com
Thanks for the help Charles.

I actually ended up just hacking the autoload/netrw.vim file and
surrounding each function call with:

set noshellslash
*function call*
set shellslash

While its not pretty, it works like a charm. Also, I got rid of the
"executable()" condition when attempting to call the MS-DOS commands.

Thanks for your suggestion though. I may try this upgrade down the line.

-Bart

> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php

Charles Campbell

unread,
Apr 10, 2012, 2:47:32 PM4/10/12
to vim...@googlegroups.com
Bart Baker wrote:
> Thanks for the help Charles.
>
> I actually ended up just hacking the autoload/netrw.vim file and
> surrounding each function call with:
>
> set noshellslash
> *function call*
> set shellslash
>
> While its not pretty, it works like a charm. Also, I got rid of the
> "executable()" condition when attempting to call the MS-DOS commands.
>
> Thanks for your suggestion though. I may try this upgrade down the line.
>
I'm mystified as to why you need to "set noshellslash"; netrw doesn't
set it. Why not put "set nossl" in your .vimrc? Or, why do you need
ssl set, anyway? Just curious.

Hacking it means that subsequent upgrades/changes to netrw will be that
more difficult for you, as you probably know.

I've changed the executable test to be executable("cmd"), since
Windoze doesn't support copy/move/mkdir/rmdir as separate commands.

Regards,
Chip Campbell

A Loumiotis

unread,
Apr 10, 2012, 8:31:35 AM4/10/12
to vim...@googlegroups.com
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php

Hi,

I'm facing exactly the same problem that Bart mentioned with netrw
v146a as well. I'm using gVim 7.3 on Windows XP SP3.
I'm not sure what other MS-DOS commands to use besides "MOVE" and
"COPY" to set the variables "g:netrw_localmovecmd" and
"g:netrw_localcopycmd".

Any ideas?

Antonis Loumiotis

Charles Campbell

unread,
Apr 10, 2012, 4:49:51 PM4/10/12
to vim...@googlegroups.com
A Loumiotis wrote:
> Hi,
>
> I'm facing exactly the same problem that Bart mentioned with netrw
> v146a as well. I'm using gVim 7.3 on Windows XP SP3.
> I'm not sure what other MS-DOS commands to use besides "MOVE" and
> "COPY" to set the variables "g:netrw_localmovecmd" and
> "g:netrw_localcopycmd".
>
> Any ideas?
>
Try v146c (http://www.drchip.org/astronaut/vim/index.html#NETRW). I'd
like to know if it works before giving it to Bram for major distribution.

I'll be trying to get mingw and compile vim for native windows myself
soon. I had a native vim under Windows, but that was before the latest
updates to cygwin meant that the cygwin compiler no longer handles
native windows executable production.

Regards,
Chip Campbell

Marcin Szamotulski

unread,
Apr 10, 2012, 5:06:18 PM4/10/12
to vim...@googlegroups.com
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php

Hello,

It seems that the function mathmenu#StartMathMenu() contains small bug in the
definition of maps: <Plug>MathMenuSubscript, <Plug>MathMenuSuperscript and
<Plug>MathMenuMathify. The following I found in autoload/mathmenu.vim:

vno <buffer> <silent> <Plug>MathMenuSubscript <esc>gv:B call mathmenu#Subscript()<cr>
vno <buffer> <silent> <Plug>MathMenuSuperscript <esc>gv:B call mathmenu#Superscript()<cr>
vno <buffer> <silent> <Plug>MathMenuMathify <esc>gv:B call mathmenu#Mathify()<cr>

I guess in all three the B should be just <C-U>, or just:
vno <buffer> <silent> <Plug>MathMenuSubscript :<c-u>call mathmenu#Subscript()<cr>
vno <buffer> <silent> <Plug>MathMenuSuperscript :<c-u>call mathmenu#Superscript()<cr>
vno <buffer> <silent> <Plug>MathMenuMathify :<c-u>call mathmenu#Mathify()<cr>

And this works here just fine.

Best regards,
Marcin Szamotulski

Charles Campbell

unread,
Apr 10, 2012, 5:22:13 PM4/10/12
to vim...@googlegroups.com
Hmm, actually its fine. What's missing is the vis.vim plugin, which
I'll make a part of the vimball.

It defines a "B" command, supporting block-visual selection.

Thank you for letting me know (I've had mathmenu out for over a year
now, and yours is the first report about this),
Chip Campbell


Marcin Szamotulski

unread,
Apr 11, 2012, 4:29:18 AM4/11/12
to vim...@googlegroups.com

I'd prefer if the maps where defined using the function vis#VisBlockCmd()
instead of :B command. I could than safely remove vis.vim public interface in
my vimrc file.

Best,
Marcin

A Loumiotis

unread,
Apr 11, 2012, 8:40:23 AM4/11/12
to vim...@googlegroups.com

Hi,

Updating to v146c of netrw did not solve the problem.

Do I have to modify the function mathmenu#StartMathMenu()?
Should I install the vis.vim plugin?

I'm a new user of gVim and not an expert in programming.

Best,
Antonis

Charles Campbell

unread,
Apr 11, 2012, 9:26:51 AM4/11/12
to vim...@googlegroups.com
A Loumiotis wrote:
> Updating to v146c of netrw did not solve the problem.
>
Try v146d -- its difficult to do this without having a system to test
with, I'm sorry. I probably won't be able to get to trying to compile
and run a native windows vim again until this weekend
IMHO the problem lies with the executable() test; it cannot determine
that a command is executable if its actually being executed by a shell
program (ie. cmd.exe), and falsely returns that the command is not
executable (when, in fact, it will execute).

> Do I have to modify the function mathmenu#StartMathMenu()?
> Should I install the vis.vim plugin?
>
Just to be sure: this math stuff is totally independent of the "netrw
copy and move" issue; I think Marcin S. brought this up in the wrong
thread. So:

* you don't need the math plugin for netrw

* the latest math vimball now includes vis.vim (and cecutil);
documentation for them is not included, you'll need to directly get the
vis vimball for that (documentation for the math plugin itself *is*
included, of course)

Regards,
Chip Campbell

A Loumiotis

unread,
Apr 12, 2012, 7:32:06 AM4/12/12
to vim...@googlegroups.com
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php

Thanks for your help and for the clarifications Chip.

I tried v146d but still the copy and move commands do not work.

I would like to report though that the following message:


**error** (netrw) command<move> is not executable!

does not appear anymore when using (mm) to move. But the file(s) are
not moved.

Best regards,
Antonis

Bart Baker

unread,
Apr 13, 2012, 10:28:56 AM4/13/12
to vim...@googlegroups.com

Thanks again for your help.

Chip, I took your wise advice and updated to version 146d. I was able
to use the local copy command (woohoo!), but now, when I attempt "mt
mf mm" on a single file, I get the following message (after
uncommenting the Decho calls):

Error detected while processing function <SNR>39_NetrwMarkFileMove:
line 23:
E121: Undefined variable: s:netrwmarkfilelist_18
E15: Invalid expression: s:netrwmarkfilelist_{bufnr("%")}

When I leave the file as is leaving the Decho call lines commented
out, I experience the same issue as Antonis.

Thanks,
Bart

Charles E Campbell Jr

unread,
Oct 24, 2012, 11:45:36 AM10/24/12
to vim...@googlegroups.com
Hello!

Sorry its taken so long to reply to this (I think that my home computer
downloaded the email and I didn't see it on my work computer).

Actually the :B is intentional ; what's not is the missing plugin that
needs to support this (vis.vim). I'll make the vis plugin part of the
mathmenu package. You can get vis by itself from my website:
http://www.drchip.org/astronaut/vim/index.html#VIS .

Regards,
C Campbell

Reply all
Reply to author
Forward
0 new messages