From 3f1c3ee80e46f80d7f1642009c4f9dffa404d935 Mon Sep 17 00:00:00 2001 From: Max Schillinger Date: Mon, 18 Mar 2024 10:08:40 +0100 Subject: Add command completion with tab key MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the command prompt, press to get a list of all available commands and pick one (using vis-menu). This works also after typing the first letters of a command (p.e. `:la`). Co-authored-by: Matěj Cepl --- vis.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'vis.h') diff --git a/vis.h b/vis.h index 2e66b77..01bf1a0 100644 --- a/vis.h +++ b/vis.h @@ -14,6 +14,7 @@ typedef struct Win Win; #include "text-regex.h" #include "libutf.h" #include "array.h" +#include "buffer.h" #ifndef CONFIG_HELP #define CONFIG_HELP 1 @@ -1229,6 +1230,13 @@ bool vis_option_unregister(Vis *vis, const char *name); */ bool vis_prompt_cmd(Vis *vis, const char *cmd); +/** + * Write newline separated list of available commands to ``buf`` + * @param vis The editor instance. + * @param buf The buffer to write to. + */ +void vis_print_cmds(Vis*, Buffer *buf); + /** * Pipe a given file range to an external process. * @param vis The editor instance. -- cgit v1.2.3