Hacker News new | past | comments | ask | show | jobs | submit login
Everyone's first Vi session (bash.org)
27 points by iamelgringo on Jan 17, 2008 | hide | past | favorite | 18 comments



One of my college friends suprised me by "saving" a paper she was working on in vi by typing ':wq' and then typing 'vi <paper>' at the command line. Turns out she thought that ':wq' was how you saved in vi, and was happy when I told her to try typing just ':w' instead.


[...] and was happy when I told ter to try typing just ':x' instead.


i can't imagine not programming in Vim. it's so natural. using a normal text editor (including professional IDE's) feels like trudging through quagmire by comparison

a mistake learners of Vi make is being in insert mode most of the time. you should be in command mode almost always. like 94% of the time. otherwise it's no different than a normal text editor with hotkeys. also, newbies need to make use the repeat command '.' which repeats the whole last text _change_. it's not just a paste

once you get some good experience and try to stay out of insert mode, your cursor starts flying around performing all sorts of uber hacker slice & dice magic


Hell yeah! I'm just recently learning Vim and I wondered what was I thinking back then when I was using normal text editors. I especially love the :sp command as it allows me to open multiple windows of my code within the same screen. And oh yes the '.' command is the best. I'm still currently getting the hang of it though.


I feel the same way about emacs. A few nights back I was editing my wife's website - making quite a lot of use of keyboard macros, regex search-and-replace, and that kind of thing. She's only ever used MS-Word so she was continuously asking me "how do you do that?"


After years of Visual Studio I forced myself to learn vim and it wasn't so hard. By "learned" I mean crossing a line where my productivity is on par or better than Visual Studio used to be.

Emacs, however, is nowhere as easy. I am trying to repeat my vim experience by forcing myself to use emacs (part of my CL adventure) and I feel like I need a third hand to hold Ctrl or Alt all the time... Even vim-style navigation without arrows calls for constantly pressed Ctrl.

Not trying to start a war, just sharing my experience. After all it was other peoples "vim tales" that inspired me in the first place.


I wish the emacs macro system was easily Turing complete, but that must open a can of worms or something. I like the notion of writing a program as I do an action, but the macros don't really have control structures built in.


Sort of like the ed session here:

http://www.gnu.org/fun/jokes/ed.msg.html

"Note the consistent user interface and error reportage. Ed is generous enough to flag errors, yet prudent enough not to overwhelm the novice with verbosity."


For a while I thought the only way to quit vi was to cntl-z and then kill.


That's what I thought of (command-line) emacs first.


The first time I used vi was in a summer camp while I was in high school. I had accidentally entered "view foo.txt" into a command prompt on a Linux box, and "view" was symlinked to "vi."

We couldn't figure out how to fix this, so we asked the instructor, who replied to us in a heavy German accent: "aha, you see, vi ees an edeetor, and weez everyzing eet does eet say beeeep."

Actually, he was speaking Dutch with a German accent, not English, but you get the idea.


It may have been that way once but these days if you use vim, by the time you get to the second ^C the message

Type :quit<Enter> to exit Vim

will appear.


@mhartl: I did the same thing until I went and read up on vi long ago...

Also when I finally learned that you could copy and paste into the terminal with ctrl+shift+v/c, I cried tears of joy. Back then, as a nub on linux and copying all those long commands from forum boards without copy/paste...yes. it really was the dark ages.


What is the difference between vi and Pico? I always found vi a mystery and just used pico instead.


Vi is a text editor for serious text editing, it takes some getting used to but is chock full of powerful features. Pico is designed for people who occasionally log into a UNIX machine to check mail or something (its origins are in Pine, which is an email client for UNIX newbies). As a programmer you spend all day editing text, so it's definitely worth putting in the effort to learn how to use a good text editor.

After a decade of regular use I'm only an intermediate vim user, but what I know so far really helps with my productivity.

http://www.google.com/search?hl=en&q=vim%20tutorial


I would say the same thing, except swap vi and pico in your comment :)

I think it's all a matter of what you got used to first. I started out by using vi on some HPUX machines around 13 or 14 years ago. I've just kinda stuck with it ever since because it's on almost every machine I come across, and I can function in vi fairly well.


Imagine what the emacs version would look like. M-q C-q M-C-q M-x quit ...


Menu->File->Quit

I have the menu bar switched off though, so a new user trying my emacs wouldn't have a clue.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: