comparison runtime/doc/usr_02.txt @ 7597:3012eaddb6b2

commit https://github.com/vim/vim/commit/345efa013dc6d1754ba06e5596a26c48c9935937 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Jan 15 20:57:49 2016 +0100 Update runtime files
author Christian Brabandt <cb@256bit.org>
date Fri, 15 Jan 2016 21:00:07 +0100
parents fbc1131f0ba5
children 07f11de5efca
comparison
equal deleted inserted replaced
7596:a9234d9e3efd 7597:3012eaddb6b2
1 *usr_02.txt* For Vim version 7.4. Last change: 2015 Apr 12 1 *usr_02.txt* For Vim version 7.4. Last change: 2016 Jan 15
2 2
3 VIM USER MANUAL - by Bram Moolenaar 3 VIM USER MANUAL - by Bram Moolenaar
4 4
5 The first steps in Vim 5 The first steps in Vim
6 6
406 ============================================================================== 406 ==============================================================================
407 *02.8* Finding help 407 *02.8* Finding help
408 408
409 Everything you always wanted to know can be found in the Vim help files. 409 Everything you always wanted to know can be found in the Vim help files.
410 Don't be afraid to ask! 410 Don't be afraid to ask!
411 To get generic help use this command: > 411
412 If you know what you are looking for, it is usually easier to search for it
413 using the help system, instead of using Google. Because the subjects follow
414 a certain style guide.
415
416 Also the help has the advantage of belonging to your particular Vim version.
417 You won't see help for commands added later. These would not work for you.
418
419 To get generic help use this command: >
412 420
413 :help 421 :help
414 422
415 You could also use the first function key <F1>. If your keyboard has a <Help> 423 You could also use the first function key <F1>. If your keyboard has a <Help>
416 key it might work as well. 424 key it might work as well.
480 in single quotation marks. To find out what the 'number' option does, for 488 in single quotation marks. To find out what the 'number' option does, for
481 example, use the following command: > 489 example, use the following command: >
482 490
483 :help 'number' 491 :help 'number'
484 492
485 The table with all mode prefixes can be found here: |help-context|. 493 The table with all mode prefixes can be found below: |help-summary|.
486 494
487 Special keys are enclosed in angle brackets. To find help on the up-arrow key 495 Special keys are enclosed in angle brackets. To find help on the up-arrow key
488 in Insert mode, for instance, use this command: > 496 in Insert mode, for instance, use this command: >
489 497
490 :help i_<Up> 498 :help i_<Up>
497 505
498 :help E37 506 :help E37
499 507
500 508
501 Summary: *help-summary* > 509 Summary: *help-summary* >
502 :help 510
503 < Gives you very general help. Scroll down to see a list of all 511 1) Use Ctrl-D after typing a topic and let Vim show all available topics.
504 helpfiles, including those added locally (i.e. not distributed 512 Or press Tab to complete: >
505 with Vim). > 513 :help some<Tab>
506 :help user-toc.txt 514 < More information on how to use the help: >
507 < Table of contents of the User Manual. > 515 :help helphelp
508 :help :subject 516
509 < Ex-command "subject", for instance the following: > 517 2) Follow the links in bars to related help. You can go from the detailed
510 :help :help 518 help to the user documentation, which describes certain commands more from
511 < Help on getting help. > 519 a user perspective and less detailed. E.g. after: >
512 :help abc 520 :help pattern.txt
513 < normal-mode command "abc". > 521 < You can see the user guide topics |03.9| and |usr_27.txt| in the
514 :help CTRL-B 522 introduction.
515 < Control key <C-B> in Normal mode. > 523
516 :help i_abc 524 3) Options are enclosed in single apostrophes. To go to the help topic for the
517 :help i_CTRL-B 525 list option: >
518 < The same in Insert mode. > 526 :help 'list'
519 :help v_abc 527 < If you only know you are looking for a certain option, you can also do: >
520 :help v_CTRL-B 528 :help options.txt
521 < The same in Visual mode. > 529 < to open the help page which describes all option handling and then search
522 :help c_abc 530 using regular expressions, e.g. textwidth.
523 :help c_CTRL-B 531 Certain options have their own namespace, e.g.: >
524 < The same in Command-line mode. > 532 :help cpo-<letter>
525 :help 'subject' 533 < for the corresponding flag of the 'cpoptions' settings, substitute <letter>
526 < Option 'subject'. > 534 by a specific flag, e.g.: >
527 :help subject() 535 :help cpo-;
528 < Function "subject". > 536 < And for the guioption flags: >
529 :help -subject 537 :help go-<letter>
530 < Command-line argument "-subject". > 538
531 :help +subject 539 4) Normal mode commands do not have a prefix. To go to the help page for the
532 < Compile-time feature "+subject". > 540 "gt" command: >
533 :help /* 541 :help gt
534 < Regular expression item "*" > 542
535 :help EventName 543 5) Insert mode commands start with i_. Help for deleting a word: >
536 < Autocommand event "EventName". > 544 :help i_CTRL-W
537 :help digraphs.txt 545
538 < The top of the helpfile "digraph.txt". 546 6) Visual mode commands start with v_. Help for jumping to the other side of
539 Similarly for any other helpfile. > 547 the Visual area: >
540 :help pattern<Tab> 548 :help v_o
541 < Find a help tag starting with "pattern". Repeat <Tab> for 549
542 others. > 550 7) Command line editing and arguments start with c_. Help for using the
543 :help pattern<Ctrl-D> 551 command argument %: >
544 < See all possible help tag matches "pattern" at once. > 552 :help c_%
545 :helpgrep pattern 553
546 < Search the whole text of all help files for pattern "pattern". 554 8) Ex-commands always start with ":", so to go to the :s command help: >
547 Jumps to the first match. Jump to other matches with: > 555 :help :s
548 :cn 556
549 < next match > 557 9) Key combinations. They usually start with a single letter indicating
550 :cprev 558 the mode for which they can be used. E.g.: >
551 :cN 559 :help i_CTRL-X
552 < previous match > 560 < takes you to the family of Ctrl-X commands for insert mode which can be
553 :cfirst 561 used to auto complete different things. Note, that certain keys will
554 :clast 562 always be written the same, e.g. Control will always be CTRL.
555 < first or last match > 563 For normal mode commands there is no prefix and the topic is available at
556 :copen 564 :h CTRL-<Letter>. E.g. >
557 :cclose 565 :help CTRL-W
558 < open/close the quickfix window; press <Enter> to jump 566 < In contrast >
559 to the item under the cursor 567 :help c_CTRL-R
568 < will describe what the Ctrl-R does when entering commands in the Command
569 line and >
570 :help v_Ctrl-A
571 < talks about incrementing numbers in visual mode and >
572 :help g_CTRL-A
573 < talks about the g<C-A> command (e.g. you have to press "g" then <Ctrl-A>).
574 Here the "g" stand for the normal command "g" which always expects a second
575 key before doing something similar to the commands starting with "z"
576
577 10) Regexp items always start with /. So to get help for the "\+" quantifier
578 in Vim regexes: >
579 :help /\+
580 < If you need to know everything about regular expressions, start reading
581 at: >
582 :help pattern.txt
583
584 11) Registers always start with "quote". To find out about the special ":"
585 register: >
586 :help quote:
587
588 12) Vim Script (VimL) is available at >
589 :help eval.txt
590 < Certain aspects of the language are available at :h expr-X where "X" is a
591 single letter. E.g. >
592 :help expr-!
593 < will take you to the topic describing the "!" (Not) operator for
594 VimScript.
595 Also important is >
596 :help function-list
597 < to find a short description of all functions available. Help topics for
598 VimL functions always include the "()", so: >
599 :help append()
600 < talks about the append VimL function rather than how to append text in the
601 current buffer.
602
603 13) Mappings are talked about in the help page :h |map.txt|. Use >
604 :help mapmode-i
605 < to find out about the |:imap| command. Also use :map-topic
606 to find out about certain subtopics particular for mappings. e.g: >
607 :help :map-local
608 < for buffer-local mappings or >
609 :help map-bar
610 < for how the '|' is handled in mappings.
611
612 14) Command definitions are talked about :h command-topic, so use >
613 :help command-bar
614 < to find out about the '!' argument for custom commands.
615
616 15) Window management commands always start with CTRL-W, so you find the
617 corresponding help at :h CTRL-W_letter. E.g. >
618 :help CTRL-W_p
619 < for moving the previous accessed window). You can also access >
620 :help windows.txt
621 < and read your way through if you are looking for window handling
622 commands.
623
624 16) Use |:helpgrep| to search in all help pages (and also of any installed
625 plugins). See |:helpgrep| for how to use it.
626 To search for a topic: >
627 :helpgrep topic
628 < This takes you to the first match. To go to the next one: >
629 :cnext
630 < All matches are available in the quickfix window which can be opened
631 with: >
632 :copen
633 < Move around to the match you like and press Enter to jump to that help.
634
635 17) The user manual. This describes help topics for beginners in a rather
636 friendly way. Start at |usr_toc.txt| to find the table of content (as you
637 might have guessed): >
638 :help usr_toc.txt
639 < Skim over the contents to find interesting topics. The "Digraphs" and
640 "Entering special characters" items are in chapter 24, so to go to that
641 particular help page: >
642 :help usr_24.txt
643 < Also if you want to access a certain chapter in the help, the chapter
644 number can be accessed directly like this: >
645 :help 10.1
646 < goes to chapter 10.1 in |usr_10.txt| and talks about recording macros.
647
648 18) Highlighting groups. Always start with hl-groupname. E.g. >
649 :help hl-WarningMsg
650 < talks about the WarningMsg highlighting group.
651
652 19) Syntax highlighting is namespaced to :syn-topic e.g. >
653 :help :syn-conceal
654 < talks about the conceal argument for the :syn command.
655
656 20) Quickfix commands usually start with :c while location list commands
657 usually start with :l
658
659 21) Autocommand events can be found by their name: >
660 :help BufWinLeave
661 < To see all possible events: >
662 :help autocommands-events
663
664 22) Command-line switches always start with "-". So for the help of the -f
665 command switch of Vim use: >
666 :help -f
667
668 23) Optional features always start with "+". To find out about the
669 conceal feature use: >
670 :help +conceal
671
672 24) Documentation for included filetype specific functionality is usually
673 available in the form ft-<filetype>-<functionality>. So >
674 :help ft-c-syntax
675 < talks about the C syntax file and the option it provides. Sometimes,
676 additional sections for omni completion >
677 :help ft-php-omni
678 < or filetype plugins >
679 :help ft-tex-plugin
680 < are available.
681
682 25) Error and Warning codes can be looked up directly in the help. So >
683 :help E297
684 < takes you exactly to the description of the swap error message and >
685 :help W10
686 < talks about the warning "Changing a readonly file".
687 Sometimes however, those error codes are not described, but rather are
688 listed at the Vim command that usually causes this. So: >
689 :help E128
690 < takes you to the |:function| command
560 691
561 692
562 ============================================================================== 693 ==============================================================================
563 694
564 Next chapter: |usr_03.txt| Moving around 695 Next chapter: |usr_03.txt| Moving around