can you search "." in vi editor by using ? or / ?
can you search the "." (dot) in vim editor by using ? or / ?
|
If you're looking for a dot "." you'd type /\. or ?\.- the "/" or "?" starts the search command and the "\" escapes the "." so it's treated as a literal dot.
Was that what you meant? |
The dot "." is recognised by vim as being a regular expression operator, so it needs to be escaped with a backslash "\" to be read as a literal dot. It's worth finding out about regular expressions, because they're really cool and useful; having said that, it's one of those things I still need to get around to...
|
searching "." in vi
Hi,
for vi U can find a "." by typing /\. in the file. |
another useful way to delimit characters
Another useful technique of delimiting characters comes when you get a windows file and want to remove all of the ^M (ctrl-M) at the end of a line. You need to enter the ^M literally and not have it get taken as an end-of-line input. You can use the :%s/^v^M//g command. The ctrl-v tells vi to take the next character literally, so you can input it into the command. The s command invokes sed and will change all of the occurrences (the g part) of ^M on all (the % part) of the lines.
|
vim and Windows
Quote:
- Mark |
All times are GMT -5. The time now is 05:10 AM. |