Live data from Hacker News

Kakoune Code Editor

kakoune.org

21–30 of 176 posts

Re: Kakoune Code Editor

#21

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.

I 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.

Re: Kakoune Code Editor

#22

Does anyone use this daily? this gets posted a few times a year to HN but tbh it looks like someone just re-invented vi. Which seems kindof like creating a new religion. It can be done, but even the best televangelist isn't going to hold a candle to the spread of the catholic church.

I've been using Kakoune as my daily driver for almost a year. The thing that made me fall in love was the simplicity, both in daily usage and in extensibility.

The biggest "oh wow" moment for me was how easy it was to create a color scheme. In Vim, creating your own color scheme is potentially a huge ordeal, with many edge cases. For example, vim-one's color scheme file is over 800 lines long.

By contrast, I created a fully functional Kakoune color scheme in only 84 lines, 60 lines if I remove extraneous spacing and comments. There is no conditional logic, no legacy support, just one set of standard "faces" that work everywhere. All languages use the same standard set of faces to do their syntax highlighting. The difference that makes is astounding.

This is but one example of Kakoune's orthogonality and simplicity of design. Coming from Vim, which is chock full of legacy code and an inconsistent mess of configuration, it's a breath of fresh air.

Re: Kakoune Code Editor

#23
Hmm, how would you replicate the alignment operation they show in the gif using vim? I couldn't immediately think of how to do it.

I guess you could select the block, then maybe s/\>\s\That doesn't feel like the right solution though... maybe a macro, something like qa^wiq then visual select and :norm@a? I dunno.

Re: Kakoune Code Editor

#24

Earlier quoted context omitted.

What did you find easier/more powerful about Kakoune than its equivalent in vim?

movement before command sounds nice, eg 'wd' to delete a word instead of 'dw'

I 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?

Re: Kakoune Code Editor

#25
post #16

Earlier quoted context omitted.

What did you find easier/more powerful about Kakoune than its equivalent in vim?

The 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.

What’s the big deal with multiline cursor over visual block mode?

Re: Kakoune Code Editor

#26

Does anyone use this daily? this gets posted a few times a year to HN but tbh it looks like someone just re-invented vi. Which seems kindof like creating a new religion. It can be done, but even the best televangelist isn't going to hold a candle to the spread of the catholic church.

I tried to use it enough to see if I could switch to it from (neo)vim. I liked a lot of the ideas in it, and in some ways I liked it more than vim, but it was missing some functionality that I just couldn't live without. Some things could be solved by plugins that just didn't exist yet, but others, I couldn't even see a way a plugin could be implemented. In particular, there isn't any way to get a diff mode comparable to vim's.

I also don't like that it always unconditionally writes a newline at the end of files. I understand the reasoning for it, but it makes it much more difficult to use as an editor for transformed binary files (gzip, hex editor, encrypted files, etc.) or avoid adding extra whitespace to git diffs when I modify files.

Re: Kakoune Code Editor

#28
post #6
post #5

Anyone knows where the name came from?

Japanese for "let's write". (書こうね)

> Japanese for "let's write". (書こうね)

So it's pronounced like kah-kooh-neh or similar.

Three syllables, drag out the middle "oh" sound a bit longer.

Re: Kakoune Code Editor

#29
post #24

Earlier quoted context omitted.

movement before command sounds nice, eg 'wd' to delete a word instead of 'dw'

I 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?

Doing 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.

Post reply on HN