#include "config.h"
#include <sys/types.h>
#include <sys/queue.h>
#include <bitstring.h>
#include <limits.h>
#include <stdio.h>
#include "../common/common.h"
EXCMDLIST const cmds[] = {
{"\004", ex_pr, E_ADDR2,
"",
"^D",
"scroll lines"},
{"!", ex_bang, E_ADDR2_NONE | E_SECURE,
"S",
"[line [,line]] ! command",
"filter lines through commands or run commands"},
{"#", ex_number, E_ADDR2|E_CLRFLAG,
"ca1",
"[line [,line]] # [count] [l]",
"display numbered lines"},
{"&", ex_subagain, E_ADDR2,
"s",
"[line [,line]] & [cgr] [count] [#lp]",
"repeat the last substitution"},
{"*", ex_at, 0,
"b",
"* [buffer]",
"execute a buffer"},
{"<", ex_shiftl, E_ADDR2|E_AUTOPRINT,
"ca1",
"[line [,line]] <[<...] [count] [flags]",
"shift lines left"},
{"=", ex_equal, E_ADDR1|E_ADDR_ZERO|E_ADDR_ZERODEF,
"1",
"[line] = [flags]",
"display line number"},
{">", ex_shiftr, E_ADDR2|E_AUTOPRINT,
"ca1",
"[line [,line]] >[>...] [count] [flags]",
"shift lines right"},
{"@", ex_at, E_ADDR2,
"b",
"@ [buffer]",
"execute a buffer"},
{"append", ex_append, E_ADDR1|E_ADDR_ZERO|E_ADDR_ZERODEF,
"!",
"[line] a[ppend][!]",
"append input to a line"},
{"abbreviate", ex_abbr, 0,
"W",
"ab[brev] [word replace]",
"specify an input abbreviation"},
{"args", ex_args, 0,
"",
"ar[gs]",
"display file argument list"},
{"bg", ex_bg, E_VIONLY,
"",
"bg",
"put the current screen into the background"},
{"change", ex_change, E_ADDR2|E_ADDR_ZERODEF,
"!ca",
"[line [,line]] c[hange][!] [count]",
"change lines to input"},
{"cd", ex_cd, 0,
"!f1o",
"cd[!] [directory]",
"change the current directory"},
{"chdir", ex_cd, 0,
"!f1o",
"chd[ir][!] [directory]",
"change the current directory"},
{"copy", ex_copy, E_ADDR2|E_AUTOPRINT,
"l1",
"[line [,line]] co[py] line [flags]",
"copy lines elsewhere in the file"},
{"delete", ex_delete, E_ADDR2|E_AUTOPRINT,
"bca1",
"[line [,line]] d[elete][flags] [buffer] [count] [flags]",
"delete lines from the file"},
{"display", ex_display, 0,
"w1r",
"display b[uffers] | s[creens] | t[ags]",
"display buffers, screens or tags"},
{"edit", ex_edit, E_NEWSCREEN,
"f1o",
"e[dit][!] [+cmd] [file]",
"begin editing another file"},
{"ex", ex_edit, E_NEWSCREEN,
"f1o",
"ex[!] [+cmd] [file]",
"begin editing another file"},
{"exusage", ex_usage, 0,
"w1o",
"[exu]sage [command]",
"display ex command usage statement"},
{"file", ex_file, 0,
"f1o",
"f[ile] [name]",
"display (and optionally set) file name"},
{"fg", ex_fg, E_NEWSCREEN|E_VIONLY,
"f1o",
"fg [file]",
"bring a backgrounded screen into the foreground"},
{"global", ex_global, E_ADDR2_ALL,
"!s",
"[line [,line]] g[lobal][!] [;/]RE[;/] [commands]",
"execute a global command on lines matching an RE"},
{"help", ex_help, 0,
"",
"he[lp]",
"display help statement"},
{"insert", ex_insert, E_ADDR1|E_ADDR_ZERO|E_ADDR_ZERODEF,
"!",
"[line] i[nsert][!]",
"insert input before a line"},
{"join", ex_join, E_ADDR2|E_AUTOPRINT,
"!ca1",
"[line [,line]] j[oin][!] [count] [flags]",
"join lines into a single line"},
{"k", ex_mark, E_ADDR1,
"w1r",
"[line] k key",
"mark a line position"},
{"list", ex_list, E_ADDR2|E_CLRFLAG,
"ca1",
"[line [,line]] l[ist] [count] [#]",
"display lines in an unambiguous form"},
{"move", ex_move, E_ADDR2|E_AUTOPRINT,
"l",
"[line [,line]] m[ove] line",
"move lines elsewhere in the file"},
{"mark", ex_mark, E_ADDR1,
"w1r",
"[line] ma[rk] key",
"mark a line position"},
{"map", ex_map, 0,
"!W",
"map[!] [keys replace]",
"map input or commands to one or more keys"},
{"mkexrc", ex_mkexrc, 0,
"!f1r",
"mkexrc[!] file",
"write a .exrc file"},
{"next", ex_next, E_NEWSCREEN,
"!fN",
"n[ext][!] [+cmd] [file ...]",
"edit (and optionally specify) the next file"},
{"number", ex_number, E_ADDR2|E_CLRFLAG,
"ca1",
"[line [,line]] nu[mber] [count] [l]",
"change display to number lines"},
{"open", ex_open, E_ADDR1,
"s",
"[line] o[pen] [/RE/] [flags]",
"enter \"open\" mode (not implemented)"},
{"print", ex_pr, E_ADDR2|E_CLRFLAG,
"ca1",
"[line [,line]] p[rint] [count] [#l]",
"display lines"},
{"preserve", ex_preserve, 0,
"",
"pre[serve]",
"preserve an edit session for recovery"},
{"previous", ex_prev, E_NEWSCREEN,
"!",
"prev[ious][!]",
"edit the previous file in the file argument list"},
{"put", ex_put,
E_ADDR1|E_AUTOPRINT|E_ADDR_ZERO|E_ADDR_ZERODEF,
"b",
"[line] pu[t] [buffer]",
"append a cut buffer to the line"},
{"quit", ex_quit, 0,
"!",
"q[uit][!]",
"exit ex/vi or close the current screen"},
{"read", ex_read, E_ADDR1|E_ADDR_ZERO|E_ADDR_ZERODEF,
"s",
"[line] r[ead] [!cmd | [file]]",
"append input from a command or file to the line"},
{"recover", ex_recover, 0,
"!f1r",
"recover[!] file",
"recover a saved file"},
{"resize", ex_resize, E_VIONLY,
"c+",
"resize [+-]rows",
"grow or shrink the current screen"},
{"rewind", ex_rew, 0,
"!",
"rew[ind][!]",
"re-edit all the files in the file argument list"},
{"s", ex_s, E_ADDR2,
"s",
"[line [,line]] s [[/;]RE[/;]repl[/;] [cgr] [count] [#lp]]",
"substitute on lines matching an RE"},
{"script", ex_script, E_SECURE,
"!f1o",
"sc[ript][!] [file]",
"run a shell in a screen"},
{"set", ex_set, 0,
"wN",
"se[t] [option[=[value]]...] [nooption ...] [option? ...] [all]",
"set options (use \":set all\" to see all options)"},
{"shell", ex_shell, E_SECURE,
"",
"sh[ell]",
"suspend editing and run a shell"},
{"source", ex_source, 0,
"f1r",
"so[urce] file",
"read a file of ex commands"},
{"stop", ex_stop, E_SECURE,
"!",
"st[op][!]",
"suspend the edit session"},
{"suspend", ex_stop, E_SECURE,
"!",
"su[spend][!]",
"suspend the edit session"},
{"t", ex_copy, E_ADDR2|E_AUTOPRINT,
"l1",
"[line [,line]] t line [flags]",
"copy lines elsewhere in the file"},
{"tag", ex_tag_push, E_NEWSCREEN,
"!w1o",
"ta[g][!] [string]",
"edit the file containing the tag"},
{"tagnext", ex_tag_next, 0,
"!",
"tagn[ext][!]",
"move to the next tag"},
{"tagpop", ex_tag_pop, 0,
"!w1o",
"tagp[op][!] [number | file]",
"return to the previous group of tags"},
{"tagprev", ex_tag_prev, 0,
"!",
"tagpr[ev][!]",
"move to the previous tag"},
{"tagtop", ex_tag_top, 0,
"!",
"tagt[op][!]",
"discard all tags"},
{"undo", ex_undo, E_AUTOPRINT,
"",
"u[ndo]",
"undo the most recent change"},
{"unabbreviate",ex_unabbr, 0,
"w1r",
"una[bbrev] word",
"delete an abbreviation"},
{"unmap", ex_unmap, 0,
"!w1r",
"unm[ap][!] word",
"delete an input or command map"},
{"v", ex_v, E_ADDR2_ALL,
"s",
"[line [,line]] v [;/]RE[;/] [commands]",
"execute a global command on lines NOT matching an RE"},
{"version", ex_version, 0,
"",
"version",
"display the program version information"},
{"visual", ex_visual, E_ADDR1|E_ADDR_ZERODEF,
"2c11",
"[line] vi[sual] [-|.|+|^] [window_size] [flags]",
"enter visual (vi) mode from ex mode"},
{"visual", ex_edit, E_NEWSCREEN,
"f1o",
"vi[sual][!] [+cmd] [file]",
"edit another file (from vi mode only)"},
{"viusage", ex_viusage, 0,
"w1o",
"[viu]sage [key]",
"display vi key usage statement"},
{"write", ex_write, E_ADDR2_ALL|E_ADDR_ZERODEF,
"!s",
"[line [,line]] w[rite][!] [ !cmd | [>>] [file]]",
"write the file"},
{"wn", ex_wn, E_ADDR2_ALL|E_ADDR_ZERODEF,
"!s",
"[line [,line]] wn[!] [>>] [file]",
"write the file and switch to the next file"},
{"wq", ex_wq, E_ADDR2_ALL|E_ADDR_ZERODEF,
"!s",
"[line [,line]] wq[!] [>>] [file]",
"write the file and exit"},
{"xit", ex_xit, E_ADDR2_ALL|E_ADDR_ZERODEF,
"!f1o",
"[line [,line]] x[it][!] [file]",
"write if modified and exit"},
{"yank", ex_yank, E_ADDR2,
"bca",
"[line [,line]] ya[nk] [buffer] [count]",
"copy lines to a cut buffer"},
{"z", ex_z, E_ADDR1,
"3c01",
"[line] z [-|.|+|^|=] [count] [flags]",
"display different screens of the file"},
{"~", ex_subtilde, E_ADDR2,
"s",
"[line [,line]] ~ [cgr] [count] [#lp]",
"replace previous RE with previous replacement string"},
{NULL},
};