Live data from Hacker News

Why, oh why, do those nutheads use vi?

viemu.com

21–30 of 228 posts

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

#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 can't figure out is how to paste into the current line in the first case, and, vice-versa, how to easily paste into a new line in the second case (without doing :put, or opening a new line).

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

#22
post #15

Earlier quoted context omitted.

What's the biggest OS distribution that does not have vi mapped to vim by default these days?

Last time I installed Arch, it did not. Also checking Scientific, it does not (assume also RHEL/CentOS).

Arch definitely doesn't. sometimes I accidentally type vi and am confused for a few seconds why things dont work right. Luckily an alias will fix it.

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

#23

I want to meet a dvorak keyboard user who is passionate about vi.

Not sure about passionate, but I like it enough that I use VsVim for my day job (.net developer).

I actually started using Dvorak before picking up vi; never had a problem with the keyboard mappings. It helps that j and k are still next to each other, and h is to the left of l.

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

#24
post #10

I'd be interested to know how much of the stuff presented in the article is actually present in plain vi (not vim). If you mean vim, then say vim, not vi. They are two different things.

What's the biggest OS distribution that does not have vi mapped to vim by default these days?

The last time I used AIX (I believe it was 5.3), it had old-school vi on it. I would bet this is true of newer revisions of AIX, as well as other commercial UNIX(tm) systems. I would also not be surprised to learn that some/most of the BSD systems still use it.

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

#25
post #19

Don't ever start using vi. After you do, any text editor that you are forced to use that doesn't have vi key bindings will give you fits and make you cry. Learning vi is your standard process of enlightenment and elation followed by a lifetime of disappointment. Think about how you'd feel if you ate the best meal of your life at age 13, and the restaurant where you ate it went out of business the next day. You'll be…

s/vi/emacs/

;-)

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

#26
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 #1, the yy command will yank the entire line (including the newline). Try using y$, which will yank from the cursor to the end of the line (not including the newline).

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

#27
post #5

I want to meet a dvorak keyboard user who is passionate about vi.

I'm a Colemak user and still really like Vim. I have to do a bit of mapping to get things comfortable but still it works well for me.

I switched to Colemak (and a DAS keyboard) about two and a half months ago. Any details about your mapping that you could share would be appreciated.

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

#28
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, you need to do a 0yt$ .. this will yank to endline, but not include it. The whole line can then be pasted into another without breaking it.

The 2nd can be o/Op .. Maybe there's a more elegant way though!

You could bind these to, say, p and P, if you find yourself doing it a lot.

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

#30
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…

:h i_ctrl-r

That is, i0 will paste a line character-wise, but the EOL will still be there, so you might have to join lines afterward. Alternatively, you could not yank the EOL with ^y$.

For making a newline with a character-wise yank, use o or O to make the new line and you can use 0. Or Escape and p.

Post reply on HN