Skip to main content
added 287 characters in body
Source Link
Jake
  • 223
  • 1
  • 5

I had to add the following line in my .vimrc:

let g:netrw_fastbrowse = 2

When that variable is set to 2, it will not refresh the listing every time you enter the buffer, and so it will not position your cursor at the top of the screen.

Extra info:

I found within netrw there's an autocommand like this:

au BufEnter *  sil call s:LocalBrowse(expand("<amatch>"))

not sure what it's trying to do, but if I disable it, makes my cursor stay where I want it to be. So I wrote a file in ~/.vim/after/plugin/netrw.vim with this line:

au! FileExplorer BufEnter

while this works with starting vim like vim . it doesn't work when running something like :e . once inside vim. So Im still looking for athe better solution is to set the variable above.

I found within netrw there's an autocommand like this:

au BufEnter *  sil call s:LocalBrowse(expand("<amatch>"))

not sure what it's trying to do, but if I disable it, makes my cursor stay where I want it to be. So I wrote a file in ~/.vim/after/plugin/netrw.vim with this line:

au! FileExplorer BufEnter

while this works with starting vim like vim . it doesn't work when running something like :e . once inside vim. So Im still looking for a solution.

I had to add the following line in my .vimrc:

let g:netrw_fastbrowse = 2

When that variable is set to 2, it will not refresh the listing every time you enter the buffer, and so it will not position your cursor at the top of the screen.

Extra info:

I found within netrw there's an autocommand like this:

au BufEnter *  sil call s:LocalBrowse(expand("<amatch>"))

not sure what it's trying to do, but if I disable it, makes my cursor stay where I want it to be. So I wrote a file in ~/.vim/after/plugin/netrw.vim with this line:

au! FileExplorer BufEnter

while this works with starting vim like vim . it doesn't work when running something like :e . once inside vim. So the better solution is to set the variable above.

added 153 characters in body
Source Link
Jake
  • 223
  • 1
  • 5

I found within netrw there's an autocommand like this:

au BufEnter *  sil call s:LocalBrowse(expand("<amatch>"))

not sure what it's trying to do, but if I disable it, makes my cursor stay where I want it to be. So I wrote a file in ~/.vim/after/plugin/netrw.vim with this line:

au! FileExplorer BufEnter

while this works with starting vim like vim . it doesn't work when running something like :e . once inside vim. So Im still looking for a solution.

I found within netrw there's an autocommand like this:

au BufEnter *  sil call s:LocalBrowse(expand("<amatch>"))

not sure what it's trying to do, but if I disable it, makes my cursor stay where I want it to be. So I wrote a file in ~/.vim/after/plugin/netrw.vim with this line:

au! FileExplorer BufEnter

I found within netrw there's an autocommand like this:

au BufEnter *  sil call s:LocalBrowse(expand("<amatch>"))

not sure what it's trying to do, but if I disable it, makes my cursor stay where I want it to be. So I wrote a file in ~/.vim/after/plugin/netrw.vim with this line:

au! FileExplorer BufEnter

while this works with starting vim like vim . it doesn't work when running something like :e . once inside vim. So Im still looking for a solution.

added 7 characters in body
Source Link
Jake
  • 223
  • 1
  • 5

I found within netrw there's an autocommand like this:

au BufEnter *  sil call s:LocalBrowse(expand("<amatch>"))

not sure what it's trying to do, but if I disable it, makes my cursor stay where I want it to be. So I wrote a file in ~/.vim/after/plugin/netrw.vim with this line:

au! FileExplorer BufEnter

I found within netrw there's an autocommand like this:

au BufEnter *  sil call s:LocalBrowse(expand("<amatch>"))

not sure what it's trying to do, but if I disable it, makes my cursor stay where I want it to be. So I wrote a file in ~/.vim/after/netrw.vim with this line:

au! FileExplorer BufEnter

I found within netrw there's an autocommand like this:

au BufEnter *  sil call s:LocalBrowse(expand("<amatch>"))

not sure what it's trying to do, but if I disable it, makes my cursor stay where I want it to be. So I wrote a file in ~/.vim/after/plugin/netrw.vim with this line:

au! FileExplorer BufEnter
Source Link
Jake
  • 223
  • 1
  • 5
Loading