Loading ...
Sorry, an error occurred while loading the content.

Get netrw to ignore executability of file

Expand Messages
  • AndyHancock
    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
    Message 1 of 9 , Mar 30, 2013
    • 0 Attachment
      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?

      --
      --
      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@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Tony Mechelynck
      ... FAT filesystems have no built-in executable bit. I m less sure about NTFS filesystems. OTOH POSIX-compatible filesystems typically have rwxrwxrwx
      Message 2 of 9 , Mar 30, 2013
      • 0 Attachment
        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@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • Charles E Campbell
        ... May I suggest that you look into man getfacl man setfacl The executability of the files is controlled by the executable bits AND by ACLs. Try ls -lsa
        Message 3 of 9 , Mar 30, 2013
        • 0 Attachment
          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.
          >
          May I suggest that you look into

          man getfacl
          man setfacl

          The executability of the files is controlled by the executable bits AND
          by ACLs.

          Try ls -lsa (using cygwin)

          and I suspect that you'll find a lot of permission strings with a
          trailing "+". That means that an acl is in control and apparently
          flagging the file as an executable.

          Regards,
          C Campbell

          --
          --
          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@....
          For more options, visit https://groups.google.com/groups/opt_out.
        • Charles E Campbell
          ... syn clear netrwExe syn clear netrwClassify Place in your (home)/.vim/after/syntax/netrw.vim file (or use vimfiles instead of .vim, whatever). C Campbell
          Message 4 of 9 , Mar 30, 2013
          • 0 Attachment
            AndyHancock wrote:
            >
            > 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?
            >
            syn clear netrwExe
            syn clear netrwClassify

            Place in your (home)/.vim/after/syntax/netrw.vim file (or use vimfiles
            instead of .vim, whatever).

            C Campbell

            --
            --
            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@....
            For more options, visit https://groups.google.com/groups/opt_out.
          • AndyHancock
            ... Thanks, Tony. I m on Windows 7, so it s NTFS. I just double checked, and whether a file is marked executable according to ls -l in cygwin s bash seems
            Message 5 of 9 , Mar 30, 2013
            • 0 Attachment
              On Mar 30, 5:56 pm, Tony Mechelynck wrote:
              > On 30/03/13 20:46, AndyHancock wrote: 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.

              Thanks, Tony. I'm on Windows 7, so it's NTFS.

              I just double checked, and whether a file is marked executable
              according to "ls -l" in cygwin's bash seems to vary, though I'm not
              sure how cygwin decides. "chmod -R" will fix it for the moment, but
              the directory subtree that I intend to use netrw on typically varies
              alot, so it's be great if I there is a way for netrw to ignore
              executability.

              --
              --
              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@....
              For more options, visit https://groups.google.com/groups/opt_out.
            • AndyHancock
              On Mar 30, 7:06 pm, Charles E Campbell ... Thanks Charles. It works like charm. I realize that shenanigans happen to convey the
              Message 6 of 9 , Mar 30, 2013
              • 0 Attachment
                On Mar 30, 7:06 pm, Charles E Campbell <drc...@...>
                wrote:
                > AndyHancock wrote:
                >
                > > 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?
                >
                > syn clear netrwExe
                > syn clear netrwClassify
                >
                > Place in your (home)/.vim/after/syntax/netrw.vim file  (or use vimfiles
                > instead of .vim, whatever).

                Thanks Charles. It works like charm.

                I realize that shenanigans happen to convey the executability of files
                to netrw. I just didn't want to wrestle with how cygwin does the
                translation.

                --
                --
                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@....
                For more options, visit https://groups.google.com/groups/opt_out.
              • Christian Brabandt
                Hi Tony! ... On windows, there is no executable bit and is actually not needed, because only certain file types are executable. So in principle is should be
                Message 7 of 9 , Mar 31, 2013
                • 0 Attachment
                  Hi Tony!

                  On Sa, 30 Mär 2013, Tony Mechelynck wrote:

                  > 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

                  On windows, there is no executable bit and is actually not needed,
                  because only certain file types are executable.
                  So in principle is should be possible to simply highlight .exe .bat .cmd
                  .com files as executable on Windows.

                  regards,
                  Christian
                  --
                  Frage an Radio Eriwan: "Stimmt es, daß in den USA jeder ein Auto hat?"
                  Antwort: "Im Prinzip ja, aber bei uns hat dafür jeder einen Parkplatz."

                  --
                  --
                  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@....
                  For more options, visit https://groups.google.com/groups/opt_out.
                • AndyHancock
                  ... Hi, Christian, I would say that you re right in principle. However, cygwin seems to use a different scheme to determine whether the executable bit is set.
                  Message 8 of 9 , Mar 31, 2013
                  • 0 Attachment
                    On Mar 31, 6:46 am, Christian Brabandt wrote:
                    > On windows, there is no executable bit and is actually not needed,
                    > because only certain file types are executable. So in principle is
                    > should be possible to simply highlight .exe .bat .cmd .com files as
                    > executable on Windows.

                    Hi, Christian,

                    I would say that you're right in principle. However, cygwin seems to
                    use a different scheme to determine whether the executable bit is
                    set. I haven't yet figured out exactly what the scheme is.

                    --
                    --
                    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@....
                    For more options, visit https://groups.google.com/groups/opt_out.
                  • Charles Campbell
                    ... However, under cygwin, under windows, plus NTFS, there is an executable bit and it does affect whether cygwin may try to execute that file or not
                    Message 9 of 9 , Apr 1, 2013
                    • 0 Attachment
                      Christian Brabandt wrote:
                      > On windows, there is no executable bit and is actually not needed,
                      > because only certain file types are executable. So in principle is
                      > should be possible to simply highlight .exe .bat .cmd .com files as
                      > executable on Windows. regards, Christian
                      However, under cygwin, under windows, plus NTFS, there is an executable
                      bit and it does affect whether cygwin may try to execute that file or
                      not (especially scripts). There's also ACLs, which may also cause files
                      to be considered executable. Again, see (using cygwin)\:

                      man getfacl
                      man setfacl

                      Regards,
                      C Campbell

                      --
                      --
                      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@....
                      For more options, visit https://groups.google.com/groups/opt_out.
                    Your message has been successfully submitted and would be delivered to recipients shortly.