diff --git a/README.md b/README.md index b0bcfdd..bbab1bb 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,7 @@ smart people at [Hashrocket](http://hashrocket.com/). - [Interactive Buffer List](vim/interactive-buffer-list.md) - [List All Buffers](vim/list-all-buffers.md) - [Marks Across Vim Sessions](vim/marks-across-vim-sessions.md) +- [Moving To A Specific Line](vim/moving-to-a-specific-line.md) - [NETRW Listing Styles](vim/netrw-listing-styles.md) - [Open an Unnamed Buffer](vim/open-an-unnamed-buffer.md) - [Opening a URL](vim/opening-a-url.md) diff --git a/vim/moving-to-a-specific-line.md b/vim/moving-to-a-specific-line.md new file mode 100644 index 0000000..52286eb --- /dev/null +++ b/vim/moving-to-a-specific-line.md @@ -0,0 +1,15 @@ +# Moving To A Specific Line + +Often times when I open a new buffer, it is with the intention of moving to +a particular line. For example, if I am trying to move to line 55 in the +file, then I will hit `55j`\*. This works fine when I am dealing with a +freshly opened buffer. That is, this works fine if I am starting from the +top of the buffer. + +In general, there is a better approach. I can move to an exact line number +from normal mode with `:{N}` where `{N}` is the line number. So, if I want +to get to line 55 regardless of where I am currently positioned in the +buffer, I can simply hit `:55`. + +\* *This actually is slightly inaccurate, it moves me to line 56, not 55. +If I need to be precise, this doesn't cut it.*