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

Getting "gf" to support custom remote paths similar to "scp://"

Expand Messages
  • David Barnett
    I ve implemented my own BufReadCmd autocmds to fetch certain remote files, similar to scp:// . In normal mode, I can put the cursor over
    Message 1 of 4 , Nov 28, 2012
    • 0 Attachment
      I've implemented my own BufReadCmd autocmds to fetch certain remote files, similar to "scp://".

      In normal mode, I can put the cursor over "scp://127.0.0.1/foo.txt" and type "gf" and it will correctly use netrw to fetch the file over SSH. But in my case, I see
      E447: Can't find file "my_scheme://127.0.0.1/foo.txt" in path

      Is there a way I can register my patterns so that I can use "gf" without vim searching my path?

      --
      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
      ... Check out how netrw does it -- see netrwPlugin.vim . Essentially, it involves making an appropriate autocmd. Regards, C Campbell -- You received this
      Message 2 of 4 , Dec 6, 2012
      • 0 Attachment
        David Barnett wrote:
        > I've implemented my own BufReadCmd autocmds to fetch certain remote files, similar to "scp://".
        >
        > In normal mode, I can put the cursor over "scp://127.0.0.1/foo.txt" and type "gf" and it will correctly use netrw to fetch the file over SSH. But in my case, I see
        > E447: Can't find file "my_scheme://127.0.0.1/foo.txt" in path
        >
        > Is there a way I can register my patterns so that I can use "gf" without vim searching my path?
        >
        Check out how netrw does it -- see netrwPlugin.vim . Essentially, it
        involves making an appropriate autocmd.

        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
      • David Barnett
        ... Nope, I already made the necessary autocmd (as I mentioned above), but it turns out it s a limitation of vim and it would be impossible for me to have
        Message 3 of 4 , Feb 8, 2013
        • 0 Attachment
          On Thursday, December 6, 2012 7:45:16 AM UTC-8, Charles Campbell wrote:
          > Check out how netrw does it -- see netrwPlugin.vim . Essentially, it
          >
          > involves making an appropriate autocmd.
          Nope, I already made the necessary autocmd (as I mentioned above), but it turns out it's a limitation of vim and it would be impossible for me to have "my_scheme://anything" handled by the "gf" mapping without modifying vim's code.

          It has a special case in find_file_name_in_path() to accept anything with "://" in it (or almost anything... "myscheme://anything" is accepted but "my_scheme://anything" isn't). In my case I was trying to set something up for perforce depot paths that begin with "//depot/".

          It would be really great if, instead of having a hack to look for "://", vim would check for a matching BufReadCmd autocmd and base the decision of whether to accept the filename on that. In that case "foo://bar" would no longer be accepted as valid and my "//depot/something" would start being accepted since I've defined the autocmd.

          David

          --
          --
          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 David! ... I don t really understand your problem, but hey, you can always propose a patch to change Vims behaviour. Mit freundlichen Grüßen Christian --
          Message 4 of 4 , Feb 9, 2013
          • 0 Attachment
            Hi David!

            On Fr, 08 Feb 2013, David Barnett wrote:

            > On Thursday, December 6, 2012 7:45:16 AM UTC-8, Charles Campbell wrote:
            > > Check out how netrw does it -- see netrwPlugin.vim . Essentially, it
            > >
            > > involves making an appropriate autocmd.
            > Nope, I already made the necessary autocmd (as I mentioned above), but it turns out it's a limitation of vim and it would be impossible for me to have "my_scheme://anything" handled by the "gf" mapping without modifying vim's code.
            >
            > It has a special case in find_file_name_in_path() to accept anything with "://" in it (or almost anything... "myscheme://anything" is accepted but "my_scheme://anything" isn't). In my case I was trying to set something up for perforce depot paths that begin with "//depot/".
            >
            > It would be really great if, instead of having a hack to look for "://", vim would check for a matching BufReadCmd autocmd and base the decision of whether to accept the filename on that. In that case "foo://bar" would no longer be accepted as valid and my "//depot/something" would start being accepted since I've defined the autocmd.

            I don't really understand your problem, but hey, you can always propose
            a patch to change Vims behaviour.

            Mit freundlichen Grüßen
            Christian
            --
            Hallo. Ich bin eine Lösung auf der Suche nach ihrem Problem.

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