Kakoune{: .external} is a modal text editor inspired by vim. See why-kakoune{: .external} for why you might want to use it over vim or any other editor or IDE.
Add the following to kakrc
to enable relative line numbers (note that this is equivalent to vim when both number
and relativenumber
are set, meaning that the absolute line number is shown for the line the primary cursor is on).
add-highlighter global/ number-lines -relative
Remove -relative
for absolute line numbers.
plug.kak{: .external} is a plugin manager inspired by vim-plug
. It is the recommended way to install and manage plugins. See the Github README for installation and usage instructions.
The basic workflow to add a plugin is:
kakrc
which names and configures the plugin you want to install.kakrc
.:plug-install
to install the plugin.A recommended setup for indentation and alignment is to use a combination of built-in support for editorconfig{: .external} and the smarttab.kak{: .external} plugin. Naturally, this relies on a .editorconfig
configuration file being present at or above the root of the Fuchsia checkout. Add the following lines to kakrc
and then install the smarttab.kak
plugin:
plug "andreyorst/smarttab.kak" defer smarttab %{ set-option global softtabstop 4 } hook global BufOpenFile .* %{ editorconfig-load autoconfigtab } hook global BufNewFile .* %{ editorconfig-load autoconfigtab }
Note that backspace always removes one indentation worth of spaces in indentation context, and the value of softtabstop
only affects how many spaces are deleted in alignment context. A value of 4 is the recommended default; other alternatives are:
%opt(indentwidth)
to use the value of indentwidth
, orkak-lsp{: .external} is a LSP (Language Server Protocol) client written in Rust. See the Github README for installation instructions.
The default kak-lsp.toml{: .external} runs clangd
for C and C++, gopls
for Go, and rustup which rust-analyzer
for Rust. Edit the TOML config file to make any necessary changes.
At minimum, the following configuration line should be added to enter LSP mode through which all LSP functionality can be accessed.
map global user l %{:enter-user-mode lsp<ret>} -docstring "LSP mode"
The first release version to include FIDL support is v2022.08.11. Run kak -version
to verify that you are running this or a more recent version. If you are running an older version, the alternatives are:
Compile from source; or
Save a copy of fidl.kak{: .external} anywhere and source it from kakrc
. For example, if it is saved next to kakrc
, it can be sourced by:
source "%val(config)/fidl.kak"
This works because %val(config)
expands to the path where kakrc
can be found.
FIDL filetype support includes syntax highlighting and indentation. The only indentation behavior present by the auto-formatter that is not implemented is alignment of colons for table and union fields.