diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2019-06-04 01:06:10 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2019-06-04 01:06:10 +1200 |
commit | 90e5acaf0add1d5caf78417ff544ea1b2d74c0ac (patch) | |
tree | 2646b998bdb401b0f67645871fc900922d3c26df /doc | |
parent | Add command example (diff) | |
download | vim-keep-position-90e5acaf0add1d5caf78417ff544ea1b2d74c0ac.tar.gz vim-keep-position-90e5acaf0add1d5caf78417ff544ea1b2d74c0ac.zip |
Add ranges support
Diffstat (limited to 'doc')
-rw-r--r-- | doc/keep_position.txt | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/doc/keep_position.txt b/doc/keep_position.txt index 25de36f..05f69bc 100644 --- a/doc/keep_position.txt +++ b/doc/keep_position.txt @@ -20,6 +20,17 @@ especially ones that work on the entire buffer: > :KeepPosition %!tidy < +You will generally want to use this command as above, without a range. +However, if you do specify a range, it will only preserve the view if the last +change to the buffer--presumably made by your nominated command--entirely +encompassed the given range. This is checked with the |'[| and |']| marks. + +The author uses the range functionality to make a "conditional jump"; only +jump to the changes the given command makes if it didn't affect the entire +buffer, e.g.: +> + :nnoremap u :<C-U>%KeepPosition undo<CR> +< AUTHOR *keep_position-author* Written and maintained by Tom Ryder <tom@sanctum.geek.nz>. |