Live data from Hacker News

Vim 8.0 is coming

github.com

361–370 of 420 posts

Re: Vim 8.0 is coming

#361

I'm quite a noob at 'nix, so I tend to use nano whenever I need to edit something. Not sure if this is the right place, but could somebody explain the added benefit of spending the time to learn to use vim/emacs? I've tried vim, but it seems very complicated.

Personally, I find vim's modal editing to be very efficient. When starting from a clean slate, it doesn't really matter much -- but when changing/editing existing text/code, I find it feels much more natural. It also works well without using the mouse, which is important to me because of carpal tunnel syndrome (and also helps when working without a proper mouse, such as on laptops).

I've only toyed with emacs, but based on that, I don't think emacs' idea of keyboard "chords" is as good a fit as vi(m). With standard keybindings, it also puts a strain on my wrists.

Modal editing and the "edit language"[1] (verbs, nouns, modifiers (and motions), like dw=delete word, dd/dl=delete line, d$=delete from cursor to end-of-line, dG (delete to endo-of-file, where gg/G is motion for moving to top/bottom of file respectively), ciw()P=change inner word (cut word under cursor to buffer), add "()", escape out of insert mode, paste word between "()"). These look cryptic, but quickly starts to feel quite natural and intuitive.

My impression is that Emacs' Evil-mode has evolved quite a lot lately, and allows one to combine the best of both: a much better programming language (scheme dialect) for customization, with modal editing and vi(m) key bindings. But I've yet to play with it.

If you don't mind using the mouse, you might also want to look at ACME[2] - it's a bit more exotic, and unfortunately hasn't gotten as much support as VIM/Emacs.

The creator of Vim, Mjolnar, has a great video on "7 Habits For Effective Text Editing 2.0":

https://www.youtube.com/watch?v=p6K4iIMlouI

I think the idea is very powerful: aim for incremental improvement in your workflow. You don't have to use vim to do that, but you certainly can use vim for that. Another editor that might be worth a look if you're not already familiar with vim, is: https://github.com/mawww/kakoune

The main argument for Neovim/vim/Emacs over other "smaller" editors would be the plugin eco-system. I have a theory though, that beginners tend to start out with a lot of plugins, and then gradually trim down, as they realize the power that lies within the editor itself.

Still, for vim, you will probably want a plugin manager (well, maybe not now with vim 8 supporting that out of the box :-), and depending on what you're writing, some integration with a tag tools, like cscope, perhaps a search-tool like Ag/The silver searcher: https://github.com/rking/ag.vim#readme

As for plugin manager, I'm personally in the process of moving - I'd suggest looking at Vundle and/or vim-plug.

Finally, you can generally count on any unix-like system to have some form of vi(m) installed -- I'm not sure I really see that as such an important point, but does make it easier to edit stuff on a server with only ssh open to the world. But that stuff you're editing should probably be in a VCS, and use some kind of automated push to land on the server anyway! :-)

[1] http://yanpritzker.com/2011/12/16/learn-to-speak-vim-verbs-n...

"A Tour of the Acme Editor", by Russ Cox [2] https://www.youtube.com/watch?v=dP1xVpMPn8M

Re: Vim 8.0 is coming

#362

I've been trying to evaluate the different editors. https://github.com/melling/EditorNotes/blob/master/vim.org To me it feels like the vim key bindings are more efficient for programmers. No one has ever done a scientific comparison, and it always seems to end in a religious war, but we should do a better job of evaluating our tools. Then hopefully, we can improve them.

I recall seeing a study that concluded with mouse/gui-based editing being more efficient, even if users felt more efficient using vim. You might want to look at ACME[1].

For me personally, I can't use the mouse much, or my carpal tunnel comes back quickly. So I need a keyboard-only workflow. And I'm happy with vim.

"A Tour of the Acme Editor" by Russ Cox https://www.youtube.com/watch?v=dP1xVpMPn8M

