mirror of
https://github.com/jbranchaud/til
synced 2026-01-03 15:18:01 +00:00
Add Scrolling Relative to the Cursor as a vim til.
This commit is contained in:
@@ -66,6 +66,7 @@ smart people at [Hashrocket](http://hashrocket.com/).
|
||||
- [Quick Quickfix List Navigation](vim/quick-quickfix-list-navigation.md)
|
||||
- [Rename Current File](vim/rename-current-file.md)
|
||||
- [Repeat The Previous Change](vim/repeat-the-previous-change.md)
|
||||
- [Scrolling Relative to the Window](vim/scrolling-relative-to-the-window.md)
|
||||
- [Split Different](vim/split-different.md)
|
||||
- [Tabs To Spaces](vim/tabs-to-spaces.md)
|
||||
- [View Commit History of a File](vim/view-commit-history-of-a-file.md)
|
||||
|
||||
14
vim/scrolling-relative-to-the-cursor.md
Normal file
14
vim/scrolling-relative-to-the-cursor.md
Normal file
@@ -0,0 +1,14 @@
|
||||
# Scrolling Relative to the Cursor
|
||||
|
||||
If you hit `zt` while in normal mode, the window will be redrawn such that
|
||||
the line the cursor is positioned on is at the top of the window. Similarly,
|
||||
if you hit `zb`, the window will be redrawn such that the line the cursor is
|
||||
currently on will be at the bottom of the window.
|
||||
|
||||
The one that comes in really handy, though, is `zz` (note: this is not
|
||||
`ZZ`) which will reposition the current line to the center of the screen.
|
||||
This can come in really handy if you have scrolled to the top (or bottom) of
|
||||
the visible part of the buffer and you want to quickly view more of the
|
||||
context around the current line.
|
||||
|
||||
See `:h scroll-cursor` for more details and commands.
|
||||
Reference in New Issue
Block a user