2017-05-27 08:35:13 +02:00
|
|
|
kakoune(k)
|
2016-09-23 12:50:10 +02:00
|
|
|
==========
|
|
|
|
|
|
|
|
NAME
|
|
|
|
----
|
|
|
|
faq - a
|
2016-08-23 06:47:07 +02:00
|
|
|
|
2016-09-22 20:01:46 +02:00
|
|
|
How to pronounce the name of the project and what does it mean ?
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
2016-09-23 12:50:10 +02:00
|
|
|
The name of the project is pronounced "Kak-oon", and is a word taken from a
|
|
|
|
New Caledonian dialect based on french. It means a hard blow, usually a punch,
|
2017-04-21 12:32:47 +02:00
|
|
|
but generally refers to a blow into which all of one's strength went.
|
2016-09-22 20:01:46 +02:00
|
|
|
|
2016-08-23 06:47:07 +02:00
|
|
|
Is there going to be a Windows port of Kakoune ?
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
As many features provided by UNIX systems would be missing, or if anything
|
2016-10-12 08:36:42 +02:00
|
|
|
much less efficient on a Windows system, the incentive to porting the
|
2016-08-23 06:47:07 +02:00
|
|
|
project to this operating system is pretty low.
|
|
|
|
|
|
|
|
Moreover, you can get pretty decent performance by using Kakoune on Cygwin
|
|
|
|
(which is officially supported).
|
|
|
|
|
|
|
|
Can you get rid of the `boost` dependency and just use std::regex ?
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
2016-09-23 12:50:10 +02:00
|
|
|
The `boost-regex` library provides use with several features that are heavily
|
|
|
|
relied upon across several core scripts, and a few of them are not available
|
|
|
|
in the standard `std::regex` implementations. Therefore, until the standard
|
|
|
|
catches up with `boost` in terms of features, the latter will remain a hard
|
|
|
|
-mandatory- dependency.
|
2016-08-23 06:47:07 +02:00
|
|
|
|
|
|
|
Kakoune is very slow on big files, what can I do about it ?
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
2016-09-23 12:50:10 +02:00
|
|
|
The default build mode (set in the `Makefile` of the `src` directory of the
|
|
|
|
project) is "debug", which makes it convenient to track issues but also
|
|
|
|
affects performance. To disable the debug mode, recompile the project by
|
|
|
|
setting the `debug` variable in `src/Makefile` to `no`.
|
|
|
|
|
|
|
|
Note that if your distribution provides a "kakoune" package, the program should
|
|
|
|
already be built in non-debug mode (if you still experience slowness, please
|
|
|
|
report the issue on the bug tracker).
|
2016-08-23 06:47:07 +02:00
|
|
|
|
|
|
|
Can I use Kakoune as a pager ?
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
2016-10-11 13:40:20 +02:00
|
|
|
Kakoune can be used as a pager, either by setting the `EDITOR` environment
|
|
|
|
variable to `kak`, or by writing data directly to its standard input using a
|
|
|
|
shell pipeline. However, since the program relies on several heavy dynamic
|
2016-10-12 08:36:42 +02:00
|
|
|
libraries (`boost` being one of them), it will be slightly less practical
|
2016-10-11 13:40:20 +02:00
|
|
|
than other regular pagers (such as `less` or `more`) which have a minimal
|
|
|
|
amount of runtime dependencies.
|
2016-08-23 06:47:07 +02:00
|
|
|
|
|
|
|
Are there any non-console based frontends available ?
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
2016-09-22 20:01:46 +02:00
|
|
|
No graphical frontend is currently officially maintained, you can however
|
|
|
|
try experimental community-developed ones.
|
2016-08-23 06:47:07 +02:00
|
|
|
|
2016-10-12 08:36:42 +02:00
|
|
|
Why are colors misrendered in my Kakoune clients ?
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
The most probable cause for that is a very widespread practice that consists
|
|
|
|
in setting the `TERM` environment variable in the shell's configuration file.
|
|
|
|
This variable should be set by the terminal emulator, and not overridden with
|
|
|
|
an arbitrary value, otherwise it might interfere with general UI rendering on
|
|
|
|
the terminal's window.
|
|
|
|
|
|
|
|
Note that if you're using `tmux`, the proper -official- way to get Kakoune to
|
|
|
|
work is to add the following line to your `tmux` configuration file:
|
|
|
|
`set -sg default-terminal screen-256color`
|
|
|
|
|
2016-09-22 20:01:46 +02:00
|
|
|
How do I automatically indent code, as Vim does with `=` ?
|
2016-08-23 06:47:07 +02:00
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
2016-09-23 12:50:10 +02:00
|
|
|
As `Kakoune` doesn't parse the contents of the buffers, there is no builtin
|
|
|
|
equivalent for this Vim feature. Use a formatter/prettifier dedicated to
|
|
|
|
the language you're using with the help of the `|` key.
|
2016-09-22 20:01:46 +02:00
|
|
|
|
|
|
|
Example: `%|indent<ret>` to indent an entire buffer with C code.
|
|
|
|
|
|
|
|
Note that some languages have a default formatter set, which you can use
|
|
|
|
with the `:format` command.
|
2016-08-23 06:47:07 +02:00
|
|
|
|
|
|
|
Can Kakoune automatically complete the parameters of my functions ?
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
2016-09-23 12:50:10 +02:00
|
|
|
As mentioned in the above question about Vim's `=` key, Kakoune does not
|
|
|
|
parse the contents of a buffer by itself, which makes it impossible for
|
|
|
|
the editor to propose candidates upon completion.
|
2016-08-23 06:47:07 +02:00
|
|
|
|
2016-09-23 12:50:10 +02:00
|
|
|
However, support for such a feature can be achieved through the use of a
|
|
|
|
dedicated tool, as is the case with `clang` and C code: you can use the
|
|
|
|
`clang-enable-autocomplete` and `clang-complete` builtin commands whenever
|
|
|
|
editing a C/C++ file, and completion will work on function parameters.
|
2016-09-22 20:01:46 +02:00
|
|
|
|
2016-09-23 12:50:10 +02:00
|
|
|
Note that the same features are available for python buffers, with the
|
|
|
|
`jedi` script.
|
2016-08-23 06:47:07 +02:00
|
|
|
|
|
|
|
Why aren't widely known command line shortcuts such as <c-w> or <c-u> available in Kakoune ?
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
2016-09-23 12:50:10 +02:00
|
|
|
Despite their widespread availability in multiple tools, those shortcuts do
|
|
|
|
not fit the paradigm that Kakoune implements, which is based on selections
|
|
|
|
first.
|
2016-08-23 06:47:07 +02:00
|
|
|
|
2016-09-23 12:50:10 +02:00
|
|
|
However, you can easily declare key mappings in your configuration file
|
|
|
|
to be able to use those control-based shortcuts in insert mode (c.f. the
|
|
|
|
"map" command in the "commands" documentation page).
|
2016-08-23 06:47:07 +02:00
|
|
|
|
|
|
|
How can I explore the filesystem the way Vim's NerdTree does ?
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
The builtin file completion engine used when opening a file for editing
|
2016-09-23 12:50:10 +02:00
|
|
|
(using the `:edit` command and letting the suggestions popup in the menu
|
|
|
|
beneath) is much more convenient than Vim's, which should suit basic needs.
|
2016-08-23 06:47:07 +02:00
|
|
|
|
|
|
|
However, if you need an actual explorer to interact with the editor,
|
|
|
|
you can create a Kakoune script that will spawn the tool in question,
|
2016-09-23 12:50:10 +02:00
|
|
|
which should in return send an "edit" command followed by the path of the
|
|
|
|
file you selected to the current Kakoune session (e.g. `echo "eval -client
|
|
|
|
$kak_client edit /path/to/file" | kak -p $kak_session`).
|
2016-08-23 06:47:07 +02:00
|
|
|
|
2016-09-23 12:50:10 +02:00
|
|
|
Why aren't there other scopes similar to `%sh{}` e.g. python ?
|
2016-08-23 06:47:07 +02:00
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
2016-09-23 12:50:10 +02:00
|
|
|
Supporting custom scopes would add hard dependencies to the project, which
|
2017-04-21 12:32:47 +02:00
|
|
|
is too much of a drawback when balanced against the low cost of using
|
2016-09-23 12:50:10 +02:00
|
|
|
an interpreter in a regular shell scope (e.g. `%sh{ python -c "..." }`).
|
|
|
|
The shell scope allows users to spawn any interpreter they want, for a minimal
|
|
|
|
cost in terms of performance, it is therefore the reason why it's the only
|
|
|
|
one available by default.
|
2016-09-22 20:01:46 +02:00
|
|
|
|
|
|
|
Can I disable auto-indentation completely ?
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
All the indentation hooks are conventionally named `<lang>-indent`, which
|
2016-09-23 12:50:10 +02:00
|
|
|
allows us to use the `disabled_hooks` variable to disable indentation
|
|
|
|
globally with the following command: `set global disabled_hooks '.+-indent'`
|
2016-09-22 20:01:46 +02:00
|
|
|
|
2017-05-26 17:15:08 +02:00
|
|
|
How to enable syntax highlighting ?
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
The mimetype of the files opened in new buffers is detected using the
|
|
|
|
`file` command, and syntax highlighting enabled automatically when
|
|
|
|
possible.
|
|
|
|
|
|
|
|
My file seems to be highlighted with the wrong colors, I thought syntax highlighting was detected automatically ?
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
The `file` utility has several short comings, such as detecting the
|
|
|
|
wrong mimetype for a file containing data with different syntax, e.g.
|
|
|
|
a Python script containing hardcoded HTML templates detected as an HTML
|
|
|
|
file.
|
|
|
|
|
|
|
|
Kakoune does its best at detecting file types (using known extensions
|
|
|
|
for a given format for instance), but not much can be done about those
|
|
|
|
ambiguous cases. You might consider writing a custom `$HOME/.magic` file
|
|
|
|
if needed.
|
|
|
|
|
2016-09-23 12:50:10 +02:00
|
|
|
Can I disable syntax highlighting completely ?
|
2016-09-22 20:01:46 +02:00
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
2016-09-23 12:50:10 +02:00
|
|
|
Similarly to the indentation hooks, the name format followed by the
|
|
|
|
highlighting hooks is `<lang>-highlight`. You can thus disable syntax
|
|
|
|
highlighting using the following command: `set global disabled_hooks
|
|
|
|
'.+-highlight'`
|
2017-05-26 17:15:08 +02:00
|
|
|
|
|
|
|
Why does a dot `.` in a regex select newline characters ?
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
Data in buffers is a stream of characters, and newlines do not receive special
|
|
|
|
treatment compared to other characters, with regards to regex matching. In
|
|
|
|
order to select data in a line without any trailing newline characters, one could
|
|
|
|
use the `[^\n]+` pattern, which is arguably a good compromise when
|
|
|
|
balanced against the ability to select data over several lines.
|
|
|
|
|
|
|
|
Can I split the window to display different buffers in them ?
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
As a fairly compliant follower of the UNIX philosophy, Kakoune does not
|
|
|
|
try to implement features that are best handled by separate, dedicated
|
|
|
|
tools. Windows splitting in terminals is a prime example of that
|
|
|
|
concept, where the editor provides commands to interact with several
|
|
|
|
terminal multiplexers (e.g. `tmux`), as opposed to emulating their
|
|
|
|
functionalities.
|
|
|
|
|
|
|
|
In order to open buffers in the same window simultaneously using `tmux`
|
|
|
|
(or one of the supported multiplexers), run Kakoune in a `tmux` session,
|
|
|
|
and simply use the `:new` command to spawn new clients as you would
|
|
|
|
have otherwise in an X11 environment.
|