comparison runtime/doc/insert.txt @ 523:a7ae7e043e43

updated for version 7.0146
author vimboss
date Tue, 13 Sep 2005 21:20:47 +0000
parents d50452846776
children 0d6092bb72e6
comparison
equal deleted inserted replaced
522:530b30703db6 523:a7ae7e043e43
1 *insert.txt* For Vim version 7.0aa. Last change: 2005 Sep 10 1 *insert.txt* For Vim version 7.0aa. Last change: 2005 Sep 13
2 2
3 3
4 VIM REFERENCE MANUAL by Bram Moolenaar 4 VIM REFERENCE MANUAL by Bram Moolenaar
5 5
6 6
567 6. tags |i_CTRL-X_CTRL-]| 567 6. tags |i_CTRL-X_CTRL-]|
568 7. file names |i_CTRL-X_CTRL-F| 568 7. file names |i_CTRL-X_CTRL-F|
569 8. definitions or macros |i_CTRL-X_CTRL-D| 569 8. definitions or macros |i_CTRL-X_CTRL-D|
570 9. Vim command-line |i_CTRL-X_CTRL-V| 570 9. Vim command-line |i_CTRL-X_CTRL-V|
571 10. User defined completion |i_CTRL-X_CTRL-U| 571 10. User defined completion |i_CTRL-X_CTRL-U|
572 11. Occult completion |i_CTRL-X_CTRL-O| 572 11. omni completion |i_CTRL-X_CTRL-O|
573 12. Spelling suggestions |i_CTRL-X_s| 573 12. Spelling suggestions |i_CTRL-X_s|
574 13. keywords in 'complete' |i_CTRL-N| 574 13. keywords in 'complete' |i_CTRL-N|
575 575
576 All these (except 2) are done in CTRL-X mode. This is a sub-mode of Insert 576 All these (except 2) are done in CTRL-X mode. This is a sub-mode of Insert
577 and Replace modes. You enter CTRL-X mode by typing CTRL-X and one of the 577 and Replace modes. You enter CTRL-X mode by typing CTRL-X and one of the
671 at least two characters is matched. 671 at least two characters is matched.
672 e.g., to get: 672 e.g., to get:
673 printf("(%g, %g, %g)", vector[0], vector[1], vector[2]); 673 printf("(%g, %g, %g)", vector[0], vector[1], vector[2]);
674 just type: 674 just type:
675 printf("(%g, %g, %g)", vector[0], ^P[1], ^P[2]); 675 printf("(%g, %g, %g)", vector[0], ^P[1], ^P[2]);
676
677 The search wraps around the end of the file, the value of 'wrapscan' is not
678 used here.
676 679
677 Multiple repeats of the same completion are skipped; thus a different match 680 Multiple repeats of the same completion are skipped; thus a different match
678 will be inserted at each CTRL-N and CTRL-P (unless there is only one 681 will be inserted at each CTRL-N and CTRL-P (unless there is only one
679 matching keyword). 682 matching keyword).
680 683
880 883
881 CTRL-P Use the previous match. This match replaces the 884 CTRL-P Use the previous match. This match replaces the
882 previous one. 885 previous one.
883 886
884 887
885 Occult completion *compl-occult* 888 Omni completion *compl-omni*
886 889
887 Completion is done by a function that can be defined by the user with the 890 Completion is done by a function that can be defined by the user with the
888 'occultfunc' option. This is to be used for filetype-specific completion. 891 'omnifunc' option. This is to be used for filetype-specific completion.
889 892
890 See the 'completefunc' help for how the function is called and an example. 893 See the 'completefunc' help for how the function is called and an example.
891 For remarks about specific filetypes see |compl-occult-filetypes|. 894 For remarks about specific filetypes see |compl-omni-filetypes|.
892 895
893 *i_CTRL-X_CTRL-O* 896 *i_CTRL-X_CTRL-O*
894 CTRL-X CTRL-O Guess what kind of item is in front of the cursor and 897 CTRL-X CTRL-O Guess what kind of item is in front of the cursor and
895 find the first match for it. 898 find the first match for it.
896 CTRL-O or 899 CTRL-O or
947 CTRL-X CTRL-P Further use of CTRL-X CTRL-N or CTRL-X CTRL-P will 950 CTRL-X CTRL-P Further use of CTRL-X CTRL-N or CTRL-X CTRL-P will
948 copy the words following the previous expansion in 951 copy the words following the previous expansion in
949 other contexts unless a double CTRL-X is used. 952 other contexts unless a double CTRL-X is used.
950 953
951 954
952 Filetype-specific remarks for occult completion *compl-occult-filetypes* 955 Filetype-specific remarks for omni completion *compl-omni-filetypes*
953 956
954 C *ft-c-occult* 957 C *ft-c-omni*
955 958
956 Completion requires a tags file. You should use Exuberant ctags, because it 959 Completion of C code requires a tags file. You should use Exuberant ctags,
957 adds extra information that is needed for completion. You can find it here: 960 because it adds extra information that is needed for completion. You can find
958 http://ctags.sourceforge.net/ 961 it here: http://ctags.sourceforge.net/
959 For version 5.5.4 you need to add a patch that adds the "typename:" field: 962 For version 5.5.4 you should add a patch that adds the "typename:" field:
960 ftp://ftp.vim.org/pub/vim/unstable/patches/ctags-5.5.4.patch 963 ftp://ftp.vim.org/pub/vim/unstable/patches/ctags-5.5.4.patch
961 964
962 If you want to complete system functions you can do something like this. Use 965 If you want to complete system functions you can do something like this. Use
963 ctags to generate a tags file for all the system header files: > 966 ctags to generate a tags file for all the system header files: >
964 % ctags -R -f ~/.vim/systags /usr/include /usr/local/include 967 % ctags -R -f ~/.vim/systags /usr/include /usr/local/include
971 in the tags file, use CTRL-P instead. 974 in the tags file, use CTRL-P instead.
972 975
973 When using CTRL-X CTRL-O after something that has "." or "->" Vim will attempt 976 When using CTRL-X CTRL-O after something that has "." or "->" Vim will attempt
974 to recognize the type of the variable and figure out what members it has. 977 to recognize the type of the variable and figure out what members it has.
975 This means only members valid for the variable will be listed. 978 This means only members valid for the variable will be listed.
979
980 When a member name already was complete, CTRL-X CTRL-O will add a "." or
981 "->" for composite types.
976 982
977 Vim doesn't include a C compiler, only the most obviously formatted 983 Vim doesn't include a C compiler, only the most obviously formatted
978 declarations are recognized. Preprocessor stuff may cause confusion. 984 declarations are recognized. Preprocessor stuff may cause confusion.
979 When the same structure name appears in multiple places all possible members 985 When the same structure name appears in multiple places all possible members
980 are included. 986 are included.