|
1 |
| -*usr_05.txt* For Vim version 9.1. Last change: 2025 Mar 22 |
| 1 | +*usr_05.txt* For Vim version 9.1. Last change: 2025 Apr 10 |
2 | 2 |
|
3 | 3 | VIM USER MANUAL - by Bram Moolenaar
|
4 | 4 |
|
@@ -307,23 +307,27 @@ This switches on three very clever mechanisms:
|
307 | 307 | filetypes. See |:filetype-indent-on| and 'indentexpr'.
|
308 | 308 |
|
309 | 309 |
|
310 |
| - *restore-cursor* *last-position-jump* > |
| 310 | + *restore-cursor* *last-position-jump* >vim |
311 | 311 | augroup RestoreCursor
|
312 | 312 | autocmd!
|
313 | 313 | autocmd BufReadPost *
|
314 | 314 | \ let line = line("'\"")
|
315 | 315 | \ | if line >= 1 && line <= line("$") && &filetype !~# 'commit'
|
316 | 316 | \ && index(['xxd', 'gitrebase'], &filetype) == -1
|
| 317 | + \ && !&diff |
317 | 318 | \ | execute "normal! g`\""
|
318 | 319 | \ | endif
|
319 | 320 | augroup END
|
320 | 321 |
|
321 | 322 | Another autocommand. This time it is used after reading any file. The
|
322 | 323 | complicated stuff after it checks if the '" mark is defined, and jumps to it
|
323 |
| -if so. It doesn't do that for a commit or rebase message, which are likely |
324 |
| -a different one than last time, and when using xxd(1) to filter and edit |
325 |
| -binary files, which transforms input files back and forth, causing them to |
326 |
| -have dual nature, so to speak. See also |using-xxd|. |
| 324 | +if so. It doesn't do that when: |
| 325 | + - editing a commit or rebase message, which are likely a different one than |
| 326 | + last time, |
| 327 | + - using xxd(1) to filter and edit binary files, which transforms input files |
| 328 | + back and forth, causing them to have dual nature, so to speak (see also |
| 329 | + |using-xxd|) and |
| 330 | + - Vim is in diff mode |
327 | 331 |
|
328 | 332 | The backslash at the start of a line is used to continue the command from the
|
329 | 333 | previous line. That avoids a line getting very long. See |line-continuation|.
|
|
0 commit comments