1
- *usr_05.txt* For Vim version 9.0. Last change: 2019 May 23
1
+ *usr_05.txt* For Vim version 9.0. Last change: 2023 Sep 12
2
2
3
3
VIM USER MANUAL - by Bram Moolenaar
4
4
@@ -308,17 +308,27 @@ This switches on three very clever mechanisms:
308
308
309
309
310
310
*restore-cursor* *last-position-jump* >
311
- autocmd BufReadPost *
312
- \ if line("'\"") >= 1 && line("'\"") <= line("$") && &ft !~# 'commit'
313
- \ | exe "normal! g`\""
314
- \ | endif
311
+ augroup RestoreCursor
312
+ autocmd!
313
+ autocmd BufReadPost *
314
+ \ let line = line("'\"")
315
+ \ | if line >= 1 && line <= line("$") && &filetype !~# 'commit'
316
+ \ && index(['xxd', 'gitrebase'], &filetype) == -1
317
+ \ | execute "normal! g`\""
318
+ \ | endif
319
+ augroup END
315
320
316
321
Another autocommand. This time it is used after reading any file. The
317
322
complicated stuff after it checks if the '" mark is defined, and jumps to it
318
- if so. The backslash at the start of a line is used to continue the command
319
- from the previous line. That avoids a line getting very long.
320
- See | line-continuation | . This only works in a Vim script file, not when
321
- typing commands at the command-line.
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 | .
327
+
328
+ The backslash at the start of a line is used to continue the command from the
329
+ previous line. That avoids a line getting very long. See | line-continuation | .
330
+ This only works in a Vim script file, not when typing commands at the
331
+ command line.
322
332
323
333
>
324
334
command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ | diffthis
@@ -417,6 +427,15 @@ an archive or as a repository. For an archive you can follow these steps:
417
427
Here "fancytext" is the name of the package, it can be anything
418
428
else.
419
429
430
+ Adding the editorconfig package *editorconfig-install*
431
+
432
+ Similar to the matchit package, to load the distributed editorconfig plugin
433
+ when Vim starts, add the following line to your vimrc file: >
434
+ packadd! editorconfig
435
+
436
+ After restarting your Vim, the plugin is active and you can read about it at: >
437
+ :h editorconfig.txt
438
+
420
439
More information about packages can be found here: | packages | .
421
440
422
441
==============================================================================
@@ -436,13 +455,18 @@ The global plugins will be discussed first, then the filetype ones
436
455
| add-filetype-plugin | .
437
456
438
457
439
- GLOBAL PLUGINS *standard-plugin*
458
+ GLOBAL PLUGINS *standard-plugin* *distributed-plugins *
440
459
441
460
When you start Vim, it will automatically load a number of global plugins.
442
461
You don't have to do anything for this. They add functionality that most
443
462
people will want to use, but which was implemented as a Vim script instead of
444
463
being compiled into Vim. You can find them listed in the help index
445
- | standard-plugin-list | . Also see | load-plugins | .
464
+ | standard-plugin-list | .
465
+
466
+ For locally installed plugins and packages (which come with a separated help
467
+ file) a similar list can be found in the help section | local-additions | .
468
+
469
+ Also see | load-plugins | .
446
470
447
471
*add-global-plugin*
448
472
You can add a global plugin to add functionality that will always be present
0 commit comments