Lines Matching refs:to

13 |12.2|	Change "Last, First" to "First Last"
28 The substitute command can be used to replace all occurrences of a word with
33 The "%" range means to replace in all lines. The "g" flag at the end causes
34 all words in a line to be replaced.
36 It would be replaced with "thirty4". To avoid this, use the "\<" item to
41 Obviously, this still goes wrong on "fourteen". Use "\>" to match the end of
46 If you are programming, you might want to replace "four" in comments, but not
47 in the code. Since this is difficult to specify, add the "c" flag to have the
56 Suppose you want to replace a word in more than one file. You could edit each
57 file and type the command manually. It's a lot faster to use record and
60 There is a function called "GetResp" that you want to rename to "GetAnswer".
62 vim *.cpp Start Vim, defining the argument list to
68 :wnext Write this file and move to the next one.
76 to the next file. This stops the execution, and everything is done.
84 the "e" flag to the substitute command: >
91 *12.2* Change "Last, First" to "First Last"
98 You want to change that to:
110 The arguments for the substitute command are "/from/to/". The slashes
111 separate the "from" pattern and the "to" string. This is what the "from"
123 In the "to" part we have "\2" and "\1". These are called backreferences.
124 They refer to the text matched by the "\( \)" parts in the pattern. "\2"
125 refers to the text matched by the second "\( \)", which is the "First" name.
126 "\1" refers to the first "\( \)", which is the "Last" name.
127 You can use up to nine backreferences in the "to" part of a substitute
152 This goes to the first line, where "OBJS" is the first thing in the line.
155 easier to type, but more work when there are many lines.
169 Notice that a backslash at the end of each line is used to indicate the line
171 the end didn't have a backslash. Now that it sorts to another place, it
173 The simplest solution is to add the backslash with "A \<Esc>". You can
180 The |:global| command can be combined with the |:move| command to move all the
190 is blank). The |:move| command moves the matching line to after the imaginary
193 |:global| proceeds to match all remaining lines of the file and puts each as
196 This also works on a range of lines. First move to above the first line and
197 mark it with "mt". Then move the cursor to the last line in the range and
205 Sometimes you have to write a text with a maximum number of words. Vim can
207 When the whole file is what you want to count the words in, use this
212 Do not type a space after the g, this is just used here to make the command
213 easy to read.
221 When the text is only part of a file, you could move to the start of the text,
222 type "g CTRL-G", move to the end of the text, type "g CTRL-G" again, and then
223 use your brain to compute the difference in the word position. That's a good
225 want to count words in. Then type g CTRL-G. The result:
229 For other ways to count words, lines and other items, see |count-items|.
235 that you want to find the man page for (this is on Unix). Let's first use a
236 simple way: Move the cursor to the word you want to find help on and press >
241 found, it is displayed. This uses the normal pager to scroll through the text
242 (mostly the "more" program). When you get to the end pressing <Enter> will
246 on at the same time. There is a trick to make the man page appear in a Vim
251 Put this command in your vimrc file if you intend to do this often. Now you
252 can use the ":Man" command to open a window on a man page: >
256 You can scroll around and the text is highlighted. This allows you to find
257 the help you were looking for. Use CTRL-W w to jump to the window with the
260 For example, to look in section 3 for "echo": >
264 To jump to another man page, which is in the text with the typical form
273 For example, you want to know the return value of "strstr()" while editing
278 Move the cursor to somewhere on "strstr" and type "\K". A window will open
279 to display the man page for strstr().
294 The "to" part of the substitute command is empty: "//". Thus it replaces
304 it's "/<Space><Tab>". Now use "x" to delete the space and check that the
305 amount of white space doesn't change. You might have to insert a tab if it
306 does change. Type "n" to find the next match. Repeat this until no more
313 to edit all the files that contain a given word. This is extremely useful if
314 you are working on a program and want to view or edit all the files that
316 For example, suppose you want to edit all the C program files that contain
328 to run this command and pretend that the results were typed on the command
332 like ":next" and ":first" to browse through the files.
338 have to find the word within the files.
339 Vim has a built-in command that you can use to search a set of files for a
340 given string. If you want to find all occurrences of "error_string" in all C
345 This causes Vim to search for the string "error_string" in all the specified
347 and position the cursor on the first matching line. To go to the next
349 to the previous match, use the ":cprev" command. Use ":clist" to see all the