Mercurial > vim
comparison runtime/doc/cmdline.txt @ 7013:349e6c01f35d
Update runtime files.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Tue, 11 Aug 2015 20:34:49 +0200 |
parents | b2673982c625 |
children | 64e30831fa42 |
comparison
equal
deleted
inserted
replaced
7012:0175e7cfea2e | 7013:349e6c01f35d |
---|---|
1 *cmdline.txt* For Vim version 7.4. Last change: 2015 Jul 21 | 1 *cmdline.txt* For Vim version 7.4. Last change: 2015 Jul 28 |
2 | 2 |
3 | 3 |
4 VIM REFERENCE MANUAL by Bram Moolenaar | 4 VIM REFERENCE MANUAL by Bram Moolenaar |
5 | 5 |
6 | 6 |
748 Note: These are special characters in the executed command line. If you want | 748 Note: These are special characters in the executed command line. If you want |
749 to insert special things while typing you can use the CTRL-R command. For | 749 to insert special things while typing you can use the CTRL-R command. For |
750 example, "%" stands for the current file name, while CTRL-R % inserts the | 750 example, "%" stands for the current file name, while CTRL-R % inserts the |
751 current file name right away. See |c_CTRL-R|. | 751 current file name right away. See |c_CTRL-R|. |
752 | 752 |
753 Note: If you want to avoid the special characters in a Vim script you may want | 753 Note: If you want to avoid the effects of special characters in a Vim script |
754 to use |fnameescape()|. Also see |`=|. | 754 you may want to use |fnameescape()|. Also see |`=|. |
755 | 755 |
756 | 756 |
757 In Ex commands, at places where a file name can be used, the following | 757 In Ex commands, at places where a file name can be used, the following |
758 characters have a special meaning. These can also be used in the expression | 758 characters have a special meaning. These can also be used in the expression |
759 function expand() |expand()|. | 759 function |expand()|. |
760 % Is replaced with the current file name. *:_%* *c_%* | 760 % Is replaced with the current file name. *:_%* *c_%* |
761 # Is replaced with the alternate file name. *:_#* *c_#* | 761 # Is replaced with the alternate file name. *:_#* *c_#* |
762 This is remembered for every window. | 762 This is remembered for every window. |
763 #n (where n is a number) is replaced with *:_#0* *:_#n* | 763 #n (where n is a number) is replaced with *:_#0* *:_#n* |
764 the file name of buffer n. "#0" is the same as "#". *c_#n* | 764 the file name of buffer n. "#0" is the same as "#". *c_#n* |
790 you type: result ~ | 790 you type: result ~ |
791 # alternate.file | 791 # alternate.file |
792 \# # | 792 \# # |
793 \\# \# | 793 \\# \# |
794 Also see |`=|. | 794 Also see |`=|. |
795 | |
795 *:<cword>* *:<cWORD>* *:<cfile>* *<cfile>* | 796 *:<cword>* *:<cWORD>* *:<cfile>* *<cfile>* |
796 *:<sfile>* *<sfile>* *:<afile>* *<afile>* | 797 *:<sfile>* *<sfile>* *:<afile>* *<afile>* |
797 *:<abuf>* *<abuf>* *:<amatch>* *<amatch>* | 798 *:<abuf>* *<abuf>* *:<amatch>* *<amatch>* |
798 *<slnum>* *E495* *E496* *E497* *E499* *E500* | 799 *<slnum>* *E495* *E496* *E497* *E499* *E500* |
799 Note: these are typed literally, they are not special keys! | 800 Note: these are typed literally, they are not special keys! |
810 <amatch> When executing autocommands, is replaced with the match for | 811 <amatch> When executing autocommands, is replaced with the match for |
811 which this autocommand was executed. It differs from | 812 which this autocommand was executed. It differs from |
812 <afile> only when the file name isn't used to match with | 813 <afile> only when the file name isn't used to match with |
813 (for FileType, Syntax and SpellFileMissing events). | 814 (for FileType, Syntax and SpellFileMissing events). |
814 <sfile> When executing a ":source" command, is replaced with the | 815 <sfile> When executing a ":source" command, is replaced with the |
815 file name of the sourced file. *E498* | 816 file name of the sourced file. *E498* |
816 When executing a function, is replaced with | 817 When executing a function, is replaced with |
817 "function {function-name}"; function call nesting is | 818 "function {function-name}"; function call nesting is |
818 indicated like this: | 819 indicated like this: |
819 "function {function-name1}..{function-name2}". Note that | 820 "function {function-name1}..{function-name2}". Note that |
820 filename-modifiers are useless when <sfile> is used inside | 821 filename-modifiers are useless when <sfile> is used inside |
879 After this, the previous modifiers can be used again. For | 880 After this, the previous modifiers can be used again. For |
880 example ":p", to make a full path after the substitution. | 881 example ":p", to make a full path after the substitution. |
881 :gs?pat?sub? | 882 :gs?pat?sub? |
882 Substitute all occurrences of "pat" with "sub". Otherwise | 883 Substitute all occurrences of "pat" with "sub". Otherwise |
883 this works like ":s". | 884 this works like ":s". |
884 :S Escape special characters for use with a shell command (see | 885 :S Escape special characters for use with a shell command (see |
885 |shellescape()|). Must be the last one. Examples: > | 886 |shellescape()|). Must be the last one. Examples: > |
886 :!dir <cfile>:S | 887 :!dir <cfile>:S |
887 :call system('chmod +w -- ' . expand('%:S')) | 888 :call system('chmod +w -- ' . expand('%:S')) |
888 | 889 |
889 Examples, when the file name is "src/version.c", current dir | 890 Examples, when the file name is "src/version.c", current dir |
932 <cfile> path name under the cursor | 933 <cfile> path name under the cursor |
933 <cfile>< idem, without extension | 934 <cfile>< idem, without extension |
934 | 935 |
935 Note: Where a file name is expected wildcards expansion is done. On Unix the | 936 Note: Where a file name is expected wildcards expansion is done. On Unix the |
936 shell is used for this, unless it can be done internally (for speed). | 937 shell is used for this, unless it can be done internally (for speed). |
937 Backticks also work, like in > | 938 Unless in |restricted-mode|, backticks work also, like in > |
938 :n `echo *.c` | 939 :n `echo *.c` |
939 (backtick expansion is not possible in |restricted-mode|) | |
940 But expansion is only done if there are any wildcards before expanding the | 940 But expansion is only done if there are any wildcards before expanding the |
941 '%', '#', etc.. This avoids expanding wildcards inside a file name. If you | 941 '%', '#', etc.. This avoids expanding wildcards inside a file name. If you |
942 want to expand the result of <cfile>, add a wildcard character to it. | 942 want to expand the result of <cfile>, add a wildcard character to it. |
943 Examples: (alternate file name is "?readme?") | 943 Examples: (alternate file name is "?readme?") |
944 command expands to ~ | 944 command expands to ~ |
971 FILE NAME INTERPRETED AS ~ | 971 FILE NAME INTERPRETED AS ~ |
972 $home expanded to value of environment var $home | 972 $home expanded to value of environment var $home |
973 \$home file "$home" in current directory | 973 \$home file "$home" in current directory |
974 /\$home file "$home" in root directory | 974 /\$home file "$home" in root directory |
975 \\$home file "\\", followed by expanded $home | 975 \\$home file "\\", followed by expanded $home |
976 | |
976 Also see |`=|. | 977 Also see |`=|. |
977 | 978 |
978 ============================================================================== | 979 ============================================================================== |
979 7. Command-line window *cmdline-window* *cmdwin* | 980 7. Command-line window *cmdline-window* *cmdwin* |
980 *command-line-window* | 981 *command-line-window* |