Re:Why Kakoune – The quest for a better code editor
by omtose on Tuesday December 13, 2016 @09:31AM
(#13166990)
>How would that work if the motion comes first? Would I go "wwwwd"? Would that delete one word, or four?
'w' will move the current selection to the next word so only one word. To extend the selection you need to press 'W' so "wWWWd" will delete four words. For most motions (if not all), the uppercase variant will extend the current selection.
This also makes searching slightly different:
/ search forwards
? extend selection forward
<a-/> search backwards
<a-?> extend selection backwards
Re:Why Kakoune – The quest for a better code editor
by OskarS on Tuesday December 13, 2016 @10:09AM
(#13167297)
Can you add counts to motions/objects? I.e. does "3w" select three words you can act on, or do you have to go "wWW"?
Re:Why Kakoune – The quest for a better code editor
by huac on Tuesday December 13, 2016 @10:13AM
(#13167323)
3w works
Re:Why Kakoune – The quest for a better code editor
by Phlogistique on Tuesday December 13, 2016 @12:52PM
(#13168811)
as well as 3W, for a different purpose
Re:Why Kakoune – The quest for a better code editor
by sullyj3 on Wednesday December 14, 2016 @02:44AM
(#13174478)
w irritates me, because it always traverses a bunch of miscellaneous symbols, and my brain can't parse fast enough to easily tell in advance how many times I'll have to press w in order to get where I want. Extremely minor, but extremely niggly annoyance. I've found myself using https://github.com/justinmk/vim-sneak more and more often.
Re:Why Kakoune – The quest for a better code editor
by flukus on Wednesday December 14, 2016 @05:56AM
(#13175106)
You might also like quick-scope:
Re:Why Kakoune – The quest for a better code editor
by flukus on Wednesday December 14, 2016 @06:05AM
(#13175138)
> How would that work if the motion comes first? Would I go "wwwwd"? Would that delete one word, or four? Would you use a different key for the motion and the text object?
I think you've hit the nail on the head here. c3w in vim is 3Wc in kakoune, 3wc will change the third word, straight off the bat there's a lot more shift key hitting. The most annoying thing though is getting the motion wrong, if 3W turns out to not be the motion I want, hitting escape does not return the cursor to where it was before the motion.
Let say I want to delete a word from somewhere in the middle of a line. I would then navigate to the line in question, then press something like "^wwwdw" (i.e. "move to the beginning of the line, move 3 words forwards, delete word"). The motion of the deletion is the same as the motion for navigation. How would that work if the motion comes first? Would I go "wwwwd"? Would that delete one word, or four? Would you use a different key for the motion and the text object?
I don't think this is a bad idea, swapping the order. The thing about showing you what's about to happen is a great point (though Visual mode in vim works pretty well for this purpose). I'm just wondering if it's better in practice. I'm certainly willing to give it a shot.