5 ms·
Why Kakoune – The quest for a better code editor
- icholy 8y agoI really like Kakoune and its ideas. But I've invested too much into vim to switch at this point :(
- kungtotte 8y agoThis is exactly my position too. I really like the concept of kakoune, but vim is everywhere. I can install keybinds for it in any editor on the planet, there's at least a vi on any system I happen across, things like qutebrowser ships with vim bindings by default, etc. etc.
- caymanjim 8y agoVim really isn't everywhere, though, in any meaningful sense. I see this claim frequently, but if you're a Vim power user, using it as your primary IDE, the stock configuration is unusable. A fully-customized Vim setup bears very little resemblance to a vanilla/default Vim setup, and the default can't be used for anything more than quick, tiny changes. Also, how often do you use a brand-new clean system without any extra software installed? You might regularly do this if you're a sysadmin/devops person, but in that case, you ought to be using Ansible or something to bootstrap the machine to a robust state, and that would include customizing Vim if you rely on it heavily. The "quick edit to system config files" use case for Vim is also not the same as the "software development environment" use case. You can get by with unconfigured Vim in this scenario, but it doesn't obviate the need for a complete configuration if you plan to do intense editing later. The fallacy that "Vim is everywhere" is perpetuated by people who don't use Vim for software development.
- pasabagi 8y agoI don't know. I think the stock vim is pretty good, and loads of power users tend more towards the 'no plugins' than the 'all the plugins' end of the spectrum. I started with a much bigger load of plugins than I use now, and I don't think I'm unusual in that. The stock settings and workflows, once you understand them, are usually better. The only exception is really for frills - like, a plugin that helps with composing regexes, or language-specific IDE stuff, or a pretty documentation browser. Not to mention, it's really very quick to get all your normal plugins set up. I have a git repo that I just clone.
- marmaduke 8y agoThis is a solid point. I used Vim for years but kept a whole repo of configuration; setup from scratch took a long time. Eventually I found myself not adding key bindings because $random_server wasn’t gonna have those.
- wodenokoto 8y agoI have yet to "invest" in a terminal editor, so but I feel like it is impossible to choose. They all have a steep learning curve and it seems like you need to climb pretty far up that curve before you can even judge if it is worth it to begin with.
- jgtrosh 8y agoIt is worth it, though not necessarily for improving the things you care about now.
- jacknews 8y agoExactly, I really like the ideas, it seems to be 'vim, done rationally', but the vim muscle memory is just too ingrained, and I have quite a few custom keys bound for things like kicking off a test run, adding 'focus' flags to a current test etc, and then multi windows/panes, and plugins like nerd-tree, git tools like fugitive, gitgutter, etc, etc Playing with it for a while did prompt me to look into and adopt vim visual mode, which I've never really used (was it even present if vi on ttys?). It's a step closer to the more rational (to me) 'selection, action' ordering.
- xashor 8y agoMost key strokes in vim have roughly the same meaning in kakoune. My switch to kak two years ago was quite easy, maybe a week or two until I felt as comfortable – even though I used vim for nearly a decade. So I really recommend to at least try it, if you want to.
- tincholio 8y agoI've just played a bit with it, and it looks really good. What would rock is an Evil-like implementation on top of Emacs...
- TeMPOraL 8y agoI recall someone in /r/Emacs pointing out that Emacs keybindings already implement Kakoune's "object then verb" philosophy. For instance, to delete text from current position until next occurrence of a letter z, you'd do C-SPC C-s z RET C-w [0]. C-SPC C-s z RET is the object part (C-SPC - start selection (but see [0]), C-s - start incremental search, z - find next z, RET - confirm you found what you were looking for). C-w is the verb part - cut region. If you want to cut until the n-th occurrence of z, just press C-s a few times after entering z. -- [0] - C-s z RET C-w, if you're not using transient-mark-mode, aka. a visually marked, explicit selection common to most editors. With transient-mark-mode disabled, there is always a region between mark and point, and after accepting a search with RET, C-s drops a mark at the place you were when you started the search. transient-mark-mode is active by default (probably to reduce learning curve); working without it is weird at first, but also rewarding in terms of efficiency.
- xrd 8y agoThank you for this!
- nasredin 8y agoNot for Windows. "Modal editor · Faster as in less keystrokes · Multiple selections · Orthogonal design" I love it when software developers assume everybody else knows what their software runs on. SMH.
- kurtisc 8y agoThe readme says it works on Cygwin.
- metta2uall 8y agoand I bet it would also work in WSL
- vultour 8y agoThe examples are obviously in a terminal so you should expect it to not work on Windows.
- kungtotte 8y agoThere are lots of screenshots of vim running in a terminal and yet it works fine on Windows.
- adrusi 8y agoI think the maintainer runs it on Windows using cygwin on a daily basis.
- bsg75 8y agoI love it when users believe the author of a FOSS package is obligated to support their operating system natively, and that Cygwin is not good enough.
- SeriousM 8y agoI can't find any information about the keyboard issues vim has with eg. German layout. Does this editor suffers the same problems?
- xashor 8y agoAs kak has roughly the same key bindings as vim, if you found vim unbearable, you'll have problems with kak, too. However, I'm not sure what issues you think of, I've used vim/kak with a qwertz layout without problems. Just re-assign äöü.
- fu86 8y agoI use the us-intl keyboard layout with an us keyboard, which works great for English and German text without switching layouts (I am German).
- dghf 8y ago> Because of the verb followed by object grammar, vi changes are made in the dark, we dont see their effect until the whole editing sentence is finished. dtf will delete to next f, if you then realize that was one f before the one you targeted, you need to undo, go back to your initial position, and try again with d2tf. Or just do . (full stop/period), which will repeat the last command, and in this case delete to the f you want.
- Lio 8y agoAlso, if you want to see what you’re working with before you make a change in vim you can always use visual mode. So the example given, dtf would become vtfd. That’s one extra key stroke but realistically if you can touch type you won’t notice. You can expand that selection with ; for the next t. Personally I’d use dtf and then just use undo if its not what I want. I’d also use dot repeat command, gcf or a visual column to act on multiple selections.
- FreeFull 8y agoUnfortunately, visual mode still only gives you a single selection.
- Lio 8y agoTrue. An alternative if you want to see all your selections highlighted would be to turn search highlighting using set incseach and hlsearch. Use / to first select what you want to change. Then use cgn to make a change and . to repeat it. n will skip a change. This still might not be exactly what you want and that’s fine. It’s always good to try new ideas and new software but for me vim gives me plenty of options already.
- exDM69 8y agoRepeat will only fix this particular case. If you did "dtf" and wanted "dff", repetition won't help. Kakoune is kinda like vim in visual mode (or block visual) with multiple cursors.
- ksec 8y agoOff Topic: None of the Video works on the site works in Safari as they are all webm.
- pedalpete 8y agoI don't think it's a webm thing, they're broken for me in Chrome and FF as well.
- nmca 8y agoAll the biggest gains I've seen in editors are, in order of importance, inline doc lookups, easy local file search with file-customisable ignores, quick file opening with fuzzy search and Emmet abbreviations. Does anyone know how Kakoune does in terms of these features? They're all much more important to me than say, syntax highlighting, which I find neither here nor there.
- adrusi 8y agoKakoune doesn't come with any of these built in, however kak-lsp [1], the language server protocol client implementation, is fairly mature, and I wouldn't be surprised if it supported inline doc lookups. Certainly kakoune provides the facilities needed to implement that. Cross-file grepping, and fancy fuzzy finders are considered beyond the scope of the editor, but the wiki has some tips for integrating a separate fuzzy finder program into kakoune [2]. Emmet would be super easy to implement but it just hasn't been yet to my knowledge. [1] https://github.com/ul/kak-lsp https://github.com/ul/kak-lsp [2] https://github.com/mawww/kakoune/wiki/Fuzzy-finder https://github.com/mawww/kakoune/wiki/Fuzzy-finder
- cosmojg 8y agoI'm so excited about Kakoune! I hope it manages to achieve critical mass along with a booming plug-in ecosystem. As it is, things are pretty lonely.
- jchw 8y agoI tried this editor a while ago and immediately was able to understand their model for modal editing. Once you've gotten it, it's hard to not wish vim worked this way. The problem is, vim is everywhere, and Kakoune isn't. :(
- petepete 8y agoThis is also my problem. Additionally I couldn't work out how to create language-specific rules in the config (tab width, spaces, indenting etc). I want to switch but need to make the process a bit smoother.
- dwaltrip 8y agoI make heavy use of the "visual select, [adjust selection], then do verb" pattern in vim, for the exact reasons that this blog posts describes. It sounds like I should try Kakoune...
- gmueckl 8y agoEvery time I see a new text editor announced for programming, I find that is just a rehash pf unstructured text editing functionality. Programming languages are heavily structured, and code transformations between text and syntax tree forms have been implememted numerous times. So why the focus on editing plain text instead of trying to create an editor that actually transforms the syntax tree directly? I don't know what the UI would look like, but an editor that is based on refactoring operations instead of direct text manipulation might end up being a very powerful tool.
- dangom 8y agoFor some languages what you suggest already exists. Check out, for example, parinfer [1] for Lisp and relatives. https://shaunlebron.github.io/parinfer/ https://shaunlebron.github.io/parinfer/
- mlevental 8y agohttps://news.ycombinator.com/item?id=13773813 https://news.ycombinator.com/item?id=13773813
- Rusky 8y agoStructural editors are great, and normal text-based programming editors should probably support the same kinds of transforms, both precisely and fuzzily. But a typical editing session will go through a lot of "invalid" states by design. Trying to enforce that structure is preserved at all times is a hindrance in many scenarios. And further, if you bake structure into your editor in that way, it's much harder for anyone to invent new structures. Having good tools for unstructured text editing is valuable as, if nothing else, a fallback for when your structured editor doesn't understand the language you're editing.
- gmueckl 8y agoInvalid states should only need exist in terms of virtual placeholders for elements required by the grammar, but not filled in by the user. I have a (unsupported) suspicion that directly editing a syntax tree when gaps in its structure ate allowed is no more cumbersome than editing the textual representation. My understanding is that tools like Eclipse and Resharper work on pretty similar models internally to prevent complete failure to understand a code file while it is being mangled by the user.
- xrd 8y agoIs there anything here for emacs users? ;) This is really an interesting thread.
- zan 8y agoI love the ASCII arty Clippy for tool tips!