Controlling the cusor in the file browser in Vim

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pwilliams
    New Member
    • Jul 2010
    • 21

    Controlling the cusor in the file browser in Vim

    From the command line I enter `vim`.
    I am greeted with the Vim version number etc.
    Then I type ` :e .`
    I'm now in the file browser.
    I get the usual long list of files,I move the cursor say to
    the fourth from the top , enter the file and edit it ,so far so good.
    NOW I use` ^O ` ie.` Ctrl O`. Here is the irritation -- The cursor
    goes right to the bottom of the list. Is there a way of curing
    this so that cursor stays at the last file opened ?
    This is about the only aspect of Vim that I find annoying.
    Help would be much appreciated.
    Last edited by pwilliams; Aug 23 '10, 05:21 PM. Reason: ambiguous title
  • sicarie
    Recognized Expert Specialist
    • Nov 2006
    • 4677

    #2
    Here's what the vi doc I found said

    *CTRL-O*
    CTRL-O Go to [count] Older cursor position in jump list
    (not a motion command). {not in Vi}
    {not available without the +jumplist feature}
    Does that help? What are you trying to do when you use Ctrl+O inside the file?

    Comment

    • pwilliams
      New Member
      • Jul 2010
      • 21

      #3
      Controlling the cusor in the file browser in Vim

      Many thanks for your reply sicarie . No I'm afraid Ctrl+O does not work,as I say, it sends the cursor right to the bottom of the list ;Ctrl^ is slightly better taking the cursor to the very top of the list ; best of all so far is not a Ctrl Command but ` :Rexplore ` or ` :Rex `, this takes the cursor right back onto the name of the file that has just been exited . What I was trying to do by using Ctrl+0 within the file , was to get back from whence I came .

      I have pasted the reference here:

      :Rexplore This command is a little different from the others. When one
      edits a file, for example by pressing <cr> when atop a file in
      a netrw browser window, :Rexplore will return the display to
      that of the last netrw browser window. It is a command version
      of the <2-leftmouse> map (which is only available under gvim and
      cooperative terms [
      ~
      ~
      ~
      ~
      ~
      ~
      ~
      ~
      6,23-26 All
      Last edited by pwilliams; Sep 1 '10, 04:31 PM. Reason: redundant PS

      Comment

      • sicarie
        Recognized Expert Specialist
        • Nov 2006
        • 4677

        #4
        So if I understand this correctly, you would like to

        1) open a file through vim
        2) edit or perform some action in the file
        3) execute a command to return to the area/list from which you opened the file in step 1

        Is that accurate?

        Comment

        • pwilliams
          New Member
          • Jul 2010
          • 21

          #5
          Controlling the cusor in the file browser in Vim

          Yes sicarie,and so far ` :Rex ` seems to be the only option.

          Comment

          Working...