Skip to content

Commit 66d0117

Browse files
committed
usr_50.txt: Update Vim 9.0.0553
1 parent cfb21c4 commit 66d0117

File tree

1 file changed

+9
-22
lines changed

1 file changed

+9
-22
lines changed

en/usr_50.txt

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
*usr_50.txt* For Vim version 9.0. Last change: 2022 Jun 03
1+
*usr_50.txt* For Vim version 9.0. Last change: 2022 Jun 20
22

33
VIM USER MANUAL - by Bram Moolenaar
44

55
Advanced Vim script writing
66

77

88
|50.1| Exceptions
9-
|50.2| Function with variable number of arguments
9+
|50.2| Function with variable number of arguments
1010
|50.3| Restoring the view
1111

1212
Next chapter: |usr_51.txt| Create a plugin
@@ -104,7 +104,7 @@ You can call it like this: >
104104
105105
Show('Title', 'one', 'two', 'three')
106106
< start is Title Arg 0 is one Arg 1 is two Arg 2 is three ~
107-
107+
108108
This uses the `echohl` command to specify the highlighting used for the
109109
following `echo` command. `echohl None` stops it again. The `echon` command
110110
works like `echo`, but doesn't output a line break.
@@ -116,26 +116,13 @@ we'll explain that further down.
116116
==============================================================================
117117
*50.3* Restoring the view
118118

119-
Sometimes you want to make a change and go back to where the cursor was.
120-
Restoring the relative position would also be nice, so that the same line
121-
appears at the top of the window.
122-
123-
This example yanks the current line, puts it above the first line in the file
124-
and then restores the view: >
125-
126-
map ,p ma"aYHmbgg"aP`bzt`a
127-
128-
What this does: >
129-
ma"aYHmbgg"aP`bzt`a
130-
< ma set mark a at cursor position
131-
"aY yank current line into register a
132-
Hmb go to top line in window and set mark b there
133-
gg go to first line in file
134-
"aP put the yanked line above it
135-
`b go back to top line in display
136-
zt position the text in the window as before
137-
`a go back to saved cursor position
119+
Sometimes you want to jump around, make a change and then go back to the same
120+
position and view. For example to change something in the file header. This
121+
can be done with two functions: >
138122
123+
var view = winsaveview()
124+
# Move around, make changes
125+
winrestview(view)
139126
140127
==============================================================================
141128

0 commit comments

Comments
 (0)