Saturday, March 30, 2013

Re: Get netrw to ignore executability of file

On 30/03/13 20:46, AndyHancock wrote:
> For netrw 140, one of the differences between the Windows gvim and
> Cygwin/X11 gvim is that the Cygwin/X11 version will show the
> executable files with "highlight netrwExe" which is linked to
> "highlight Preproc". This does not happen with the Windows version,
> even netrwExe is also linked to PreProc. I assume that it is because
> the executability of each file is not conveyed to gvim and/or netrw,
> or because it is not *properly* conveyed.
>
> I actually prefer the behaviour without special highlighting of
> executable files because in Windows, files seem to be marked
> executable in a random manner (at least as viewed using "ls -l" in
> Cygwin's bash). So the highlighting is random and is the source of
> cognitive noise. Furthermore, even if that was not the case, I rarely
> make use of the information about a file's executability. True binary
> executables are always collected away in their own directories and are
> rarely mixed with other file types, so there is no need to highlight
> them and distinguigh them from brethren files. As well, for my
> purposes, the notion of executables have blurred e.g. vim files,
> matlab files, bash files, perl file, etc.. Particularly in Windows,
> it doesn't matter much whether one launches an app by double-clicking
> on the binary executable or by double-clicking a file with an
> extension that invokes a particular app.
>
> I tried to get rid of netrwExe highlighting by linking it to Normal.
> This was OK, but the asterisk that immediately follows the filename to
> indicate executability still there, and is definitely not Normal. It
> is still loudly pronouncing itself in netrwExe highlighting. Is there
> a way to get rid of the distinction of executability all together?
>

FAT filesystems have no built-in executable bit. I'm less sure about
NTFS filesystems. OTOH POSIX-compatible filesystems typically have
"rwxrwxrwx" permissions, and IIRC Cygwin tries to simulate that for your
Windows files. When I was on Windows (with Cygwin installed), ISTR that
everything had the executable bits set from the Cygwin POV. Windows
executables are of course distinguished by their extension (.EXE etc.
for binaries, .BAT etc. for shell scripts) but you may also have bash
scripts with either .sh or no extension at all, for use with Cygwin bash.

You may try running chmod a+x * to mark everything as "executable",
which will make the *distinction* disappear (everything will be the same
again). GNU chmod has a -R (recursive) option but I'm not sure how to
avoid looping forever on Cygwin's representation of your Windows
filesystem. Maybe reading "man chmod" in a Cygwin bash shell may help you.


Best regards,
Tony.
--
Do not read this fortune under penalty of law.
Violators will be prosecuted.
(Penal Code sec. 2.3.2 (II.a.))

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment