2017-05-27 09:35:13 +03:00
|
|
|
|
kakoune(k)
|
2016-02-03 20:15:35 +03:00
|
|
|
|
==========
|
2016-02-02 22:15:12 +03:00
|
|
|
|
|
2016-02-03 20:15:35 +03:00
|
|
|
|
NAME
|
|
|
|
|
----
|
|
|
|
|
expansions - a
|
|
|
|
|
|
|
|
|
|
Strings
|
|
|
|
|
-------
|
|
|
|
|
\'strings'::
|
2016-03-12 12:13:49 +03:00
|
|
|
|
uninterpreted strings, use a backslash (\') to escape the separator
|
2016-02-03 20:15:35 +03:00
|
|
|
|
"strings"::
|
2016-02-11 00:03:49 +03:00
|
|
|
|
expanded strings, % strings (c.f. next section) contained are expended,
|
|
|
|
|
use a backslash (\\%) to escape the separator
|
2016-02-03 20:15:35 +03:00
|
|
|
|
%\{strings\}::
|
|
|
|
|
these strings are very useful when entering commands
|
|
|
|
|
+
|
2016-02-11 00:03:49 +03:00
|
|
|
|
* the '{' and '}' delimiters are configurable, you can use any non
|
|
|
|
|
alphanumeric character
|
2016-02-03 20:15:35 +03:00
|
|
|
|
+
|
|
|
|
|
----------------------------------------------------------
|
2016-02-02 22:15:12 +03:00
|
|
|
|
e.g. %[string], %<string>, %(string), %~string~, %!string!
|
2016-02-03 20:15:35 +03:00
|
|
|
|
----------------------------------------------------------
|
2016-02-11 00:03:49 +03:00
|
|
|
|
* if the character following '%' is one of '{[(<', then the closing
|
|
|
|
|
one is the matching '}])>' and the delimiters are not escapable but
|
|
|
|
|
are nestable
|
2016-02-03 20:15:35 +03:00
|
|
|
|
+
|
|
|
|
|
-----------------------------------------------------------
|
|
|
|
|
e.g. %{ roger {}; } is a valid string, %{ marcel \} as well
|
|
|
|
|
-----------------------------------------------------------
|
2016-02-02 22:15:12 +03:00
|
|
|
|
|
2016-02-03 20:15:35 +03:00
|
|
|
|
Typed expansions
|
|
|
|
|
----------------
|
|
|
|
|
*sh*::
|
2016-02-11 00:03:49 +03:00
|
|
|
|
shell expansion, similar to posix shell '$(...)' construct (c.f. next
|
|
|
|
|
section)
|
2016-02-03 20:15:35 +03:00
|
|
|
|
*reg*::
|
2016-02-11 00:03:49 +03:00
|
|
|
|
register expansion, will be replaced by the content of the given
|
|
|
|
|
register
|
2016-02-03 20:15:35 +03:00
|
|
|
|
*opt*::
|
|
|
|
|
option expansion, will be replaced with the value of the given option
|
|
|
|
|
*val*::
|
2016-02-11 00:03:49 +03:00
|
|
|
|
value expansion, gives access to the environment variable available
|
|
|
|
|
to the Shell expansion. The 'kak_' prefix is not used there
|
2016-02-03 20:15:35 +03:00
|
|
|
|
*arg*::
|
2016-02-11 00:03:49 +03:00
|
|
|
|
argument expansion, gives access to the arguments of the current
|
|
|
|
|
command, the content can be a number, or @ for all arguments
|
2016-02-02 22:15:12 +03:00
|
|
|
|
|
2016-02-03 20:15:35 +03:00
|
|
|
|
Shell expansions
|
|
|
|
|
----------------
|
2016-02-11 00:03:49 +03:00
|
|
|
|
The '%sh{...}' expansion replaces its content with the output of the
|
|
|
|
|
shell commands in it. The following environment variables are used to pass
|
|
|
|
|
informations about Kakoune's state:
|
2016-02-02 22:15:12 +03:00
|
|
|
|
|
2016-02-03 20:15:35 +03:00
|
|
|
|
*kak_selection*::
|
|
|
|
|
content of the main selection
|
|
|
|
|
*kak_selections*::
|
2016-02-11 00:03:49 +03:00
|
|
|
|
content of the selection separated by colons, colons in the selection
|
2016-04-08 19:00:24 +03:00
|
|
|
|
contents are escaped with a backslash
|
2016-02-03 20:15:35 +03:00
|
|
|
|
*kak_selection_desc*::
|
2016-02-11 00:03:49 +03:00
|
|
|
|
range of the main selection, represented as anchor,cursor; anchor
|
|
|
|
|
and cursor are in this format: line.column
|
2016-02-03 20:15:35 +03:00
|
|
|
|
*kak_selections_desc*::
|
2016-04-08 19:00:24 +03:00
|
|
|
|
range of the selections separated by colons
|
2016-02-03 20:15:35 +03:00
|
|
|
|
*kak_bufname*::
|
|
|
|
|
name of the current buffer
|
|
|
|
|
*kak_buffile*::
|
2016-02-11 00:03:49 +03:00
|
|
|
|
full path of the file or same as kak_bufname when there’s no
|
|
|
|
|
associated file
|
2016-02-03 20:15:35 +03:00
|
|
|
|
*kak_buflist*::
|
2016-04-08 19:00:24 +03:00
|
|
|
|
the current buffer list, each buffer separated by a colon
|
2017-06-06 15:29:06 +03:00
|
|
|
|
*kak_buf_line_count*::
|
|
|
|
|
the current buffer line count
|
2016-02-03 20:15:35 +03:00
|
|
|
|
*kak_timestamp*::
|
2016-02-11 00:03:49 +03:00
|
|
|
|
timestamp of the current buffer, the timestamp is an integer value
|
|
|
|
|
which is incremented each time the buffer is modified
|
2017-09-04 17:41:27 +03:00
|
|
|
|
*kak_history_id*::
|
2017-09-03 21:48:28 +03:00
|
|
|
|
history id of the current buffer, the history id is an integer value
|
|
|
|
|
which is used to reference a specific buffer version in the undo tree
|
2016-02-03 20:15:35 +03:00
|
|
|
|
*kak_runtime*::
|
|
|
|
|
directory containing the kak binary
|
2016-10-26 13:33:09 +03:00
|
|
|
|
*kak_count*::
|
|
|
|
|
count parameter passed to the command
|
2016-02-03 20:15:35 +03:00
|
|
|
|
*kak_opt_<name>*::
|
|
|
|
|
value of option *name*
|
|
|
|
|
*kak_reg_<r>*::
|
|
|
|
|
value of register *r*
|
|
|
|
|
*kak_session*::
|
|
|
|
|
name of the current session
|
|
|
|
|
*kak_client*::
|
2017-10-05 17:41:36 +03:00
|
|
|
|
name of the current client
|
2017-08-28 09:12:15 +03:00
|
|
|
|
*kak_client_pid*::
|
2017-10-05 17:41:36 +03:00
|
|
|
|
process id of the current client
|
|
|
|
|
*kak_client_list*::
|
|
|
|
|
list of clients connected to the current session
|
2017-01-06 22:43:20 +03:00
|
|
|
|
*kak_source*::
|
|
|
|
|
path of the file currently getting executed (through the source
|
|
|
|
|
command)
|
2017-05-18 18:36:06 +03:00
|
|
|
|
*kak_modified*::
|
|
|
|
|
buffer has modifications not saved
|
2016-02-03 20:15:35 +03:00
|
|
|
|
*kak_cursor_line*::
|
|
|
|
|
line of the end of the main selection
|
|
|
|
|
*kak_cursor_column*::
|
|
|
|
|
column of the end of the main selection (in byte)
|
2017-09-12 07:43:38 +03:00
|
|
|
|
*kak_cursor_char_value*::
|
|
|
|
|
unicode value of the codepoint under the cursor
|
2016-02-03 20:15:35 +03:00
|
|
|
|
*kak_cursor_char_column*::
|
|
|
|
|
column of the end of the main selection (in character)
|
2017-06-06 15:29:06 +03:00
|
|
|
|
*kak_cursor_byte_offset*::
|
2017-01-11 13:36:17 +03:00
|
|
|
|
Offset of the main selection from the beginning of the buffer (in bytes).
|
2016-02-03 20:15:35 +03:00
|
|
|
|
*kak_window_width*::
|
|
|
|
|
width of the current kakoune window
|
|
|
|
|
*kak_window_height*::
|
|
|
|
|
height of the current kakoune window
|
|
|
|
|
*kak_hook_param*::
|
|
|
|
|
filtering text passed to the currently executing hook
|
2017-03-30 13:29:06 +03:00
|
|
|
|
*kak_hook_param_capture_N*::
|
|
|
|
|
text captured by the hook filter regex capture N
|
2016-02-03 20:15:35 +03:00
|
|
|
|
*kak_client_env_<name>*::
|
2016-02-11 00:03:49 +03:00
|
|
|
|
value of the *name* variable in the client environment
|
|
|
|
|
(e.g. *$kak_client_env_SHELL* is the SHELL variable)
|
2016-02-02 22:15:12 +03:00
|
|
|
|
|
2016-02-11 00:03:49 +03:00
|
|
|
|
Note that in order for Kakoune to pass a value in the environment, the
|
|
|
|
|
variable has to be spelled out within the body of the expansion
|
2016-02-02 22:15:12 +03:00
|
|
|
|
|
2016-02-03 20:15:35 +03:00
|
|
|
|
Markup strings
|
|
|
|
|
--------------
|
2016-02-11 00:03:49 +03:00
|
|
|
|
In certain contexts, Kakoune can take a markup string, which is a string
|
2017-05-11 21:42:09 +03:00
|
|
|
|
containing formatting informations. In these strings, the {facename}
|
2016-02-11 00:03:49 +03:00
|
|
|
|
syntax will enable the face facename until another face gets activated,
|
|
|
|
|
or the end of the string is reached.
|
|
|
|
|
|
|
|
|
|
Literal '{' characters shall be written '\{', and a literal backslash ('\')
|
2016-04-08 19:00:24 +03:00
|
|
|
|
that precedes a '{' character shall be escaped as well ('\\').
|