Live data from Hacker News

One with Vim

invisibletheory.com

81–90 of 129 posts

Re: One with Vim

#81
post #27

I'm aware I may be too pedantic, but it bothers me when people seem to completely conflate vim with vi. For example, -vi- was released in 1976, and vim not until 1991, despite what the article claims. In the meantime, I'll keep happily using nvi, and keeping the kids off my lawn. edit: links... http://en.wikipedia.org/wiki/Nvi http://en.wikipedia.org/wiki/Vi http://en.wikipedia.org/wiki/Vim_%28text_editor%29

I think you're going to have to lot further than that to be too pedantic for a discussion of programming editors.

As a relative latecomer to vim, I think your distinction is worthy remembering. If you didn't start with vi, it's easy to assume that all the power and cool stuff is the result of improvements and not realize how much just plain old vi could/can do.

Re: One with Vim

#82
post #78

Earlier quoted context omitted.

It sounds like your most of your complaints are with the .Net platform, library layout, and the compiler. For what it's worth, I've always found Microsoft APIs to vary profoundly in terms of usability and (especially) documentation. And MSDN hasn't been directly useful to me since the VS 6.0 days. Can you give me an example of an editor with better text column editing? I'm not entirely sure what you mean.

> It sounds like your most of your complaints are with the .Net platform, library layout, and the compiler. Only about half-so. The first paragraph was all about VS exclusively, minus "too many warnings". But due to the issues in .NET, you essentially must use Visual Studio, which makes it at least bearable due to intellisense. But I crash VS fairly often, it eats up a half-gig or more of memory fairly often, it thra…

FWIW I'm the author of the Zeus programmer's editor and it can import VS solutions files and once imported you can build and compile all from inside the editor.

Zeus also does a limited amount of intellisensing, but naturally the intellisensing is nowhere near good as that found in VS. But the code navigation is not too back.

Zeus also has full MSDN integration and it can actually do context sensitive queries of the MSDN much faster than VS:

http://www.zeusedit.com/zforum/viewtopic.php?t=2833

So if you are prepared to forgo a bit on intellisensing, it is in fact possible to develop outside of the VS IDE at least some of the time.

Re: One with Vim

#83
post #61

Earlier quoted context omitted.

As a new vim user, I'm still trying to figure out what to do with them. What do you find yourself macroing, generally?

For me the most important thing was learning to add a 'j' at the end of each macro and running it multiple times. So lets say you want to crack open an array that looks like this: $address = array( 'name' => '', 'line1' => '', 'line2' => '', 'state' => '', 'country' => '', 'postcode' => '', ); That's a lot of commas and quotes etc. Nowadays I usually punch this into vim: name line1 line2 state country postcode Then I…

If you're a heavy macro user, you might find `:noremap @q` to be handy. Just stick your temporary macro in q (the easiest one to stick it in :), then press the spacebar to run it whenever you want.

Re: One with Vim

#84

Am I foolish for not believing the vi/vim hype? I understand that it's been around for as long as rocks, and that it's quite handy since it's available everywhere. I use it daily, in fact, but rarely for more than basic editing. I'll just come out and say it: my favorite editor is Visual Studio. Sure, it's slow to load and rather fat now, but I'm talking solely about the editing functionality. With vim, I have to cli…

Am I foolish for not believing the vi/vim hype?

Not at all. If VS suits your needs, then rock on!

Personally, I enjoy the occasional vi/vim story here, as in reading the comments I almost always come away with several new ways of doing things in vim.

I think there's a better question to be asked, however. Given that programming involves a seemingly endless stream of tools/techniques that seem good enough and alternatives that are promised to be much better, do you have an efficient strategy for determining which alternatives to explore? (This is a question I've been wrestling with myself recently.) How much time should be budgeting for exploring an alternative before writing it off as a time sink instead of productivity multiplier?

In your case, since you already use vi/vim daily for some editing tasks, I'd suggest a low time-investment strategy of lowering the slope of your learning curve: review how you normally use it, isolate one or two procedures that seem awkward or irritating, and then focus a small amount of time on researching/practicing the recommended alternative practices of experienced users. I've found that by focusing on the occasional experiment, learning is much more enjoyable. If I think about how much I don't know about vim, on the other hand, I'm inclined to feel overwhelmed and put off learning anything.

Admittedly, this approach isn't going to help if your resistance point is learning to dump the arrow keys and mouse. On that one, I don't know that there really is any good alternative to a couple of weeks of devoted effort.

Re: One with Vim

#85
post #27

