Putty VI and Formating
I have been given some instructions in Vi to format some data. Since I'm new I was basically asked to hit ESC in Vi and then type the following in the on the bottom
:1 :$s/,/CTRL-V then while holding down CTRL press M/g This would format a wall of text into a readable page. I was wondering if: a) There was a place I could go to online to learn what the :$s,/,/ symbols and characters where doing b) I made a mistake once and now some of the characters in the file are highlighted in yellow. I was wondering if we could turn that off or reset the file....sorry my jargon is brutal. :-( |
well the s// stuff ia a regular expression, there are millions of google hits for regular expression tutorials (Also called a regex or regexp)
being in yellow means you searched for it. e.g. in vi hitting /bum will search for bum and highlight all occurrences in yellow. Personally i just search for something that it won't find, e.g. /ewrdhjgklhjg to clear it, but any vi tutorial will tell you the proper way to clear it. |
What are you trying to do? It looks like you are trying to convert commas to newlines, in which case it's
Code:
:1,$s/,/ctrl-v ctrl-m/g The vim docs are at http://www.vim.org/ and are also on your system somewhere eg /usr/share/vim/vim62/doc (62 = version 6.2 : YMMV). |
All times are GMT -5. The time now is 01:56 PM. |