ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

The AVE

<< < (6/11) > >>

phitsc:
And here's a short tutorial on find and replace:

http://www.thegeekstuff.com/2009/04/vi-vim-editor-search-and-replace-examples/

ewemoa:
Thanks for that -- it's nice to have a series of concrete examples.  Below are their titles:

1. Substitute all occurrences of a text with another text in the whole file
2. Substitution of a text with another text within a single line
3. Substitution of a text with another text within a range of lines
4. Substitution of a text with another text by visual selection of lines
5. Substitution of a text with another text only the 1st X number of lines
6. Substitute only the whole word and not partial match
7. Substitute either word1 or word2 with a new word using regular expression
8. Interactive Find and Replace in Vim Editor
9. Substituting all lines with its line number.
10. Substituting special character with its equivalent value.
11. Alter sequence number in a numbered list while inserting a new item
12. Substituting the sentence beginnings with upper case. ( i.e title case the entire document ).

ewemoa:
I hadn't known that macros were available.

From phitsc's tutorial link, found a link to an article with a couple of examples:

1. Sequence number generation inside a file using Vim Macro
2. Repeat Vim Macro with different arguments

Jibz:
And here's a short tutorial on find and replace:

http://www.thegeekstuff.com/2009/04/vi-vim-editor-search-and-replace-examples/
-phitsc (May 08, 2014, 01:25 AM)
--- End quote ---

Thanks.

1. Sequence number generation inside a file using Vim Macro
2. Repeat Vim Macro with different arguments
-ewemoa (May 08, 2014, 04:31 AM)
--- End quote ---

Didn't know that was possible, nice.

ewemoa:
Is there some trick to using visual mode to select lines? It seems if you do the obvious of pressing v and then moving down using j, it selects the lines plus the first character on the next line. If I have to select the lines up to the last and then press $ to get the last line, that's just hopeless :huh:.

Edit: Ah, found it with google while fiddling with this post. Apparently you can use Shift-V to enter visual line mode.
-Jibz (April 19, 2014, 02:09 PM)
--- End quote ---

This made it through my thick skull via:

  http://www.cs.swarthmore.edu/help/vim/selection.html

:)


I noticed there's column selection too - Ctrl-v IIUC.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version