You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!
If you have any problems with the registration process or your account login, please contact contact us.
Geek ChatAsk computer questions or just engage in general geek talk on here
Wow, okay, I was just casually programming a macro to go through a few hundred lines and change ten digit phone numbers in a list in vim from 1234567890 format to 123-456-7890 format (adding the dashes in there).
Anyway, I finished, then looked back at the last command I gave vim, and realized to a non-unix person, that would look scary. Here it is:
Umnitza now provides a mechanic to install all parts ordered right in the box! It's their new "Total customer service program" that will eliminate all the haters and keep incompetents from breaking **** and blaming the vendor! When you are all set simply call INS and they will pick him up free of charge.
Your Ride: 1991 318is (e30 m42), 2007 Mazdaspeed 3
Harry I could do that in excel in about 2 minutes without your fancy macro. and in access you could have imported the table and assigned an input mask.
I'm making the assumption that your using an office program. If not, nevermind.
^^ It's not office, it's VIM... a hardcore unix text editing program.
And two minutes would have taken longer. I'm saying I just kinda rambled that off not thinking in about 10 seconds, then looked back and was like "whoa." haha
Vim is a highly configurable text editor built to enable efficient text editing. It is an improved version of the vi editor distributed with most UNIX systems. Vim is distributed free as charityware. If you find Vim a useful addition to your life please consider helping needy children in Uganda.
Hum, for an example of how it's used...
Say you have this situation:
Quote:
the miv system@
This is a test ofunimportant-stuff-here
If you put the cursor at the beginning of the file and type:
Quote:
{down} w w w w {right} {right} {esc} d $ {up} {esc} : s / \ ( . \ ) i \ ( . \ ) / \ 2 i \ 1 / g {enter} {esc} $ x a . {esc} y y d d p {up} {shift} j $
You get this:
Quote:
This is a test of the vim system.
After you use it for a few years and it becomes natural (not kidding), it looks crazy cool for someone to walk by behind you and see your hands flying around the keyboard hitting random letters and symbols, and the text on the screen is completely warping and changing to whatever you want, haha.
It's an INSANELY effectient word processor though. I absolutely love it, and I do all my programming in it. After you learn vim really well, you can greatly enhance your typing effeciency. No others can touch it.
Bah whoever says replacing vim with excel is just plainly wrong... for certain stuff.. unix regexes are world famous, and even ms office utilizes them. but I cant bitch on either side, since I have worked and will work for the opposing forces.
I've been using vi (vim's daddy) for at least a dozen years, it is really the only editor (family) to use on *nix (read unix/linux) and even I don't use it to it's full extent. although it did get me a job once. The interview question was:
In vi how do you search and replace every value in a file. (this can be tricky )
Sorry I used vi as well. Solaris by default doesnt come with vim the question for search and replace is actually quite easy:
: %s/old value/new value/g ... the g for global replace
You are correct sir,
I would have also accepted
:1,$s/old value/new value/g
that question got me a job as an instructor and of all things for the MCSE course. They also had me developing the unix course, but it never got off the ground.