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

Re: Jump to a file

Expand Messages
  • YogS
    ThanX to all, I found the solution All I had to do is ... Regards YogS
    Message 1 of 4 , Nov 30, 2005
    • 0 Attachment
      ThanX to all,
      I found the solution

      All I had to do is
      :nnoremap <F4> :e <cfile>:h:h/testcase<CR>

      Regards
      YogS

      On 11/30/05, Chris Allen <c.d.allen@...> wrote:
      > On 29/11/05, YogS <mail2yogs@...> wrote:
      > > There is a way using "expand or cword" by which I can map some key so
      > > that when the cursor is at
      > > "dir1/dir11/dir112/test/results" & I press that key stoke, file
      > > "dir1/dir11/dir112/testcase" should open
      >
      > Close, but not quite. You need to base your mapping on expand and
      > <cfile>. The expression:
      >
      > expand('<cfile>:h:h') . '/testcase'
      >
      > will return the path under the curosr with the final two elements
      > ('results', and then 'test') removed. The ". '/testcase'" section
      > then appends a trailing slash and the testcase name, to give you
      > "dirX/dirY/dirZ/testcase".
      >
      > Hopefully you will find the rest of the mapping easy to write from here.
      >
      > HTH,
      > Chris Allen
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.