Re: Vim 8.0 is coming

#363

Dropped the support for MS-DOS. It was too big to fit in memory. This is a little surprising since the latest version of Emacs still supports MS-DOS[1]. If anything, you'd expect Vim to be the smaller and faster choice but it seems this isn't the case anymore... Then again, I don't really understand the culture of all the customisation/plugins/etc. around text editors; part of the reason why I originally chose Vi(m)…

> I don't really understand the culture of all the > customisation/plugins/etc. around text editors

1) small, basic install of (neo)vim for most users 2) totally separate extensions for those who need them without making the core app harder to test

> it's small and simple

Allowing plugins doesn't make the app any more difficult to use. And, of course, one thing some plugins do is make stuff easier than stock vim. IE rather than going:

:e ../../src/java/blah.java you could use one of the many fuzzy searc plugins and do something like: sjablja (ie just typing some of the letters from any part of the path and file name as long as it's in the correct order).

> I don't expect or need much from a text editor in the > first place

It's primarily a programmers editor, replacing for many people any IDE at all, so it's nice to be able to select a word and press a key and have that file open; jump between viewports on multiple files on multiple tabs; have word completion.

None of what I've described is some rare edge case.

One thing I use vim for is to get the results of grepping thousands of source code files, then trimming down the results using "remove lines matching this", "remove lines not matching this", or turning lists of filenames into dos or bash commands. Sure, you can do all this with bash but I don't know all the commands anything like as well as I know how to do this sort of stuff with recordings or regex within vim.

Re: Vim 8.0 is coming

#364

Earlier quoted context omitted.

> "In the workflow I described, all that code is already written, and you can invoke it with a single keystroke." The thing is, if that's the case, what you're describing isn't a custom plugin, it's an existing plugin someone else has taken time to write that you're making use of. If that's the argument you're making then you could say Emacs has a better ecosystem of plugins, and that it's easier to tie them together…

It's a subset, and the Blub paradox applies. For one thing, Org isn't a plugin; it's part of the Emacs distribution, rather than something you have to explicitly install. All you need to do to use all the functionality I described is install Emacs and start it up. For another, Emacs doesn't actually have a plugin system, per se. Instead of the usual headache, where a program written in language A exposes a lossy subs…

> "As I said before, the Blub paradox applies: it's easy to recognize something less powerful than what you're familiar with as such, but something more powerful just looks weird. From the sound of it, Emacs looks very weird to you. It did to me, too, before I started using it. Now I won't willingly use anything else. Perhaps I'm just very weird, too."

Nah, it's nothing to do with the blub paradox. I've dabbled with Emacs before, I could see certain benefits to its flexibility, but was put off by other factors such as the clunky keyboard shortcuts (which is why I'm glad for both ergoemacs and spacemacs, as they have better defaults IMO), reliance on Lisp and a couple of other minor issues. Overall I think it's a great tool, and I can see why its popular.

That said, using the blub paradox implies (whether you intended to or not) that you believe it's more powerful than the competition. The way I see it is that any program is only as good as its existing features. Org mode is a good example of a strong feature for Emacs, but I could point out a number of strong feature for VS too. IntelliTest is a good example:

https://msdn.microsoft.com/en-us/library/dn823749.aspx

IntelliTrace is another:

https://visualstudiomagazine.com/articles/2012/02/07/intelli...

If someone has only ever debugged using print statements or breakpoints then they miss the power of such features, so I could just as easily invoke the blub paradox with reference to VS as well.

The point is there is not one single ultimate tool, they all have strengths and weaknesses. Emacs is not a paradigm shift better than VS, and VS is not a paradigm shift better than Emacs, so the blub paradox does not apply.

Re: Vim 8.0 is coming

#365
post #223

Earlier quoted context omitted.

> Software doesn't need to be developed ad-aeternum to remain 'alive'. Actually it does, as architectures, APIs, etc change, and if the software doesn't catch up, it can get impossible to run it, or it will need BC compatibility layers, to run 5-10-15 years down the line. Not to mention big changes in how we use the software, e.g. the need to handle utf-8, which didn't exist in Bill Joy's time. > It's not dead, it's…

I thought we were talking about nvi. https://en.wikipedia.org/wiki/Nvi

Afaik, nvi actually doesn't have all the features of the original vi. According to Wikipedia, "The aspects of nvi that are still marked preliminary or unimplemented are, for the time being, likely to remain that way." Moreover, nvi had been developed for a little while after the various BSDs stopped syncing with upstream due to licensing issues after version 1.79. I honestly think the reason no one develops it anymore is because no one cares. It's good enough for use in emergencies, and beyond that, it's either good enough for the people who use it, or they just use a more featureful editor.

Re: Vim 8.0 is coming

#366
post #95

Earlier quoted context omitted.

vi is not Vim.

Vim stands for vi improved and started on the Amega in 1991 so almost 25 years old. Certain people still use vi which was an improvement over ed August 1969 (Though I have been known to use ed in scripts from time to time).

If you ever wind up booting the OpenBSD ramdisk kernel (typically used for installation and system rescue), the only editor available is ed. Luckily, if you're reasonably comfortable with vi, you'll find that most of the 'colon commands' work, and the other commands are pretty familiar ('i' for insert, 'a' for append, etc.). If you're an OpenBSD power user, it behooves you to have a hardcopy of the ed manpage handy ;)

Re: Vim 8.0 is coming

#367

Earlier quoted context omitted.

Vim stands for vi improved and started on the Amega in 1991 so almost 25 years old. Certain people still use vi which was an improvement over ed August 1969 (Though I have been known to use ed in scripts from time to time).

Nonetheless he is right. As far as I remember Vim is based on the code of an editor that was similar to vi, and not vi itself.

I believe it was Stevie (a vi clone for the Atari ST).

Re: Vim 8.0 is coming

#368
post #213
post #162

Earlier quoted context omitted.

At my last job, I was doing mostly Java server stuff. I switched between Vim and Eclipse seamlessly, depending on what task I was trying to accomplish. Vim is better at plain text editing, Eclipse is better at navigating convoluted Java hierarchies or debugging Java code. For me, those tools are not exclusive but complementary.

Have you tried Vrapper, or any other Eclipse Vim plugin like viPlugin or Eclim? Or if you use IntelliJ Idea it also has a plugin for Vim

The Vim emulation plugin that ships with Intellij IDEA is absolutely awful. I used it for about 30 minutes, then uninstalled it in frustration. Certain commands just didn't work right, and some didn't work at all. There was also no indication whatsoever of what mode you were in, so you just had to keep track of it in your head. The experience was not pleasant at all. I'd rather have no Vim emulation than poor emulation (same reason I ditched spacemacs after an hour or so).

Re: Vim 8.0 is coming

#369
post #95

Earlier quoted context omitted.

vi is not Vim.

Actually it is. Not only in the sense that Vim is a clone of vi (with added stuff), but more specifically in that in lots of distros the vi command is just vim (with some special flags). Old BSD vi today is, and has been for over a decade or so, dead.

vi works fine on my BSD machine.

Re: Vim 8.0 is coming

#370
post #187

Earlier quoted context omitted.

Vi is a standard not a specific implementation. There was an original Vi, but since it's a standard unix tool, it got cloned by everyone who ever made a unix clone after it was added to BSD. Vim can be invoked to conform to the vi standard, although usually it only gets used that way when a vim user is on an unfamiliar machine.

Interesting view. I've never seen vi as a standard. But it makes sense.

Technically something can't call itself Unix(tm) without vi(1) [0][1]

[0] http://pubs.opengroup.org/onlinepubs/7908799/xcu/vi.html [1] https://en.wikipedia.org/wiki/Single_UNIX_Specification

Post reply on HN