diff --git a/doc/manpages/commands.asciidoc b/doc/manpages/commands.asciidoc index b4070bbb..9f40d47e 100644 --- a/doc/manpages/commands.asciidoc +++ b/doc/manpages/commands.asciidoc @@ -58,13 +58,13 @@ command *q!* has to be used). *colorscheme* :: load named colorscheme -*nameclient* :: +*rename-client* :: set current client name -*namebuf* :: +*rename-buffer* :: set current buffer name -*namesession* :: +*rename-session* :: set current session name *echo* [options] :: @@ -99,7 +99,7 @@ command *q!* has to be used). remove an alias if its current value is the same as the one passed as an optional parameter, remove it unconditionally otherwise -*decl* [-hidden] []:: +*declare-option* [-hidden] []:: declare a new option, the -hidden hides the option in completion suggestions (c.f. the 'options' documentation page) @@ -114,7 +114,7 @@ command *q!* has to be used). execute commands, as if they were entered in the command prompt (c.f. the 'execeval' documentation page) -*def* [] :: +*define-command* [] :: define a new command (c.f. the 'Declaring new commands' section below) *map* :: @@ -134,15 +134,15 @@ command *q!* has to be used). execute a command whenever an event is triggered (c.f. the 'hooks' documentation page) -*rmhooks* :: +*remove-hooks* :: remove every hooks in *scope* that are part of the given *group* (c.f. the 'hooks' documentation page) -*addhl* [] ...:: +*add-highlighter* [] ...:: add a highlighter to the current window (c.f. the 'highlighters' documentation page) -*rmhl* :: +*remove-highlighter* :: remove the highlighter whose id is *highlighter_id* (c.f. the 'highlighters' documentation page) @@ -206,9 +206,9 @@ backslash (\;) to be considered as a literal semicolon argument Declaring new commands ---------------------- -New commands can be defined using the *def* command: +New commands can be defined using the *define-command* command: -*def* [flags] :: +*define-command* [flags] :: *commands* is a string containing the commands to execute, and *flags* can be any combination of the following parameters: diff --git a/rc/core/kakrc.kak b/rc/core/kakrc.kak index d9931591..92d7f68c 100644 --- a/rc/core/kakrc.kak +++ b/rc/core/kakrc.kak @@ -12,7 +12,7 @@ addhl -group / regions -default code kakrc \ # Grammar keywords="hook|rmhooks|addhl|rmhl|exec|eval|source|runtime|def|alias" keywords="${keywords}|unalias|decl|echo|edit|set|map|face|prompt|menu|info" - keywords="${keywords}|try|catch|nameclient|namebuf|cd|colorscheme" + keywords="${keywords}|try|catch|rename-client|rename-buffer|rename-session|change-directory|colorscheme" values="default|black|red|green|yellow|blue|magenta|cyan|white" # Add the language's grammar to the static completion list diff --git a/rc/extra/git-tools.kak b/rc/extra/git-tools.kak index 82ca09f3..3deeb99c 100644 --- a/rc/extra/git-tools.kak +++ b/rc/extra/git-tools.kak @@ -128,7 +128,7 @@ Available commands:\n-add\n-rm\n-blame\n-commit\n-checkout\n-diff\n-hide-blame\n printf %s "edit '$msgfile' hook buffer BufWritePost '.*\Q$msgfile\E' %{ %sh{ if git commit -F '$msgfile' --cleanup=strip $@ > /dev/null; then - printf %s 'eval -client $kak_client echo -color Information Commit succeeded; delbuf' + printf %s 'eval -client $kak_client echo -color Information Commit succeeded; delete-buffer' else printf %s 'eval -client $kak_client echo -color Error Commit failed' fi diff --git a/src/commands.cc b/src/commands.cc index 19cbf3a3..a59a4e87 100644 --- a/src/commands.cc +++ b/src/commands.cc @@ -348,7 +348,7 @@ void write_all_buffers() } const CommandDesc writeall_cmd = { - "writeall", + "write-all", "wa", "write all buffers that are associated to a file", no_params, @@ -449,8 +449,8 @@ void write_quit(const ParametersParser& parser, Context& context, } const CommandDesc write_quit_cmd = { + "write-quit", "wq", - nullptr, "write current buffer and quit current client", no_params, CommandFlags::None, @@ -460,8 +460,8 @@ const CommandDesc write_quit_cmd = { }; const CommandDesc force_write_quit_cmd = { + "write-quit!", "wq!", - nullptr, "write current buffer and quit current client, even if other buffers are " "not saved", no_params, @@ -472,8 +472,8 @@ const CommandDesc force_write_quit_cmd = { }; const CommandDesc writeall_quit_cmd = { + "write-all-quit", "waq", - nullptr, "write all buffers associated to a file and quit current client", no_params, CommandFlags::None, @@ -537,9 +537,9 @@ void cycle_buffer(const ParametersParser& parser, Context& context, const ShellC } const CommandDesc buffernext_cmd = { - "buffernext", + "buffer-next", "bn", - "buffernext: move to the next buffer in the list", + "buffer-next: move to the next buffer in the list", no_params, CommandFlags::None, CommandHelper{}, @@ -548,9 +548,9 @@ const CommandDesc buffernext_cmd = { }; const CommandDesc bufferprev_cmd = { - "bufferprev", + "buffer-prev", "bp", - "bufferprev: move to the previous buffer in the list", + "buffer-prev: move to the previous buffer in the list", no_params, CommandFlags::None, CommandHelper{}, @@ -570,9 +570,9 @@ void delete_buffer(const ParametersParser& parser, Context& context, const Shell } const CommandDesc delbuf_cmd = { - "delbuf", + "delete-buffer", "db", - "delbuf [name]: delete current buffer or the buffer named if given", + "delete-buffer [name]: delete current buffer or the buffer named if given", single_optional_name_param, CommandFlags::None, CommandHelper{}, @@ -581,9 +581,9 @@ const CommandDesc delbuf_cmd = { }; const CommandDesc force_delbuf_cmd = { - "delbuf!", + "delete-buffer!", "db!", - "delbuf! [name]: delete current buffer or the buffer named if " + "delete-buffer! [name]: delete current buffer or the buffer named if " "given, even if the buffer is unsaved", single_optional_name_param, CommandFlags::None, @@ -593,9 +593,9 @@ const CommandDesc force_delbuf_cmd = { }; const CommandDesc namebuf_cmd = { - "namebuf", + "rename-buffer", nullptr, - "namebuf : change current buffer name", + "rename-buffer : change current buffer name", single_name_param, CommandFlags::None, CommandHelper{}, @@ -673,9 +673,9 @@ Highlighter& get_highlighter(const Context& context, StringView path) } const CommandDesc add_highlighter_cmd = { + "add-highlighter", "addhl", - "ah", - "addhl ...: add an highlighter", + "add-highlighter ...: add an highlighter", ParameterDesc{ { { "group", { true, "Set the group in which to put the highlighter. " "If starting with /, search in shared highlighters, " @@ -719,9 +719,9 @@ const CommandDesc add_highlighter_cmd = { }; const CommandDesc rm_highlighter_cmd = { + "remove-highlighter", "rmhl", - "rh", - "rmhl : remove highlighter ", + "add-highlighter : remove highlighter ", ParameterDesc{ {}, ParameterDesc::Flags::None, 1, 1 }, CommandFlags::None, CommandHelper{}, @@ -780,9 +780,9 @@ const CommandDesc add_hook_cmd = { }; const CommandDesc rm_hook_cmd = { + "remove-hooks", "rmhooks", - nullptr, - "rmhooks : remove all hooks whose group is ", + "remove-hooks : remove all hooks whose group is ", ParameterDesc{ {}, ParameterDesc::Flags::None, 2, 2 }, CommandFlags::None, CommandHelper{}, @@ -985,9 +985,9 @@ void define_command(const ParametersParser& parser, Context& context, const Shel } const CommandDesc define_command_cmd = { + "define-command", "def", - nullptr, - "def : define a command executing ", + "define-command : define a command executing ", ParameterDesc{ { { "params", { true, "take parameters, accessible to each shell escape as $0..$N\n" "parameter should take the form or .. (both omittable)" } }, @@ -1254,9 +1254,9 @@ const CommandDesc unset_option_cmd = { }; const CommandDesc declare_option_cmd = { + "declare-option", "decl", - nullptr, - "decl [value]: declare option of type .\n" + "declare-option [value]: declare option of type .\n" "set its initial value to if given and the option did not exist\n" "Available types:\n" " int: integer\n" @@ -1909,7 +1909,7 @@ const CommandDesc face_cmd = { }; const CommandDesc set_client_name_cmd = { - "nameclient", + "rename-client", "nc", "nameclient : set current client name to ", single_name_param, @@ -1954,9 +1954,9 @@ const CommandDesc select_cmd = { }; const CommandDesc change_working_directory_cmd = { + "change-directory", "cd", - nullptr, - "cd []: change the server's working directory to , or the home directory if unspecified", + "change-directory []: change the server's working directory to , or the home directory if unspecified", single_optional_name_param, CommandFlags::None, CommandHelper{}, @@ -1979,9 +1979,9 @@ const CommandDesc change_working_directory_cmd = { }; const CommandDesc set_session_name = { - "namesession", + "rename-session", nullptr, - "namesession : change remote session name", + "rename-session : change remote session name", ParameterDesc{{}, ParameterDesc::Flags::None, 1, 1}, CommandFlags::None, CommandHelper{},