comparison runtime/doc/autocmd.txt @ 1154:f23b876b21ff

updated for version 7.1a
author vimboss
date Sun, 06 May 2007 13:26:41 +0000
parents b4d11ddb7303
children a91a2e0c4108
comparison
equal deleted inserted replaced
1153:fb8f2e3e798c 1154:f23b876b21ff
1 *autocmd.txt* For Vim version 7.0. Last change: 2007 Jan 16 1 *autocmd.txt* For Vim version 7.1a. Last change: 2007 Mar 27
2 2
3 3
4 VIM REFERENCE MANUAL by Bram Moolenaar 4 VIM REFERENCE MANUAL by Bram Moolenaar
5 5
6 6
261 |TermChanged| after the value of 'term' has changed 261 |TermChanged| after the value of 'term' has changed
262 262
263 Startup and exit 263 Startup and exit
264 |VimEnter| after doing all the startup stuff 264 |VimEnter| after doing all the startup stuff
265 |GUIEnter| after starting the GUI successfully 265 |GUIEnter| after starting the GUI successfully
266 |TermResponse| after the termainal response to |t_RV| is received 266 |TermResponse| after the terminal response to |t_RV| is received
267 267
268 |VimLeavePre| before exiting Vim, before writing the viminfo file 268 |VimLeavePre| before exiting Vim, before writing the viminfo file
269 |VimLeave| before exiting Vim, after writing the viminfo file 269 |VimLeave| before exiting Vim, after writing the viminfo file
270 270
271 Various 271 Various
459 until the user has pressed a key (i.e. doesn't 459 until the user has pressed a key (i.e. doesn't
460 fire every 'updatetime' ms if you leave Vim to 460 fire every 'updatetime' ms if you leave Vim to
461 make some coffee. :) See |CursorHold-example| 461 make some coffee. :) See |CursorHold-example|
462 for previewing tags. 462 for previewing tags.
463 This event is only triggered in Normal mode. 463 This event is only triggered in Normal mode.
464 It is not triggered when waiting for a command
465 argument to be typed, or a movement after an
466 operator.
464 While recording the CursorHold event is not 467 While recording the CursorHold event is not
465 triggered. |q| 468 triggered. |q|
466 Note: Interactive commands cannot be used for 469 Note: Interactive commands cannot be used for
467 this event. There is no hit-enter prompt, 470 this event. There is no hit-enter prompt,
468 the screen is updated directly (when needed). 471 the screen is updated directly (when needed).
526 This autocommand is triggered for each changed 529 This autocommand is triggered for each changed
527 file. It is not used when 'autoread' is set 530 file. It is not used when 'autoread' is set
528 and the buffer was not changed. If a 531 and the buffer was not changed. If a
529 FileChangedShell autocommand is present the 532 FileChangedShell autocommand is present the
530 warning message and prompt is not given. 533 warning message and prompt is not given.
531 This is useful for reloading related buffers
532 which are affected by a single command.
533 The |v:fcs_reason| variable is set to indicate 534 The |v:fcs_reason| variable is set to indicate
534 what happened and |v:fcs_choice| can be used 535 what happened and |v:fcs_choice| can be used
535 to tell Vim what to do next. 536 to tell Vim what to do next.
536 NOTE: When this autocommand is executed, the 537 NOTE: When this autocommand is executed, the
537 current buffer "%" may be different from the 538 current buffer "%" may be different from the
559 first and last line of the read. This can be 560 first and last line of the read. This can be
560 used to operate on the lines just read. 561 used to operate on the lines just read.
561 *FileReadPre* 562 *FileReadPre*
562 FileReadPre Before reading a file with a ":read" command. 563 FileReadPre Before reading a file with a ":read" command.
563 *FileType* 564 *FileType*
564 FileType When the 'filetype' option has been set. 565 FileType When the 'filetype' option has been set. The
566 pattern is matched against the filetype.
565 <afile> can be used for the name of the file 567 <afile> can be used for the name of the file
566 where this option was set, and <amatch> for 568 where this option was set, and <amatch> for
567 the new value of 'filetype'. 569 the new value of 'filetype'.
568 See |filetypes|. 570 See |filetypes|.
569 *FileWriteCmd* 571 *FileWriteCmd*
615 can be detected. May also happen when a 617 can be detected. May also happen when a
616 dialog pops up. 618 dialog pops up.
617 *FuncUndefined* 619 *FuncUndefined*
618 FuncUndefined When a user function is used but it isn't 620 FuncUndefined When a user function is used but it isn't
619 defined. Useful for defining a function only 621 defined. Useful for defining a function only
620 when it's used. Both <amatch> and <afile> are 622 when it's used. The pattern is matched
621 set to the name of the function. 623 against the function name. Both <amatch> and
624 <afile> are set to the name of the function.
622 See |autoload-functions|. 625 See |autoload-functions|.
623 *GUIEnter* 626 *GUIEnter*
624 GUIEnter After starting the GUI successfully, and after 627 GUIEnter After starting the GUI successfully, and after
625 opening the window. It is triggered before 628 opening the window. It is triggered before
626 VimEnter when using gvim. Can be used to 629 VimEnter when using gvim. Can be used to
627 position the window from a .gvimrc file: > 630 position the window from a .gvimrc file: >
628 :autocmd GUIEnter * winpos 100 50 631 :autocmd GUIEnter * winpos 100 50
632 < *GUIFailed*
633 GUIFailed After starting the GUI failed. Vim may
634 continue to run in the terminal, if possible
635 (only on Unix and alikes, when connecting the
636 X server fails). You may want to quit Vim: >
637 :autocmd GUIFailed * qall
629 < *InsertChange* 638 < *InsertChange*
630 InsertChange When typing <Insert> while in Insert or 639 InsertChange When typing <Insert> while in Insert or
631 Replace mode. The |v:insertmode| variable 640 Replace mode. The |v:insertmode| variable
632 indicates the new mode. 641 indicates the new mode.
633 Be careful not to move the cursor or do 642 Be careful not to move the cursor or do
634 anything else that the user does not expect. 643 anything else that the user does not expect.
635 *InsertEnter* 644 *InsertEnter*
636 InsertEnter When starting Insert mode. Also for Replace 645 InsertEnter Just before starting Insert mode. Also for
637 mode and Virtual Replace mode. The 646 Replace mode and Virtual Replace mode. The
638 |v:insertmode| variable indicates the mode. 647 |v:insertmode| variable indicates the mode.
639 Be careful not to move the cursor or do 648 Be careful not to move the cursor or do
640 anything else that the user does not expect. 649 anything else that the user does not expect.
641 *InsertLeave* 650 *InsertLeave*
642 InsertLeave When leaving Insert mode. Also when using 651 InsertLeave When leaving Insert mode. Also when using
655 c Command line 664 c Command line
656 *QuickFixCmdPre* 665 *QuickFixCmdPre*
657 QuickFixCmdPre Before a quickfix command is run (|:make|, 666 QuickFixCmdPre Before a quickfix command is run (|:make|,
658 |:lmake|, |:grep|, |:lgrep|, |:grepadd|, 667 |:lmake|, |:grep|, |:lgrep|, |:grepadd|,
659 |:lgrepadd|, |:vimgrep|, |:lvimgrep|, 668 |:lgrepadd|, |:vimgrep|, |:lvimgrep|,
660 |:vimgrepadd|, |:vimgrepadd|). The pattern is 669 |:vimgrepadd|, |:lvimgrepadd|). The pattern is
661 matched against the command being run. When 670 matched against the command being run. When
662 |:grep| is used but 'grepprg' is set to 671 |:grep| is used but 'grepprg' is set to
663 "internal" it still matches "grep". 672 "internal" it still matches "grep".
664 This command cannot be used to set the 673 This command cannot be used to set the
665 'makeprg' and 'grepprg' variables. 674 'makeprg' and 'grepprg' variables.
669 QuickFixCmdPost Like QuickFixCmdPre, but after a quickfix 678 QuickFixCmdPost Like QuickFixCmdPre, but after a quickfix
670 command is run, before jumping to the first 679 command is run, before jumping to the first
671 location. 680 location.
672 *RemoteReply* 681 *RemoteReply*
673 RemoteReply When a reply from a Vim that functions as 682 RemoteReply When a reply from a Vim that functions as
674 server was received |server2client()|. 683 server was received |server2client()|. The
684 pattern is matched against the {serverid}.
675 <amatch> is equal to the {serverid} from which 685 <amatch> is equal to the {serverid} from which
676 the reply was sent, and <afile> is the actual 686 the reply was sent, and <afile> is the actual
677 reply string. 687 reply string.
678 Note that even if an autocommand is defined, 688 Note that even if an autocommand is defined,
679 the reply should be read with |remote_read()| 689 the reply should be read with |remote_read()|
733 When set to an empty string the user will be 743 When set to an empty string the user will be
734 asked, as if there was no SwapExists autocmd. 744 asked, as if there was no SwapExists autocmd.
735 Note: Do not try to change the buffer, the 745 Note: Do not try to change the buffer, the
736 results are unpredictable. 746 results are unpredictable.
737 *Syntax* 747 *Syntax*
738 Syntax When the 'syntax' option has been set. 748 Syntax When the 'syntax' option has been set. The
749 pattern is matched against the syntax name.
739 <afile> can be used for the name of the file 750 <afile> can be used for the name of the file
740 where this option was set, and <amatch> for 751 where this option was set, and <amatch> for
741 the new value of 'syntax'. 752 the new value of 'syntax'.
742 See |:syn-on|. 753 See |:syn-on|.
743 *TabEnter* 754 *TabEnter*