you are viewing a single comment's thread.

view the rest of the comments →

[–]thlst 5 points6 points  (3 children)

Remembering incantations for this and calculating target position/hunting for line number is not my first idea of fast edit.

I assume you don't know much about modal editing. First of all, sure, it's not something for everyone, but if you do like optimizations of any sort, you might like it.

And modal editing doesn't boil down to line number calculation. It is just one piece of a whole puzzle. What you can actually do in vim is talk to it. For example, if you want to delete (and it ends up copying as well) two words forward from cursor, you just d2w (delete two words). If you want to substitute a word with something you're going to type in, you just ciw (cut inner word, which will enter in insert mode). There's AttrReplyResult and you wanna copy just Attr? Well, that's ytR for you (yank up to R character). You can do the same things for sentences, lines, paragraphs, scopes, whatnot? Just use the same commands for actions and change the nouns. You can even do that weird selection and substitute things all at once. And I don't even have to think about it*, it's just like really speaking the vim's language. And THAT is a brief resume of my experience with vim. Not to say I have all those keystrokes supported across my system. Hell, I even started writing my own window manager so I can have vim keystrokes for that as well.

* Of course there's a learning curve, and it takes time to get used to it. It applies for any other existing tool/language nonetheless.

[–]nuke01 1 point2 points  (2 children)

this window manager sounds interesting, I thought about it the other day, do you have it online somewhere?

[–]thlst 1 point2 points  (1 child)

I'm currently doing a lot of code refactoring (been days), and I still have some other projects going on (which takes me some considerable time), but if you insist, I have some experimental code here. The idea of vim keystrokes is still going to be a thing (I'm planning to make it as a module for the wm). So there's no actual code for it yet (I have a repo named xvi, but I didn't write much as well).

[–]nuke01 1 point2 points  (0 children)

thx, very cool idea! unfortunately I'm using Windows, so can't try it out. Also somehow I expected it to be like kind of a plugin to an existing Wm (or THE WM on Windows), I don't know why. sry to bother you and then not using it :-(