3 ms·
I've been using Kakoune as a daily driver for about 2 years now. It's an order of magnitude better than anything else I've tried (vim, neovim, vscode, atom, jet
by r3trohack3r 3y ago
I've been using Kakoune as a daily driver for about 2 years now. It's an order of magnitude better than anything else I've tried (vim, neovim, vscode, atom, jetbrains, codeblocks, notepad++, etc).
Especially once you:
* enable LSP support
* memorize the keybinding
* get comfortable with the kakoune scripting language
The keybindings were a lot easier to memorize than VIM's because of how consistent they are. And they're a lot easier to "experiment" with when your memory is fuzzy because you get realtime visual feedback on what your key combinations are building up in memory before it executes.
It's fast, unbelievably fast - faster than I type no matter what I'm doing. I never wait for anything unless I'm shelling out to some "modern" build/lint/style tool with a script.
It works out of the box with tiled window managers (:new opens a new terminal, `kak -c lets you open a new window into an existing editor session, etc.).
I can seamlessly move between the system clipboard and buffers using `xclip`, which is the same pattern that lets me seamlessly move between _any unix tool_ and a buffer. I can type `!tree` and get the directory listing for a README.
I can `%s [][]bytes<ret>di[]Image` to replace all arrays of images with an explicit type. With LSP support, I can highlight all _references_ the the currently highlighted variable/object/w.e., then select the entire line each one is on and delete it in like 4 keystrokes.
It gives realtime feedback as I type commands so I can see what I'm selecting in a buffer.
Autocomplete is aware of everything from LSP and _every open buffer_, so you can open buffers full of context you'd like autocomplete to have access to even if LSP isn't able to infer it.
I can wire up custom commands for each file type using the scripting language in minutes, not hours, to do things like automatically run the language's auto formatter.
With LSP enabled, I can `gd` on any variable/object/function/w.e. and _immediately_ find myself looking at where it was defined. Even if that definition is the go standard library, Node core, some dependency down inside my node_modules or vendor directory, w.e.
With LSP enabled, I get the entire MDN library fact-checking my method signatures and helping me with autocomplete _in realtime_ as I type.
Some tips for people wanting to use kakoune:
Add this bash script to your PATH as `k`, it lets you open a new window into the current editing session from any terminal - so you can `cd` around the filesystem to look for files of interest and then open them in another terminal's editing session top copy stuff over and make autocomplete aware of its contents: https://gist.github.com/retrohacker/8920d056f4938e8dd263adac5467202d https://gist.github.com/retrohacker/8920d056f4938e8dd263adac...
Take the contents of `:doc` and put it all into something like Anki (or just make flash cards for yourself). Learning the keybindings by heart is a small investment that will pay massive dividends.
Integrate LSP and take a moment to learn the different commands. I can't stress this enough.
Wait until about 6 months in to bother trying to learn the scripting language. The scripting language is pretty much what you've been using the entire time, you just write it down in a config file instead of typing it into a live session. The scripting language docs don't make any sense unless you already know kakoune, it's much easier to understand once you have a better feel for how kakoune works.
Once you learn the scripting language and have a good feeling for the default keystrokes, you can start mapping a bunch of your common workflows (`!` and `:` commands, buffers, etc) to unused keys, or keys you have no use for.
Here is my kakrc for reference, but keep in mind I change this fairly often as my workflows change across code bases:
https://gist.github.com/retrohacker/cfc72d59dbcb14adb5009a264d0e4cf7 https://gist.github.com/retrohacker/cfc72d59dbcb14adb5009a26...
I think the hex to HSLA is a pretty good example of what's possible with kakoune. I whipped that up in maybe 10 minutes with a go binary on my path and that hook. I'm in a code base where I was constantly converting from a color design guide defined in HEX to the code base's standard of hsla. Now I just copy into the editor and it auto-fixes it.