5 ms·
I tried kakoune on the basis of a blog post I found here a while back, that described its better-thought out Vim-like command language. I was hooked almost imme
by andrewflnr 5y ago
I tried kakoune on the basis of a blog post I found here a while back, that described its better-thought out Vim-like command language. I was hooked almost immediately. Now I use it daily. So if you like Vi/Vim's text editing model but wish its language was more orthogonal and powerful, give Kakoune a shot.
- JohnCurran 5y agoWhat did you find easier/more powerful about Kakoune than its equivalent in vim?
- jzm2k 5y agoThe multiline cursor is a great tool I didn't know I needed before I tried Kakoune. Also, the commands are more logical. Go to end of line with gl, select code from current place until the end of line with GL, go to the start of line with gh, go to the end of file with gj and to the top with gk, etc. It's more logical and the fact that you can use visual select by keeping shift down when moving is very nice.
- pletnes 5y agoWhat’s the big deal with multiline cursor over visual block mode?
- jzm2k 5y agoI think multicursor is more flexible. I can visually select N lines and use regex to place the cursors and then modify the text in multiple places simultaneously. Kakoune also provides a multicursor similar to the visual block mode that Vim offers but I find myself using that only in very specific situations like "these 5 lines should all start with this keyword" or whatever.
- usrbinbash 5y agoimo, Multiline cursors are one of these features that look and feel cool, but are rarely, if ever, really useful.
- christophilus 5y agoI use it daily and find it immensely useful.
- jzm2k 5y agoThat's also what I thought as a Vim user before I had access to Kakoune's multiline editing. It changed my mind and might change yours too if you give it a chance
- doppioandante 5y agoDitto. I rarely use multiple cursors in other editors, but I use them _constantly_ in Kakoune. I have been using it for multiple years. The composability of the command language is what makes it shine.
- usrbinbash 5y agoI used editors with multiline editing capabilities in the past. There are only 2 usecases where it was of any value to me: If I have to write multiple lines in a similar fashion, or if I have to edit the same thing in a similar fashion in several places at once. Both can be done much easier by using a regular expression.
- jzm2k 5y agoI disagree. In the past I've used regex to do that and now that I have access to a multicursor, I won't be going back. I think with regex you don't get the same kind of visual feedback that you get from a multicursor which is why I (and many other Kakoune users as well) like it so much. If you're happier with regex and feel like you don't need multicursor, that's great.
- smegsicle 5y agomovement before command sounds nice, eg 'wd' to delete a word instead of 'dw'
- konart 5y agoI find it extremely subjective. "delete word" is much better than "word delete" imo. Also `dw` sounds more logical if you think about user input speed\pauses. If I press `w` I want to move to the next word immediately. In case were `wd` deletes a word - there should be some lag, no?
- grayrest 5y agoDoing the motion first lets you visually confirm the range before invoking the command. You also have the opportunity to adjust the range if you didn't get it quite right. Mnemonically the vim order works better for English but in practice I find the visual feedback from selection better for anything even moderately complex. An example would b `f` or `t` since I tend to hit the letter I was aiming for earlier than I was expecting. > In case were `wd` deletes a word - there should be some lag, no? There's no animation or forced latency. For a short motion that's predictable like `w`, you're typing the d before you actually check the result and it's just as fast as vim but in the opposite order.
- mikojan 5y agoI have never felt the need to visually confirm something as obvious as "delete 1 word". On the other hand, you cannot do something like "delete 3 words" in kakoune. "3wd" just takes you to the third word and deletes that. Deleting 3 words is definitely slower. And it's kind of infuriating... What am I doing wrong?
- mananaysiempre 5y agoLowercase w resets (each) selection to end of selection, skips any whitespace, and selects to next word boundary, so www or 3w will select third word counting from cursor. Uppercase W extends selection over any whitespace and then to next word boundary, so WWW or 3W will select from cursor to third end of word. (Most other movements are also in lowercase resetting / uppercase extending pairs.) Thus with length-1 (that is, initial-state) selection you can do wwwd or 3wd to delete third word and preserve whitespace, wWWd or w2Wd to delete three words but preserve whitespace, WWWd or 3Wd to delete three words and any whitespace between cursor and start of first word. That is, counts work, it’s the movements that are slightly different. See manual §3.4–6[1]. [1]: https://github.com/mawww/kakoune#34-movement https://github.com/mawww/kakoune#34-movement
- thristian 5y agoI started using Kakoune a few of years ago, after a decade+ of Vim, and while the improved command language is nice, the parts of Kakoune I love are: - dedication to quick feedback - scriptability and plugins By "quick feedback" I mean things like multiple selection support, so you can tweak and polish a complex search-and-replace and inspect each step of the process as it happens, instead of writing a complex regex, undoing, and starting again from scratch. I also mean things like pervasive completion and tool-tips. When I type `:set` I don't just get tab-completion of option names, I get a browsable list of option names and a tooltip describing the syntax of the `:set` command. And once I pick an option, that option's docstring is added to the tooltip so I can see what values the option expects. By "scriptability and plugins" I mean there's no special directory structure to make a plugin - just take the commands you'd type in the editor, stick them in a `.kak` file in `~/.config/kak/autoload` and you've got a plugin you can share with your friends. If you have a complex editing operation you want to script, you don't need to learn a whole different "long-form" syntax for each command, you can just say `execute-keys` and write out the keys you would press to do the thing. There's more ceremony and polish you can add if you want (like all the fancy completion built-in commands have) but the effort required to automate my tasks is damn near zero.