Live data from Hacker News

Neovim's Next Feature Poll

neovim.org

91–100 of 105 posts

Re: Neovim's Next Feature Poll

#91
post #56
post #49

Earlier quoted context omitted.

Macros and global replace are substitutes, sure, but they're not at all the same thing . And while I'm no vim wizard, I have used it as my main editor for 4+ years, and have a 1500 line vimrc and plenty of plugins (including my own), so you don't get to assume I don't grok the vim way of thinking :) I've heard the "macros is the same" sentiment many times, and usually it's from people who have never had much experien…

>In fact, many of the people arguing against multi-cursors have been convinced after trying them that they are better. Fact by who? >The basic problem with macros and global replace is that they don't happen immediately and don't give you feedback. I don't know any vim user who hasn't had the distinct pleasure of needing 3 tries to record a macro before they got it right. True about macros, which are a very powerful…

>Fact by who?

By me. I've talked to people and they've changed their minds. Sorry, should've made that explicit.

>What about recording the rest of the macro and running both of them one after the other?

Because sometimes you only think of it later.

>Also as somebody already pointed out, vim already has plugin(s) for multiple cursor support and they work exactly as they should. I'm not arguing against multiple cursors, I'm just saying that they don't really bring anything new.

As I mentioned to them, I used that plugin, and while it's awesome and I totally love the author for making it, it just isn't as good. See my other comment for details.

And again, I really disagree that they don't bring anything new. That's like saying that WYSIWYG text editors don't bring everything new over systems like Latex. Can you do everything in both systems? Yes. Is it sometimes easier to just select text and hit "ctrl+b"? Yes. Is it always better? No. But it's good to have both options, as sometimes one crushes the other.

Again, I love vim, and I definitely use some of the very methods you've mentioned. But I'm not here to sell you anything, I don't earn anything by convincing you to at least give multiple cursors a shot, except knowing that if you're dismissing them without having tried them then you're missing out and that makes me sad.

Re: Neovim's Next Feature Poll

#92
post #70
post #56

Earlier quoted context omitted.

>In fact, many of the people arguing against multi-cursors have been convinced after trying them that they are better. Fact by who? >The basic problem with macros and global replace is that they don't happen immediately and don't give you feedback. I don't know any vim user who hasn't had the distinct pleasure of needing 3 tries to record a macro before they got it right. True about macros, which are a very powerful…

Just to add to that, you can also use visual block mode to change text on multiple lines. You get a lot of the benefits of multiple cursors that way while still doing things in a more traditional "vim-like" way.

No reason not to do things in a vim-like way with multiple cursors. In fact, they're literally just an extension of the block-mode concept, except that it's just better because it allows you to do a superset of things.

Re: Neovim's Next Feature Poll

#93
post #71
post #49

Earlier quoted context omitted.

Macros and global replace are substitutes, sure, but they're not at all the same thing . And while I'm no vim wizard, I have used it as my main editor for 4+ years, and have a 1500 line vimrc and plenty of plugins (including my own), so you don't get to assume I don't grok the vim way of thinking :) I've heard the "macros is the same" sentiment many times, and usually it's from people who have never had much experien…

> [I] have a 1500 line vimrc and plenty of plugins (including my own), so you don't get to assume I don't grok the vim way of thinking :) This may only show that you grok VimScript way of thinking, not Vim way of thinking. You need not re-record a macro, a macro is stored in a register. Just edit the register, and you're good to go with you new, (supposedly) improved macro. In Vim, you edit in Normal mode, and insert…

"This may only show that you grok VimScript way of thinking, not Vim way of thinking."

True enough that it doesn't prove anything.

"You need not re-record a macro, a macro is stored in a register. Just edit the register, and you're good to go with you new, (supposedly) improved macro."

I know. And if you think this process is easier, faster, or saves keystrokes over using multiple cursors, then I think you're wrong.

"In Vim, you edit in Normal mode, and insert in insert mode. Multiple cursors is a means of moving editing into insert mode, and thus in spite of the Vim way."