I'm aware I may be too pedantic, but it bothers me when people seem to completely conflate vim with vi. For example, -vi- was released in 1976, and vim not until 1991, despite what the article claims. In the meantime, I'll keep happily using nvi, and keeping the kids off my lawn. edit: links... http://en.wikipedia.org/wiki/Nvi http://en.wikipedia.org/wiki/Vi http://en.wikipedia.org/wiki/Vim_%28text_editor%29

I think you're going to have to lot further than that to be too pedantic for a discussion of programming editors. As a relative latecomer to vim, I think your distinction is worthy remembering. If you didn't start with vi, it's easy to assume that all the power and cool stuff is the result of improvements and not realize how much just plain old vi could/can do.

About being pedantic, "going a lot further" -- being a pedant is all a cultural construct, though, isn't it? We're in a time where the lack of distinction between vim/vi is displayed so often that it's not hard to imagine a group of people looking at my original comment and saying "to hell with you, you -are- pedantic, old-school, and vim -is- vi. But better."

I'm really happy there are enough people who apparently appreciate (if not fully agree with) my comment to upvote it, though. I don't care about the karma, but happy to see signs of kindred spirits :)

Re: One with Vim

#86
post #66
post #42

Earlier quoted context omitted.

you can copy and paste from the system clipboard as the + register - use "+y to yank to the system clipboard and "+p to paste from it (depending on OS, you may need to use * instead of +). This allows cutting and pasting between vim and other applications (including other instances of vim). For editing multiple docs with vim, I find it's easier to use multiple buffers in the same window. Use :b to jump back and forth…

But your vim has to be compiled with clipboard support. I use gvim for just this reason for all but basic editing (for which I just fire up vim).

Generally, gvim and vim are the same binary.

Re: One with Vim

#87

selfish question here: Does anybody know how to setup vim so that :! recognises aliases? something like... set shellcmdflag=-O\ expand_aliases\ -c

By default, Bash, Zsh, and other shells don't source the shell config when started with -c (because it's considered a non-interactive session). For Bash & Zsh, you can force .bashrc/.zshrc to load by adding -i to 'shellcmdflag'.

Re: One with Vim

#88
post #31

selfish question here: Does anybody know how to setup vim so that :! recognises aliases? something like... set shellcmdflag=-O\ expand_aliases\ -c

I believe that vim sources env files rather than rc. For example, any aliases placed in my zshenv are available in vim but those in zshrc are not. I would imagine that applies to other shells as well.

Zsh always source zshenv, regardless of login/interactive options. AFAIK, Bash has no equivalent.

Re: One with Vim

#89
post #42

Earlier quoted context omitted.

you can copy and paste from the system clipboard as the + register - use "+y to yank to the system clipboard and "+p to paste from it (depending on OS, you may need to use * instead of +). This allows cutting and pasting between vim and other applications (including other instances of vim). For editing multiple docs with vim, I find it's easier to use multiple buffers in the same window. Use :b to jump back and forth…

I never really liked using :b ... for quickly switching back and forth between files, so I bound ^hjkl to move among buffers. Perhaps the best part of my vim experience. " Use ctrl + movement keys to move around windows map h _ map j _ map k _ map l _

1 ctrl-^ go to buffer 1

2 ctrl-^ go to buffer 2

3 ctrl-^ go to buffer 3

ctrl-^ toggle this buffer with the last one, quickly switching back and forth.

[Of course, ctrl-^ is actually just ctrl-6, you don't need to use the shift key.]

If you have used a tiling window manager before, this is very natural.

Re: One with Vim

#90

Am I foolish for not believing the vi/vim hype? I understand that it's been around for as long as rocks, and that it's quite handy since it's available everywhere. I use it daily, in fact, but rarely for more than basic editing. I'll just come out and say it: my favorite editor is Visual Studio. Sure, it's slow to load and rather fat now, but I'm talking solely about the editing functionality. With vim, I have to cli…

Am I foolish for not believing the vi/vim hype? Not at all. If VS suits your needs, then rock on! Personally, I enjoy the occasional vi/vim story here, as in reading the comments I almost always come away with several new ways of doing things in vim. I think there's a better question to be asked, however. Given that programming involves a seemingly endless stream of tools/techniques that seem good enough and alternat…

Vim certainly seems to have phenomenal potential. One problem I have, however, is the discovery of options, plugins, and "best practices" which lead to high productivity in vim. Basically, I want to pair program with some vim experts and talk about how they use vim.

Incidentally, in relation to your last paragraph, I don't see any advantage to vim's keyboard usage because I use a Kinesis Classic with a Dvorak layout. My arrow keys, home, end, page up, and page down are all within reach from home row. And of course, the Dvorak layout makes some vim shortcuts less intuitive. As for the mouse, I hardly touch it while coding.

Post reply on HN