From d628cb50cf4752b83b3a1594e9fb54be26854951 Mon Sep 17 00:00:00 2001 From: Tim Allen Date: Thu, 3 Sep 2020 01:55:36 +1000 Subject: [PATCH] rc: Add some documentation for existing plugins.. --- rc/tools/autorestore.asciidoc | 23 ++++++++++++++ rc/tools/doc.asciidoc | 15 +++++++++ rc/tools/lint.asciidoc | 57 +++++++++++++++++++++++++++++++++++ 3 files changed, 95 insertions(+) create mode 100644 rc/tools/autorestore.asciidoc create mode 100644 rc/tools/doc.asciidoc create mode 100644 rc/tools/lint.asciidoc diff --git a/rc/tools/autorestore.asciidoc b/rc/tools/autorestore.asciidoc new file mode 100644 index 00000000..7112ae3b --- /dev/null +++ b/rc/tools/autorestore.asciidoc @@ -0,0 +1,23 @@ += Automatically restore unsaved work after a crash. + +When Kakoune crashes, it automatically writes out unsaved changes to backup +files with predictable names. When you edit a file, if such a backup file +exists, this plugin will automatically load the content of the backup file +instead. + +== Commands + +*autorestore-restore-buffer*:: + Restore the backup for the current file if it exists. + +*autorestore-purge-backups*:: + Remove all the backups of the current buffer. + +*autorestore-disable*:: + Disable automatic backup recovering for this session. + +== Options + +*autorestore_purge_restored* (bool):: + *default* true + + If true, remove backups once they've been restored diff --git a/rc/tools/doc.asciidoc b/rc/tools/doc.asciidoc new file mode 100644 index 00000000..ff1fbae9 --- /dev/null +++ b/rc/tools/doc.asciidoc @@ -0,0 +1,15 @@ += Kakoune's online documentation + +== Commands + +*doc* :: + *alias* help + + display documentation about a topic. The completion list displays the + available topics + +== Options + +*docsclient* (str):: + If set, the `:doc` command (and other commands that display documentation) + will try to display documentation in the Kakoune client with this name. + See <> diff --git a/rc/tools/lint.asciidoc b/rc/tools/lint.asciidoc new file mode 100644 index 00000000..3590eb7e --- /dev/null +++ b/rc/tools/lint.asciidoc @@ -0,0 +1,57 @@ += Integrate with tools that check files for problems. + +Many file-formats have "lint" tools that check for common problems and point out +where they occur. Most of these tools produce output in the the traditional +message format: + +---- +{filename}:{line}:{column}: {kind}: {message} +---- + +If the 'kind' field contains 'error', the message is treated as an error, +otherwise it is assumed to be a warning. + +This plugin can run such tools and collect the resulting messages. The complete +output is collected in the `*lint-output*` buffer, and any lines in the current +file with messages will have a marker displayed next to them in the left margin. +When the cursor moves onto a line with the problem, the associated messages will +be displayed in a tool tip.. + +== Commands + +*lint-buffer*:: + *alias* lint + + Pass the entire buffer through the program named in `lintcmd`. The buffer + may contain unsaved changes. + +*lint-selections* [-command ]:: + Pass each of the selections through `` or, if the `-command` switch is + not provided, through the program named in `lintcmd`. The buffer may contain + unsaved changes. + +*lint-hide-diagnostics*:: + Hide line markers and disable the automatic display of messages, if any. + +*lint-next-message*:: + Jump to the next message generated by the last `lint-buffer` or + `lint-selections` command. + +*lint-previous-message*:: + Jump to the previous message generated by the last `lint-buffer` or + `lint-selections` command. + +== Options + +*lintcmd* (str):: + The shell command used by lint-buffer and lint-selections. + + + It will be given the path to a file containing the text to be + linted, and must produce output in the format: + + +*toolsclient* (str):: + If set, the `:lint` command (and other commands that point out files and + line-numbers) will try to display its results in the Kakoune client with + this name. + See <> +