No no no! That's the beauty of using multiple cursors in vim. You can have (potentially) multiple cursors in Normal Mode, and use all the normal vim commands. That's what makes it so sad that it doesn't have multiple cursors, because if you can merge the power of multiple cursors with the power of vim, you get something amazing.

Imagine having the following:

some text Some other text Third

Then imagine you want to, for some reason, copy-paste the contents of the different divs into (say) another buffer.

With multiple cursors, you can select the three lines, use the vim commands to yank the text object that's in between the divs (yit), and then paste it elsewhere. This is not possible in Sublime Text, since it has no way of saying "select text between divs". Or even, doesn't have vim's "f" command so one could jump to the "<" character opening the second div.

Re: Neovim's Next Feature Poll

#94
post #84
post #55

Earlier quoted context omitted.

It works, and definitely better than other tries, but it's not even close to Sublime Text's caliber. Through no fault of the author, I assure you, as someone who's tried his hand at creating a similar plugin for vim and found many limitations of vim. One easy limitation comes to mind - you can't copy-paste different cursors, then paste them as unique items. E.g., given a list "a, b, c", I want to be able to multi-cur…

Maybe I'm not understanding the example, but is what you're suggesting (copy/paste) even possible in sublime? The github plugin above is the closest I've seen to sublime's version. It's not perfect, but works for most of the basic use cases.

Yep, possible in Sublime Text. It's one of the harder things to get right, and Sublime also has (or had) weird behavior, but most of the time copying 20 items with 20 cursors and pasting them to 20 cursors works great.

Re: Neovim's Next Feature Poll

#95
post #55

Earlier quoted context omitted.

It works, and definitely better than other tries, but it's not even close to Sublime Text's caliber. Through no fault of the author, I assure you, as someone who's tried his hand at creating a similar plugin for vim and found many limitations of vim. One easy limitation comes to mind - you can't copy-paste different cursors, then paste them as unique items. E.g., given a list "a, b, c", I want to be able to multi-cur…

Do you have any links to a description of how they should work or should I just use Sublime Text to see a canonical example? That doesn't sound hard to implement iff you plan for those features from the beginning. I have my own editor hobby project and during my reading I got convinced multiple cursors are great for the reasons you described in your other comment. I hadn't thought about multi cursor copy/paste so I'm…

You should probably just check out Sublime Text, that's the best (almost only) implementation I've seen.

Re: Neovim's Next Feature Poll

#96
post #54

Earlier quoted context omitted.

Simple (very common example): .some-css-rule { padding-left:50px; padding-right:50px; } Say I want to edit those two numbers. With multi-cursors, it's as simple as select one number, hitting a button that causes the other number to be selected, then writing the new value. Now, after I wrote it, I realize I forgot to put a space after the colon, and want to change the formatting. No problem - I just make the change to…

If you do this kind of editing daily, then executing the following commands would become second nature :s/50/60/g :s/:/: /g No need to touch the mouse or use macros. Many use-cases for multiple cursors are satisfied by the core functionality of vim, however they may not be immediately obvious.

Alright, but in more complicated cases you have to bust out macros, and they're just plain harder since they don't give visual feedback.

Take an example like the following:

def foo(): // do stuff

def bar(): // do stuff

Now I want to change my comment to say:

// The function foo does stuff

With multiple cursors, I select both def's, copy the following word, then go down and change the comment.

Again, I'm not saying this can't be done in vim. But it's just plain easier to do with multiple cursors. And if you don't believe me, well, that's your right of course. But having used both, extensively, I'm telling you - please, at least give it a try. For many daily use cases, it's just so much easier. And I don't get anything out of selling you on multiple cursors except for the warm fuzzy feeling of maybe helping a fellow developer learn something that will help them.

Re: Neovim's Next Feature Poll

#97
post #93
post #71

Earlier quoted context omitted.

