Do a first phase of command renaming

This commit is contained in:
Maxime Coste 2016-11-14 00:27:14 +00:00
parent 9d9beb7e3a
commit dcd733e5fa
4 changed files with 41 additions and 41 deletions

View File

@ -58,13 +58,13 @@ command *q!* has to be used).
*colorscheme* <name>::
load named colorscheme
*nameclient* <name>::
*rename-client* <name>::
set current client name
*namebuf* <name>::
*rename-buffer* <name>::
set current buffer name
*namesession* <name>::
*rename-session* <name>::
set current session name
*echo* [options] <text>::
@ -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] <type> <name> [<value>]::
*declare-option* [-hidden] <type> <name> [<value>]::
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* [<flags>] <name> <command>::
*define-command* [<flags>] <name> <command>::
define a new command (c.f. the 'Declaring new commands' section below)
*map* <scope> <mode> <key> <keys>::
@ -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* <scope> <group>::
*remove-hooks* <scope> <group>::
remove every hooks in *scope* that are part of the given *group*
(c.f. the 'hooks' documentation page)
*addhl* [<flags>] <highlighter_name> <highlighter_parameters> ...::
*add-highlighter* [<flags>] <highlighter_name> <highlighter_parameters> ...::
add a highlighter to the current window (c.f. the 'highlighters'
documentation page)
*rmhl* <highlighter_id>::
*remove-highlighter* <highlighter_id>::
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] <command_name> <commands>::
*define-command* [flags] <command_name> <commands>::
*commands* is a string containing the commands to execute, and *flags*
can be any combination of the following parameters:

View File

@ -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

View File

@ -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

View File

@ -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 <name> if given",
"delete-buffer [name]: delete current buffer or the buffer named <name> 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 <name> if "
"delete-buffer! [name]: delete current buffer or the buffer named <name> 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 <name>: change current buffer name",
"rename-buffer <name>: 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 <type> <type params>...: add an highlighter",
"add-highlighter <type> <type params>...: 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 <path>: remove highlighter <name>",
"add-highlighter <path>: remove highlighter <name>",
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 <scope> <group>: remove all hooks whose group is <group>",
"remove-hooks <scope> <group>: remove all hooks whose group is <group>",
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 <switches> <name> <cmds>: define a command <name> executing <cmds>",
"define-command <switches> <name> <cmds>: define a command <name> executing <cmds>",
ParameterDesc{
{ { "params", { true, "take parameters, accessible to each shell escape as $0..$N\n"
"parameter should take the form <count> or <min>..<max> (both omittable)" } },
@ -1254,9 +1254,9 @@ const CommandDesc unset_option_cmd = {
};
const CommandDesc declare_option_cmd = {
"declare-option",
"decl",
nullptr,
"decl <type> <name> [value]: declare option <name> of type <type>.\n"
"declare-option <type> <name> [value]: declare option <name> of type <type>.\n"
"set its initial value to <value> 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 <name>: set current client name to <name>",
single_name_param,
@ -1954,9 +1954,9 @@ const CommandDesc select_cmd = {
};
const CommandDesc change_working_directory_cmd = {
"change-directory",
"cd",
nullptr,
"cd [<directory>]: change the server's working directory to <directory>, or the home directory if unspecified",
"change-directory [<directory>]: change the server's working directory to <directory>, 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 <name>: change remote session name",
"rename-session <name>: change remote session name",
ParameterDesc{{}, ParameterDesc::Flags::None, 1, 1},
CommandFlags::None,
CommandHelper{},