comparison runtime/doc/undo.txt @ 16553:0e473e9e70c2 v8.1.1280

patch 8.1.1280: remarks about functionality not in Vi clutters the help commit https://github.com/vim/vim/commit/25c9c680ec4dfbb51f4ef21c3460a48d3c67ffc8 Author: Bram Moolenaar <Bram@vim.org> Date: Sun May 5 18:13:34 2019 +0200 patch 8.1.1280: remarks about functionality not in Vi clutters the help Problem: Remarks about functionality not in Vi clutters the help. Solution: Move all info about what is new in Vim or already existed in Vi to vi_diff.txt. Remove {not in Vi} remarks. (closes #4268) Add "noet" to the help files modeline. Also include many other help file improvements.
author Bram Moolenaar <Bram@vim.org>
date Sun, 05 May 2019 18:15:06 +0200
parents f0f06837a699
children 1eaf34420bb3
comparison
equal deleted inserted replaced
16552:deb3d4f5be8b 16553:0e473e9e70c2
1 *undo.txt* For Vim version 8.1. Last change: 2019 Jan 04 1 *undo.txt* For Vim version 8.1. Last change: 2019 May 05
2 2
3 3
4 VIM REFERENCE MANUAL by Bram Moolenaar 4 VIM REFERENCE MANUAL by Bram Moolenaar
5 5
6 6
23 23
24 *:u* *:un* *:undo* 24 *:u* *:un* *:undo*
25 :u[ndo] Undo one change. {Vi: only one level} 25 :u[ndo] Undo one change. {Vi: only one level}
26 *E830* 26 *E830*
27 :u[ndo] {N} Jump to after change number {N}. See |undo-branches| 27 :u[ndo] {N} Jump to after change number {N}. See |undo-branches|
28 for the meaning of {N}. {not in Vi} 28 for the meaning of {N}.
29 29
30 *CTRL-R* 30 *CTRL-R*
31 CTRL-R Redo [count] changes which were undone. {Vi: redraw 31 CTRL-R Redo [count] changes which were undone. {Vi: redraw
32 screen} 32 screen}
33 33
93 *:undoj* *:undojoin* *E790* 93 *:undoj* *:undojoin* *E790*
94 :undoj[oin] Join further changes with the previous undo block. 94 :undoj[oin] Join further changes with the previous undo block.
95 Warning: Use with care, it may prevent the user from 95 Warning: Use with care, it may prevent the user from
96 properly undoing changes. Don't use this after undo 96 properly undoing changes. Don't use this after undo
97 or redo. 97 or redo.
98 {not in Vi}
99 98
100 This is most useful when you need to prompt the user halfway through a change. 99 This is most useful when you need to prompt the user halfway through a change.
101 For example in a function that calls |getchar()|. Do make sure that there was 100 For example in a function that calls |getchar()|. Do make sure that there was
102 a related change before this that you must join with. 101 a related change before this that you must join with.
103 102
149 be used with the |:later| and |:earlier| commands. 148 be used with the |:later| and |:earlier| commands.
150 For more details use the |undotree()| function. 149 For more details use the |undotree()| function.
151 150
152 *g-* 151 *g-*
153 g- Go to older text state. With a count repeat that many 152 g- Go to older text state. With a count repeat that many
154 times. {not in Vi} 153 times.
155 *:ea* *:earlier* 154 *:ea* *:earlier*
156 :earlier {count} Go to older text state {count} times. 155 :earlier {count} Go to older text state {count} times.
157 :earlier {N}s Go to older text state about {N} seconds before. 156 :earlier {N}s Go to older text state about {N} seconds before.
158 :earlier {N}m Go to older text state about {N} minutes before. 157 :earlier {N}m Go to older text state about {N} minutes before.
159 :earlier {N}h Go to older text state about {N} hours before. 158 :earlier {N}h Go to older text state about {N} hours before.
168 the file was not written, ":earlier 1f" will go to 167 the file was not written, ":earlier 1f" will go to
169 before the first change. 168 before the first change.
170 169
171 *g+* 170 *g+*
172 g+ Go to newer text state. With a count repeat that many 171 g+ Go to newer text state. With a count repeat that many
173 times. {not in Vi} 172 times.
174 *:lat* *:later* 173 *:lat* *:later*
175 :later {count} Go to newer text state {count} times. 174 :later {count} Go to newer text state {count} times.
176 :later {N}s Go to newer text state about {N} seconds later. 175 :later {N}s Go to newer text state about {N} seconds later.
177 :later {N}m Go to newer text state about {N} minutes later. 176 :later {N}m Go to newer text state about {N} minutes later.
178 :later {N}h Go to newer text state about {N} hours later. 177 :later {N}h Go to newer text state about {N} hours later.
278 written. 277 written.
279 Implementation detail: Overwriting happens by first deleting 278 Implementation detail: Overwriting happens by first deleting
280 the existing file and then creating a new file with the same 279 the existing file and then creating a new file with the same
281 name. So it is not possible to overwrite an existing undofile 280 name. So it is not possible to overwrite an existing undofile
282 in a write-protected directory. 281 in a write-protected directory.
283 {not in Vi}
284 282
285 :rundo {file} Read undo history from {file}. 283 :rundo {file} Read undo history from {file}.
286 {not in Vi}
287 284
288 You can use these in autocommands to explicitly specify the name of the 285 You can use these in autocommands to explicitly specify the name of the
289 history file. E.g.: > 286 history file. E.g.: >
290 287
291 au BufReadPost * call ReadUndo() 288 au BufReadPost * call ReadUndo()
372 :exe "normal a \<BS>\<Esc>" 369 :exe "normal a \<BS>\<Esc>"
373 :let &undolevels = old_undolevels 370 :let &undolevels = old_undolevels
374 :unlet old_undolevels 371 :unlet old_undolevels
375 372
376 Marks for the buffer ('a to 'z) are also saved and restored, together with the 373 Marks for the buffer ('a to 'z) are also saved and restored, together with the
377 text. {Vi does this a little bit different} 374 text.
378 375
379 When all changes have been undone, the buffer is not considered to be changed. 376 When all changes have been undone, the buffer is not considered to be changed.
380 It is then possible to exit Vim with ":q" instead of ":q!" {not in Vi}. Note 377 It is then possible to exit Vim with ":q" instead of ":q!". Note
381 that this is relative to the last write of the file. Typing "u" after ":w" 378 that this is relative to the last write of the file. Typing "u" after ":w"
382 actually changes the buffer, compared to what was written, so the buffer is 379 actually changes the buffer, compared to what was written, so the buffer is
383 considered changed then. 380 considered changed then.
384 381
385 When manual |folding| is being used, the folds are not saved and restored. 382 When manual |folding| is being used, the folds are not saved and restored.