| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| When switching between buffers (with the bn and bp commands), vim will center the line containing the cursor - just like the z. command would do. Is there a way to convince vim to not do that? cu Philipp -- Dr. Philipp Pagel Lehrstuhl f. Genomorientierte Bioinformatik Technische Universität München http://mips.gsf.de/staff/pagel |
|
#2
| |||
| |||
| Philipp Pagel wrote: > When switching between buffers (with the bn and bp commands), vim will > center the line containing the cursor - just like the z. command would > do. > > Is there a way to convince vim to not do that? > Try that: if v:version >= 700 au BufLeave * let b:winview = winsaveview() au BufEnter * if (exists('b:winview')) | call winrestview(b:winview) | endif endif " 700 Joachim |
|
#3
| |||
| |||
| Joachim Hofmann <speicher@freenet.de> wrote: > Philipp Pagel wrote: > > When switching between buffers (with the bn and bp commands), vim will > > center the line containing the cursor - just like the z. command would > > do. > if v:version >= 700 > au BufLeave * let b:winview = winsaveview() > au BufEnter * if (exists('b:winview')) | call winrestview(b:winview) | endif > endif " 700 Works exactly as I had hoped. Thanks Philipp -- Dr. Philipp Pagel Lehrstuhl f. Genomorientierte Bioinformatik Technische Universität München http://mips.gsf.de/staff/pagel |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.