6 ms·
That's why I tend to use visual mode. It sounds like Kakoune is basically visual mode by default, which is cool but not that different. This example was a bit
by DennisP 10y ago
That's why I tend to use visual mode. It sounds like Kakoune is basically visual mode by default, which is cool but not that different.
This example was a bit silly: "dtf will delete to next f, if you then realize that was one f before the one you targeted, you need to undo, go back to your initial position, and try again with d2tf."
There's no need to undo. Just follow up with a dot and you're done. Which pretty much illustrates my other general strategy, which is to edit incrementally without worrying about getting each command perfect.
(Which is not to say I don't find Kakoune intriguing.)
- jxy 10y agoWhich is to say that they don't understand vim, or rather, they don't even grok vi. You can't beat your enemy if you don't understand your enemy. "Go ahead and down vote more, I just wish you guys can learn more of vi, so you can truly deliver something better. So far, these surface scratching alterations only build on irritations of those vi first-timers. Good luck. "By the way, I use acme when I have graphics interface, nothing beats sam's structured regexp editing capability, apart from writing perl scripts. Learn something, guys.
- martanne 10y agoYou can be sure that the Kakoune authors are familiar with vi(m). Having said that, if you like both vi(m) and the structural regular expression support of sam/acme you might be interested in vis which combines the two: https://github.com/martanne/vis https://github.com/martanne/vis
- omtose 10y ago>I just wish you guys can learn more of vi, so you can truly deliver something better. So far, these surface scratching alterations only build on irritations of those vi first-timers Mind expanding on that, or are you just going to whine? It's not like vi is the ultimate tool.
- Roboprog 10y agoThe dot trick is fine, unless you wanted to paste the deleted text somewhere afterward, in which case you need to pick it up in one go. Otherwise, yeah, dot is great. I love using that for repetitive stuff on "tabular" copied entries that I'm not thinking real hard about transforming. (E.g. - 5 lines or so that I'm not cooking up a regex or an perl/awk spell to transmute)
- jxy 10y ago> The dot trick is fine, unless you wanted to paste the > deleted text somewhere afterward, in which case you > need to pick it up in one go. No. "1p.
- Roboprog 10y agoYou got me. I don't know how to parse that ("1p.). My ignorance is showing. Is there a stack of yank buffers??? Does this p-for-put pop the top buffer, back up before the inserted text, then .-do-it-again and put the delete/yank beneath the last one on the stack? I have no idea what the quotation mark actually does. Thanks in advance if you can explain how that works to me.
- haldean 10y agoIf you just replace 'd' with 'y', though, the example is a good one: hitting period would just yank the same thing again. Edit: the yank example is actually way better, because you don't find out that you did something wrong until you go off and paste it somewhere else.
- jxy 10y agoIf you aren't sure where you'll end up with, do, in this case mmffffy`m Why would this be better? Because it works in macros too. In vim, you can record it as you go. In vi(nvi), I write it somewhere in the file, basically after I did it once, I would do Ommffffy`m^[0"wDdd and use @W later. You can of course use vim's visual mode, but in this simple case, there's not much difference.
- tigershark 10y agoSeriously? What is the advantage of using your cognitive capabilities to write Ommffffy`m^[0"wDdd rather than use a sensible IDE with common refactoring capabilities that are also context aware and integrated with the language you are using?
- hxegon 10y agobecause you can just write a mapping or function that does that.
- tigershark 10y agoHow can it be helpful in the real world? If I want some repetitive behaviour (create new class, generate code) I'll use the IDE behaviour customised to my needs and in the most exotic cases I will add a generating template. But I can't ever imagine myself deleting the selection up to the fourth f from the current cursor position. For me this is not a feature, it's a huge bug because you can delete massive amount of text just because your cursor was in the wrong place. The most important behaviour of a code editor is to be context aware and transform your code accordingly to the language rules, not just blindingly execute a series of commands that edit text generated from "random" key strokes.
- menssen 10y agoI never thought of it this way, but visual mode essentially does switch vim from verb-object to object-verb. So in this case... vtfd is one more keystroke, but you see what you're deleting before you delete it, so if you need to the next f, you can just smack semicolon until you get there. vtf;;;;d (semicolon repeats last "t" or "f" movement)