> [I] have a 1500 line vimrc and plenty of plugins (including my own), so you don't get to assume I don't grok the vim way of thinking :) This may only show that you grok VimScript way of thinking, not Vim way of thinking. You need not re-record a macro, a macro is stored in a register. Just edit the register, and you're good to go with you new, (supposedly) improved macro. In Vim, you edit in Normal mode, and insert…

"This may only show that you grok VimScript way of thinking, not Vim way of thinking." True enough that it doesn't prove anything. "You need not re-record a macro, a macro is stored in a register. Just edit the register, and you're good to go with you new, (supposedly) improved macro." I know. And if you think this process is easier, faster, or saves keystrokes over using multiple cursors, then I think you're wrong.…

Well, I can copy the divs over, then run ":'s///g". Or, if the divs were aligned nicely, I'd copy the divs except for the opening tags via block selection, then on the result of pasting, I'd run ":'s/.\{6\}$//". The difference with the multiple-cursors way and the Vim way is that, the above regexps can be used, without modification, on ranges of variable amounts of lines, whereas, the multiple-cursor way is not as flexible to get adapted to handle variable amount of lines as far as I can imagine.

Vim poses a way to edit text; Sublime, Emacs and other modeless editors pose another. One enables neat tricks via a very nuanced and powerful editing language, that is Vim verbs, text objects et cetera, and the rest do not provide such mechanism, in favour of simplicity and ease of use (it is easier to start typing in Emacs than Vim, whereas it is easier to do editing in Vim than Emacs, but only for the knowledgeable user).

Do not get me wrong, I am not thinking multiple-cursor-editing is useless; in fact, I use it quite a lot in Emacs[1], and I like how it indeed helps me do my multi-line editing with instant feedback. My argument is that such editing has little to offer to a user that has spent a month-or-so to master Vim.

[1]: https://github.com/magnars/multiple-cursors.el

Re: Neovim's Next Feature Poll

#98
post #95

Earlier quoted context omitted.

Do you have any links to a description of how they should work or should I just use Sublime Text to see a canonical example? That doesn't sound hard to implement iff you plan for those features from the beginning. I have my own editor hobby project and during my reading I got convinced multiple cursors are great for the reasons you described in your other comment. I hadn't thought about multi cursor copy/paste so I'm…

You should probably just check out Sublime Text, that's the best (almost only) implementation I've seen.

Someone posted a demo video of a modal text editor with multiple cursors to HN a year or so ago and I've been trying to track it down. Any idea what that might have been?

Re: Neovim's Next Feature Poll

#99
post #51
post #9

"Sublime minimap" and "better autocomplete" are features that use an underlying API. I'd prefer if they could be renamed to "Fetaure X which enables e.g. sublime minimap" and dito for autocomplete.

Thanks for the feedback. I created the poll so I'll be sure that when we create the Bounty we are clear in that the underlying API is what we are looking to improve.

I don't follow - it is /not/ clear to me which underlying API it is that will get implemented by voting for "sublime-style mini-map".

Re: Neovim's Next Feature Poll

#100
post #49

Earlier quoted context omitted.

Vim doesn't need multiple cursor support. Train yourself to think in Vim—you're editing text and words, not moving a cursor. Macros and global replace already do what you want.

Macros and global replace are substitutes, sure, but they're not at all the same thing . And while I'm no vim wizard, I have used it as my main editor for 4+ years, and have a 1500 line vimrc and plenty of plugins (including my own), so you don't get to assume I don't grok the vim way of thinking :) I've heard the "macros is the same" sentiment many times, and usually it's from people who have never had much experien…

> What's more, if I record a macro and run it, then realize after it that I want to do a small addition, I have to go through all the "setup" steps again - go back to the start, re-record, add the logical of finding the next block, and so on. I can't just visually see the situation and say "oh yeah, why don't I add this little tweak".

this is very doable, lets say you record a macro to 'a'

    1. q:
    2. let @a='
    3. ^r^ra to put in the current contents of the macro
    4. edit as you see fit

    --- you should now have something like ---
    let @a='contents of macro'
    
    5. ???
    6. profit
Post reply on HN