
Kakoune – An experiment for a better code editor - Somasis
http://kakoune.org/
======
Direct
I tried switching to this editor permanently from vim. The selection based
movements are asurdly good, I could kill for something like this in vim.

However I couldn't stick with it for two reasons. The first is when I went to
figure out how to customise it, I found that the customisation is essentially
vim like but weaker. Everything is hardcoded like it would be in vim but with
less options. If you're used to Emacs insane customization, this is the other
end of the spectrum. The stuff that IS customisable works by executing
embedded bash scripts[1]!? You can only embed these in specific hooks and
places, so it's really limited, and platform specific. Install this on a
system missing a bash feature someone is using and who knows how it'll behave.

Basically, the features implemented are gorgeous, but past that I can't stick
with it. Just going to consider trying to port the selection based movements
to a vim plugin but I think it'll be a challenge.

1:
[https://github.com/mawww/kakoune/blob/master/rc/clang.kak](https://github.com/mawww/kakoune/blob/master/rc/clang.kak)

~~~
mawww
Hello,

Glad to hear you liked the interaction model, may I ask you what kind of
options were missing for you ?

The extension model is, I agree, unorthodox, but I think it does work
reasonably well (the file you linked manage to provide asynchrounous clang
completion and syntastic like diagnostics using it), and keeps things simple.
Note that we try really hard only to depends on POSIX tools, so the scripts
are actually targeting POSIX shell.

The rational behind this extension model can be found there:
[https://github.com/mawww/kakoune/blob/master/doc/design.asci...](https://github.com/mawww/kakoune/blob/master/doc/design.asciidoc)

And a more in depth explanation on how to use it is there:
[https://github.com/mawww/kakoune/blob/master/doc/interfacing...](https://github.com/mawww/kakoune/blob/master/doc/interfacing.asciidoc)

~~~
Direct
Honestly it's been a little while, I can't remember. However this is more or
less why I went back to vim. Your other comment in particular:

> We do not have options for everything, but I'll gladly add more options if
> there is a reasonable use case for them. In other words, options only get
> added if someone requests them (and makes a good case for them).

I don't really want to switch to an editor where missing options might have to
be justified. I'm not knocking your work, it's really good, and my complaint
applies to vim as well. But if I can't implement something myself as an add-on
(which I definitely have more power to do in vim) and have to wait for it to
be patched and released in your release cycle I'd rather just try and
implement your features in vim and keep the customisability.

Having said that I could be wrong and maybe the plugin system is more powerful
than I thought. But as an example, I have a 5 line function letting me have
ctrl-p like functionality backed by fzf in vim. I can't figure out how I would
do that in kakoune at all.

~~~
mawww
Thanks a lot for you reply, I try to be reactive to feature requests,
especially easy ones like making something configurable through an option (I
expect most of these to be resolved in a day or so).

Some people are using kakoune with fzf, using tmux to open a split, which is
very simple to implement with fzf-tmux. Interacting with Kakoune interface
ought to be possible but possibly more tricky.

~~~
Direct
Yeah, I can't see how I would do it. I could open a tmux pane with fzf and run
another kak window but that's not really the goal. I'd like to use fzf to open
a found file in the current kak window. The plugin architecture just really
limits this kind of thing, and this fzf example was just a simple one I wanted
to use to demonstrate the point.

But again, the stuff you have in this editor is absolutely fantastic, really,
I can't say that enough. I just personally find kak less flexible than an
already inflexible vim so I couldn't stay with it.

If you have a way to do the fzf example though I'd be curious to see how you
do it.

~~~
mawww
Thanks a lot for you feedback, if you use tmux, interacting with fzf is easy
as you can run fzf-tmux, that will open a tmux pan for fzf to run in.

There is an example script for that in
[https://github.com/mawww/kakoune/issues/383](https://github.com/mawww/kakoune/issues/383)

Its more tricky if you do not use tmux, as due to Kakoune client/server
nature, fzf will be launched by the server, which might not even have a
terminal. That said I really enjoy fuzzy matching, and most built-in
completions do fuzzy matching already.

Thanks again for giving feedback on your experience with Kakoune, always much
appreciated !

------
pkkp
You'll want to take a look at your site's theme on mobile devices. On my
iPhone 6 on iOS 9 (Safari), the navigation bar is fixed at the top half of the
pane and takes up over half the screen.

~~~
voltagex_
It looks like the site's built with GitHub Pages so you could raise an issue
for it:
[https://github.com/mawww/kakoune/issues](https://github.com/mawww/kakoune/issues)

~~~
mintplant
Why downvote this? The submitter here isn't necessarily the author, so the
author is more likely to see this if someone submits an issue for it.

~~~
vinceguidry
A lot of downvotes happen by accident, as on mobile it's easy to fat-finger
the down arrow. No need to comment, typically people will notice the mistake
and correct it with upvotes.

If the mods read this, I'd like to put in a suggestion to, on mobile, add CSS
that places the down arrow on the right side of the screen, nowhere near the
up arrow on the left, and make the icons bigger so you can tap them without
having to zoom in. Or if that looks cluttered, make the icons as big as they
normally are, but make the clickable space larger using padding rules. This is
the biggest UX problem HN has, in my opinion.

------
chc4
I've played with Kakoune a little bit not that long ago. It's actually pretty
nice. By far the best feature is the popup that lists all the sub-actions for
chords: imagine if, when you press "g" in Vim, it lists all keys you press
after AND what they do. It makes it very easy to figure out new behavior. The
idea of working on selections is also very intuitive and works well, both in
vim compatability and ease of use.

The biggest issue I had with it, that made me return to Vim instead of try and
keep with Kakoune, are the lack of options. A lot of the settings appear to be
hardcoded, with no way to set them even with : commands. While it does have
scripting support, and a lot of the core application is implemented with it,
there doesn't seem to be any docs on how it works or any community behind it.

~~~
drewm1980
well intentioned nit-pick: vim commands starting with a g are NOT chords, and
that's very important from am usability standpoint. For the most part vim
avoids chords, while E-macs embraces them. It's a question of whether you want
to strain your hands (chords/emacs) or your brain (modal/vim) for triggering
infrequent commands.

~~~
314
I would like to see an option for both in a text-editor - they are not as far
apart as people assume. In emacs there are not enough chorded options for
everything so after a while they switched to dead-key like operations. That is
basically a modal interface where you have to keep the mode key depressed.

My dream editor would feature: * Three modes: insert, quick commands, a
searchable palette for everything. * Configurable switch between modal/non-
modal use of the command key. * On screen display for quick command mode (e.g.
a partially translucent display of the keyboard when command mode is entered
with icons to show what each key does).

The memorability issue for key-strokes doesn't really exist in a modern
desktop environment. It is a relic of terminals with low bandwidth and poor
support for multiplexing information. In a windowed / eye-candied environment
the memorability of shortcuts should be a non-issue and discoverability of the
command-set should be improved.

At this point I have to accept that I've said way too much in response to your
nitpick and I will stop typing now :)

~~~
syl20bnr
> * Configurable switch between modal/non-modal use of the command key.

This one is also provided in Spacemacs which is called editing style (vim,
emacs or hybrid). It is possible to switch between them dynamically.

------
cpfohl
I can't even say how happy it made me that Clippy made it into a CLI program.
Is that a common joke I've just missed elsewhere?

~~~
adiabatty
Sort of. [http://vigor.sourceforge.net/](http://vigor.sourceforge.net/)

~~~
eqyiel
See also:
[https://github.com/Fuco1/clippy.el](https://github.com/Fuco1/clippy.el)

------
h2077545
Kakoune seems great and I hope I will eventually make the switch from vim but
there are currently 3 things holding me back.

1\. Slime-like interaction: In vim I'm used to [vim-
slime]([https://github.com/jpalardy/vim-
slime](https://github.com/jpalardy/vim-slime)) for interactive languages such
as python but I couldn't yet find an equivalent way to do it in kakoune. I
suspect there is an easy way to do something like this using `:new` or the
tmux integration but I don't know how.

2\. Executing commands in the underlying shell: With C/C++ I usually need to
work only with a single file and a fast compile-run cycle. I have simple
functions defined for compile and run in my vimrc so that I can do it with a
simple key map but I'm not sure how to do this in kakoune. The problem is
sometimes output of my program exceeds one line so `:echo` is not quite useful
here.

3\. ctags/cscope integration: I haven't really checked this yet but I need
something for jumping around in large codebases.

~~~
mawww
Hello,

1\. that is missing, but mostly because nobody needed it yet, and I am not
very familiar with repl style languages. I expect it to be implementable with
current features.

2\. The simplest way to do that is to set the makecmd option, options can be
set per buffer, so each C++ buffer can have it set to the compile command for
it. You'll get output in the _make_ buffer.

3\. I use ctags a lot, and it is well supported, it requires the readtags
command that is provided by default in universal-ctags, and needs to be
installed manually with the older exuberant ctags. There is no cscope support
script AFAIK (although should be possible).

------
mercurial
It looks nice, and I assume the underlying code is less gnarly than vim's, but
I don't see the radical improvement over vim which would make me switch (also,
obviously, it's not going to benefit from the huge ecosystem of vim plugins).

What I think would be a killer for a vim successor would be to keep the best-
in-class editor functionality, add decent extensibility (not vimscript) in the
core product. Then add support for stuff commonly found in IDEs: notion of
projects/subprojects, API to support plugging syntax parsers easily, source
control integration, etc., and offer core plugins for a few popular languages.

------
openfuture
I'm hoping neovim will be able to adapt these ideas in the future.

They're addressing all the hardcoded parts so it should be possible to make
any of these with an addon / some nvimrc magic.

------
GhotiFish
First impressions with this editor are _very_ good.

One thing I'm not 100% sure how to do is substituions with references

so if I want to change the all the strings "foo(5, bar)" to "baz(bar).foo(5)"

with 5 and bar being arbitrary strings. How could I do that? In vim I would
use a regex expression and refer to matching sections with
"%s/foo(\\([^,]+\\), \\([^)]+\\))/baz(\2).foo(\1)/gc". In Kakoune it seems I
might have to do some multiselect shenanigans, the regex has better escaping
for my taste, but I can't match on specific selections. So I can't shuffle
them arbitrarily.

I looked through the vim golf challenges and couldn't find Kakoune doing an
operation like this.

mawww, do you have some screencasts of you using this editor? I would be nice
to have some live demonstrations showing off useful and common usage patterns
for it.

~~~
mawww
Hello,

If you get your selections through a regex, you will have access to capture
groups in registers 0..9 (which will store the correct match for each
selections), so to do the change you wanted, you'll type (in normal mode, no
':'):

%sfoo\\(([^,]+), ([^)]+)\\)<ret> # select whole buffer, then select all regex
matches

cbaz(<c-r>2).foo(<c-r>1)<esc> # enter insert mode, <c-r> recalls a register

I have been meaning to do a screencast at some point, or maybe I could do a
twitch Q/A session.

------
quanticle
One piece of feedback about the website itself: the actual reading area is
unusably small when viewed on a mobile device. Here's a
screenshot:[http://imgur.com/yvOGc02](http://imgur.com/yvOGc02). Note that the
menu doesn't hide, so >50% of the screen is occupied by a static menu that's
irrelevant to the actual content I'm trying to read.

------
eccstartup
Documentation in PDF available?

