Live data from Hacker News

Why, oh why, do those nutheads use vi?

viemu.com

31–40 of 228 posts

Re: Why, oh why, do those nutheads use vi?

#31
post #21

I use vim for about a year or more, and I like it, however I'm still having trouble with copying and pasting tiny fragments of text. Maybe someone can help me out with this? 1) If I yank a line with yy, pressing P or p will insert the text into a new line. 2) If I go to visual mode and select a region, yank it with y, then press p/P, it gets it inserted into the current line. That is, vim preserves new lines. What I…

Whether it pastes a newline or not depends on whether you yanked one. I guess this is what you mean by "vim preserves new lines". Don't all editors work this way?

If you want to yank a line character-wise, you would do something like ^y$. I have Y mapped to y$ for this sort of thing.

You cannot yank a substring of a line line-wise. That doesn't really make sense. I typically open a new line with o and then paste in insert mode with ". So o".

Re: Why, oh why, do those nutheads use vi?

#32
post #21

I use vim for about a year or more, and I like it, however I'm still having trouble with copying and pasting tiny fragments of text. Maybe someone can help me out with this? 1) If I yank a line with yy, pressing P or p will insert the text into a new line. 2) If I go to visual mode and select a region, yank it with y, then press p/P, it gets it inserted into the current line. That is, vim preserves new lines. What I…

For the first case: use 'J', join-lines command. It deletes the newline at the end of the line your cursor is on.

Re: Why, oh why, do those nutheads use vi?

#33
I used vim for about 9 or 10 years before I switched to emacs. From my perspective people use vim because they haven't tried emacs yet (I kid!).

I still have the muscle memory for vi and that's what these sorts of editors rely on to be effective with them. Once you get enough practice the editor practically disappears and it becomes more about the text on the screen... almost like you are manipulating it directly with your mind.

Fun article. :)

Re: Why, oh why, do those nutheads use vi?

#34
post #21

I use vim for about a year or more, and I like it, however I'm still having trouble with copying and pasting tiny fragments of text. Maybe someone can help me out with this? 1) If I yank a line with yy, pressing P or p will insert the text into a new line. 2) If I go to visual mode and select a region, yank it with y, then press p/P, it gets it inserted into the current line. That is, vim preserves new lines. What I…

There's no good way to do it, unfortunatly. You need to yank the contents of the line without yanking the entire line qua line. Now, if 'l' were a text object for 'line' then there would be an obvious 'yil' for just getting the inner stuff, but since there isn't you'll have to do 0y$ to go to the start of the line and yank until the end of the line. That'll store the line contents instead of the line itself, so p will do what you want it to.

Re: Why, oh why, do those nutheads use vi?

#35
Interesting article, I have always been interesting in moving to Vim, and this article all but sealed the deal for me. The only problem being I don't really see how useful this would be for general notepad usage. I understand the author of this article is selling his plugin for Visual Studio, and this is a marvellous way to do it. Is there any other way to integrate vim with Visual Studio 2008 without purchasing his ViEmu? I would love to start learning vim but I doubt a trial would be enough, and I don't see most of the other attributes he covered ('.' for example) being very useful in daily notetaking.

Re: Why, oh why, do those nutheads use vi?

#36

Earlier quoted context omitted.

It seems quite powerful, but overall vi still overwhelms me with all the options and functionality... I'm trying to learn more about vi/m (and emacs) as I get more into Linux development, but I think a lifetime of Windows has damaged me, mentally

In fact learning vi/m is a lot like learning to play a music instrument. It is a pain to start using vim. But if you reach a certain level you start improving more and more. Concerning vim, it should takes some weeks to be as efficient than with notepad. I written this article which also might help you: http://yannesposito.com/Scratch/en/blog/Learn-Vim-Progressiv... Don't give up! It will pay faster than you think.

"In fact learning vi/m is a lot like learning to play a music instrument."

If thats the case, I am screwed

Re: Why, oh why, do those nutheads use vi?

#39
I know this will be an unpopular comment, but my whole problem with it is actually the attitude of those that use it. After reading the article, I was really impressed and imagining all the ways it could help me after what, 8 years of coding into an IDE; and then I got to this:

"Do whatever you want. Don't learn it if you feel it's too much effort just for nothing. Learn emacs instead. Or stay in your IDE using a lousy editor. Whatever. But in any case, don't ever claim again that those 'vi guys are nutheads' - I hope that I have succeeded in showing you why they (we) stick to it, and you should at least be able to understand its power, even if you prefer to stay away from it."

Re: Why, oh why, do those nutheads use vi?

#40

Earlier quoted context omitted.

Pleasure to meet you. Not sure how much passion you require. I'm not exactly head-over-heels with vim, but I have been using it for about 7 years and dvorak for about 3. Anything in particular you want to ask?

I imagine the mnemonics make it work reasonably well, but what about hjkl? Do you really get used to having those spread around?

Yeah. Adjusting to typing in Dvorak took me considerably more time and effort that getting used to the new shortcuts.

Luckily, Dvorak isn't that bad for this. For instance, 'j' (down arrow) and 'k' (up arrow) are still next to each other, in the same order.

'h' (left arrow) and 'l' (right arrow) are not, but when you have your right hand in the starting position, their location and distance is very similar to where they are on QWERTY.

As a side note, it's much harder to type QWERTY on Dvorak.

Now, the arrow keys no longer in the same place -- up/down is on the left side of the keyboard whilst left/right is on the right side.

But that's not as big a problem as you may think -- provided you keep both your hands on the keyboard. Interestingly, the Kinesis Contoured keyboards [1] have the arrows similarly separated.

And there are no "gotchas" where the keys' position would go against the spatial intent.

You could imagine a layout that would for instance have ctrl-f (page down) located below ctrl-b (page up) or 'h' (left arrow) on the right side of 'l' (left arrow). But that's not the case in Dvorak neither for vim nor for the emacs keybindings that I'm familiar with (c-b, c-f, c-a, c-e). Sheer dumb luck, methinks.

Both under vim and under Gnome in general, I've found that all the shortcuts I'm using aren't that much worse off. Some are actually better. It seems to pretty much balance out.

[1]: http://www.kinesis-ergo.com/advantage.htm

Post reply on HN