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

ctrlP to navigate arbitrary directory

Expand Messages
  • Kent
    Hello, I use FuzzyFinder for years. Recently I heard a lot about CtrlP. And gave it a try. It does have some good features over FF. However one thing I didn t
    Message 1 of 9 , Feb 28, 2013
    • 0 Attachment
      Hello,

      I use FuzzyFinder for years. Recently I heard a lot about CtrlP. And gave it a try. It does have some good features over FF. However one thing I didn't figure out, with FF(File search), I can type "/etc" to navigate to my root directory and do search, no matter which directory I am in.

      However for CtrlP, it seems that it searches only under current directory. In doc I found I can type .. to go to parent dir. but it didn't work for me somehow. 

      How can I navigate to arbitrary directory with CtrlP?
       
      thanks.

      --
      --
      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.
       
       
    • Benjamin R. Haskell
      ... You type .., then hit enter. ... You can t navigate to an arbitrary directory once CtrlP is up, but you ... -- Best, Ben -- -- You received this message
      Message 2 of 9 , Feb 28, 2013
      • 0 Attachment
        On Thu, 28 Feb 2013, Kent wrote:

        > Hello,
        > I use FuzzyFinder for years. Recently I heard a lot about CtrlP. And
        > gave it a try. It does have some good features over FF. However one
        > thing I didn't figure out, with FF(File search), I can type "/etc" to
        > navigate to my root directory and do search, no matter which directory
        > I am in.
        >
        > However for CtrlP, it seems that it searches only under current
        > directory. In doc I found I can type .. to go to parent dir. but it
        > didn't work for me somehow. 

        You type .., then hit enter.


        > How can I navigate to arbitrary directory with CtrlP?

        You can't navigate to an arbitrary directory once CtrlP is up, but you
        can invoke CtrlP on an arbitrary directory, e.g.:

        :CtrlP /home/bhaskell/git/project

        Also see:

        :help g:ctrlp_working_path_mode

        And:

        :help :CtrlPCurFile

        I've mapped the latter to ,n with:

        :nm <leader>n :CtrlPCurFile<CR>

        --
        Best,
        Ben

        --
        --
        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.
      • Benjamin R. Haskell
        ... Scratch that... The help tag has been removed in recent versions (wtf?), though the command remains. It s equivalent to CtrlP with the
        Message 3 of 9 , Feb 28, 2013
        • 0 Attachment
          On Thu, 28 Feb 2013, Benjamin R. Haskell wrote:

          > On Thu, 28 Feb 2013, Kent wrote:
          >
          >> Hello,
          >> I use FuzzyFinder for years. Recently I heard a lot about CtrlP. And gave
          >> it a try. It does have some good features over FF. However one thing I
          >> didn't figure out, with FF(File search), I can type "/etc" to navigate to
          >> my root directory and do search, no matter which directory I am in.
          >>
          >> However for CtrlP, it seems that it searches only under current directory.
          >> In doc I found I can type .. to go to parent dir. but it didn't work for me
          >> somehow. 
          >
          > You type .., then hit enter.
          >
          >
          >> How can I navigate to arbitrary directory with CtrlP?
          >
          > You can't navigate to an arbitrary directory once CtrlP is up, but you can
          > invoke CtrlP on an arbitrary directory, e.g.:
          >
          > :CtrlP /home/bhaskell/git/project
          >
          > Also see:
          >
          > :help g:ctrlp_working_path_mode
          >
          > And:
          >
          > :help :CtrlPCurFile

          Scratch that... The help tag has been removed in recent versions
          (wtf?), though the command remains.

          It's equivalent to CtrlP with the ctrlp_working_path_mode of 1.

          > I've mapped the latter to ,n with:
          >
          > :nm <leader>n :CtrlPCurFile<CR>

          --
          Best,
          Ben

          --
          --
          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.
        • Kent
          thanks for the quick response. I did try .. and ../ but didn t try .. . :) So when CtrlP started, I can only stay at project directory. or
          Message 4 of 9 , Feb 28, 2013
          • 0 Attachment
            thanks for the quick response.

            I did try .. and ../  but didn't try ..<cr> . :)

            So when CtrlP started, I can only stay at project directory. or ../../../......../../ <enter> to root :)
            i think i have to get used to it if I use it.



            On Thu, Feb 28, 2013 at 3:42 PM, Benjamin R. Haskell <vim@...> wrote:
            On Thu, 28 Feb 2013, Kent wrote:

            Hello,
            I use FuzzyFinder for years. Recently I heard a lot about CtrlP. And gave it a try. It does have some good features over FF. However one thing I didn't figure out, with FF(File search), I can type "/etc" to navigate to my root directory and do search, no matter which directory I am in.

            However for CtrlP, it seems that it searches only under current directory. In doc I found I can type .. to go to parent dir. but it didn't work for me somehow. 

            You type .., then hit enter.



            How can I navigate to arbitrary directory with CtrlP?

            You can't navigate to an arbitrary directory once CtrlP is up, but you can invoke CtrlP on an arbitrary directory, e.g.:

            :CtrlP /home/bhaskell/git/project

            Also see:

            :help g:ctrlp_working_path_mode

            And:

            :help :CtrlPCurFile

            I've mapped the latter to ,n with:

            :nm <leader>n :CtrlPCurFile<CR>

            --
            Best,
            Ben

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



            --
            --
            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.
             
             
          • Fabien Meghazi
            ... Cool ! Just discovered CtrlP with this post and I like it, especially the root path autodiscovery ! I d like to change the default behaviour of in
            Message 5 of 9 , Mar 5, 2013
            • 0 Attachment
              On Thu, Feb 28, 2013 at 3:37 PM, Kent <kent.yuan@...> wrote:
              > I use FuzzyFinder for years. Recently I heard a lot about CtrlP. And gave it
              > a try. It does have some good features over FF.

              Cool ! Just discovered CtrlP with this post and I like it, especially
              the root path autodiscovery !

              I'd like to change the default behaviour of <cr> in CtrlP shell in
              order to open in new tab instead of current window. I can't see an
              option for that in ctrlp.txt. Is it possible ?

              --
              Fabien Meghazi

              Website: http://www.amigrave.com
              Email: agr@...
              IM: amigrave@...

              --
              --
              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.
            • Benjamin R. Haskell
              ... Yes. Here s what you re asking for (put it in your .vimrc): let g:ctrlp_prompt_mappings = { AcceptSelection( t ) : [ ], } See: :help
              Message 6 of 9 , Mar 5, 2013
              • 0 Attachment
                On Tue, 5 Mar 2013, Fabien Meghazi wrote:

                > On Thu, Feb 28, 2013 at 3:37 PM, Kent <kent.yuan@...> wrote:
                >> I use FuzzyFinder for years. Recently I heard a lot about CtrlP. And
                >> gave it a try. It does have some good features over FF.
                >
                > Cool ! Just discovered CtrlP with this post and I like it, especially
                > the root path autodiscovery !
                >
                > I'd like to change the default behaviour of <cr> in CtrlP shell in
                > order to open in new tab instead of current window. I can't see an
                > option for that in ctrlp.txt. Is it possible ?

                Yes. Here's what you're asking for (put it in your .vimrc):

                let g:ctrlp_prompt_mappings = {
                \ 'AcceptSelection("t")': ['<cr>'],
                \ }

                See: :help 'g:ctrlp_prompt_mappings'

                --
                Best,
                Ben

                --
                --
                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.
              • Fabien Meghazi
                ... I tried it without success. I tried it before and after pathogen#infect, also tried to enter the command manually but the files still open in current
                Message 7 of 9 , Mar 5, 2013
                • 0 Attachment
                  On Tue, Mar 5, 2013 at 4:07 PM, Benjamin R. Haskell <vim@...> wrote:
                  > Yes. Here's what you're asking for (put it in your .vimrc):
                  >
                  > let g:ctrlp_prompt_mappings = {
                  > \ 'AcceptSelection("t")': ['<cr>'],
                  > \ }

                  I tried it without success. I tried it before and after
                  pathogen#infect, also tried to enter the command manually but the
                  files still open in current window.

                  --
                  Fabien Meghazi

                  Website: http://www.amigrave.com
                  Email: agr@...
                  IM: amigrave@...

                  --
                  --
                  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.
                • Benjamin R. Haskell
                  ... I forgot you also need to remove the binding from AcceptSelection( e ) (a default). You can either map something else to it (e.g. Ctrl-X): let
                  Message 8 of 9 , Mar 5, 2013
                  • 0 Attachment
                    On Tue, 5 Mar 2013, Fabien Meghazi wrote:

                    > On Tue, Mar 5, 2013 at 4:07 PM, Benjamin R. Haskell wrote:
                    >> Yes. Here's what you're asking for (put it in your .vimrc):
                    >>
                    >> let g:ctrlp_prompt_mappings = {
                    >> \ 'AcceptSelection("t")': ['<cr>'],
                    >> \ }
                    >
                    > I tried it without success. I tried it before and after
                    > pathogen#infect, also tried to enter the command manually but the
                    > files still open in current window.

                    I forgot you also need to remove the '<cr>' binding from
                    'AcceptSelection("e")' (a default). You can either map something else
                    to it (e.g. Ctrl-X):

                    let g:ctrlp_prompt_mappings = {
                    \ 'AcceptSelection("t")': ['<cr>'],
                    \ 'AcceptSelection("e")': ['<c-x>'],
                    \ }

                    Or just remove it:

                    let g:ctrlp_prompt_mappings = {
                    \ 'AcceptSelection("t")': ['<cr>'],
                    \ 'AcceptSelection("e")': [],
                    \ }

                    --
                    Best,
                    Ben

                    --
                    --
                    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.
                  • Fabien Meghazi
                    ... Thanks Benjamin, you made my day ! -- Fabien Meghazi Website: http://www.amigrave.com Email: agr@amigrave.com IM: amigrave@gmail.com -- -- You received
                    Message 9 of 9 , Mar 5, 2013
                    • 0 Attachment
                      On Tue, Mar 5, 2013 at 4:59 PM, Benjamin R. Haskell <vim@...> wrote:
                      > I forgot you also need to remove the '<cr>' binding from
                      > 'AcceptSelection("e")' (a default). You can either map something else to it
                      > (e.g. Ctrl-X):

                      Thanks Benjamin, you made my day !


                      --
                      Fabien Meghazi

                      Website: http://www.amigrave.com
                      Email: agr@...
                      IM: amigrave@...

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