Remove ':Print' command #3049

There's no way this isn't some long-running joke:

  "Just as ':print'.  Was apparently added to Vi for
  people that keep the shift key pressed too long..."
  Note: A user command can overrule this command.

Regarding ':X': the command has been removed for a while, but the
documentation must have been missed, so remove it here.

Reviewed-by: Justin M. Keyes <justinkz@gmail.com>
Helped-by: @jusga
This commit is contained in:
Michael Reed
2015-07-19 06:14:26 -04:00
parent bd753bdacc
commit 4455fc3f05
8 changed files with 8 additions and 25 deletions

View File

@@ -1070,7 +1070,6 @@ tag command action ~
|:@| :@ execute contents of a register
|:@@| :@@ repeat the previous ":@"
|:Next| :N[ext] go to previous file in the argument list
|:Print| :P[rint] print lines
|:append| :a[ppend] append text
|:abbreviate| :ab[breviate] enter abbreviation
|:abclear| :abc[lear] remove all abbreviations

View File

@@ -1132,9 +1132,7 @@ For starters: See section |40.2| in the user manual.
All user defined commands must start with an uppercase letter, to avoid
confusion with builtin commands. Exceptions are these builtin commands:
:Next
:X
They cannot be used for a user defined command. ":Print" is also an existing
command, but it is deprecated and can be overruled.
They cannot be used for a user defined command.
The other characters of the user command can be uppercase letters, lowercase
letters or digits. When using digits, note that other commands that take a
@@ -1154,7 +1152,6 @@ Example: >
:Renu " Means "Renumber"
:Ren " Error - ambiguous
:command Paste ...
:P " The built-in :Print
It is recommended that full names for user-defined commands are used in
scripts.

View File

@@ -290,8 +290,8 @@ deletes the first line.
Note:
User-defined commands must start with a capital letter. You cannot
use ":X", ":Next" and ":Print". The underscore cannot be used! You
can use digits, but this is discouraged.
use ":Next". The underscore cannot be used! You can use digits, but
this is discouraged.
To list the user-defined commands, execute the following command: >

View File

@@ -89,13 +89,6 @@ g8 Print the hex values of the bytes used in the
:[range]p[rint] {count} [flags]
Print {count} lines, starting with [range] (default
current line |cmdline-ranges|).
See |ex-flags| for [flags].
*:P* *:Print*
:[range]P[rint] [count] [flags]
Just as ":print". Was apparently added to Vi for
people that keep the shift key pressed too long...
Note: A user command can overrule this command.
See |ex-flags| for [flags].
*:l* *:list*

View File

@@ -150,6 +150,7 @@ Other options:
'weirdinvert'
Other commands:
:Print
:fixdel
:mode (no longer accepts an argument)
:shell

View File

@@ -26,8 +26,8 @@ syn keyword vimCommand contained al[l] argg[lobal] bad[d] bm[odified] brea[k] bu
syn keyword vimCommand contained ar argl[ocal] ba[ll] bn[ext] breaka[dd] buf c cal[l] ce[nter] cg[etfile] cl cN cnf[ile] comp[iler] cpf[ile] cstag debugg[reedy] deletel dell diffo[ff] dig dli[st] dsp[lit] echom[sg] en endt[ry] f fina[lly] foldc[lose] fun gui helpg[rep] ia in ju[mps] keepp[atterns] laddf[ile] lb[uffer] le[ft] lgete[xpr] ll lne lnf[ile] loc[kmarks] lr[ewind] lv[imgrep] marks mk mkv[imrc] new nu[mber] opt[ions] pe[rl] pr prof[ile] ptj[ump] ptp[revious] py3 q
syn keyword vimCommand contained helpc[lose] nos[wapfile]
syn match vimCommand contained "\<z[-+^.=]\="
syn keyword vimOnlyCommand contained fix[del] sh[ell]
syn keyword vimStdPlugin contained DiffOrig Man N[ext] P[rint] S TOhtml XMLent XMLns
syn keyword vimOnlyCommand contained fix[del] sh[ell] P[rint]
syn keyword vimStdPlugin contained DiffOrig Man N[ext] S TOhtml XMLent XMLns
" vimOptions are caught only when contained in a vimSet {{{2
syn keyword vimOption contained acd ambiwidth arabicshape autowriteall backupdir bdlay binary breakat bufhidden cd ci cinw co commentstring confirm cpoptions cscoperelative csre cursorcolumn delcombine diffopt ea efm ep et fdc fdo ffs filetype fo foldlevelstart formatexpr ft gfw gtt guipty hh hkmap ic imaf iminsert includeexpr inf isident langmap lines lmap ma matchtime mco ml modeline mousefocus mousetime nrformats ofu para pdev pi previewwindow printmbfont qe relativenumber rightleftcmd ru sbr scrolloff selection shellcmdflag shellxescape showbreak si smartcase softtabstop spelllang sps sta su swb synmaxcol tagbsearch thesaurus titlestring tpm ttm ttytype undodir ut vfile vop wcm whichwrap wildignore winaltkeys winminwidth wmnu write

View File

@@ -3164,12 +3164,6 @@ return {
addr_type=ADDR_LINES,
func='ex_previous',
},
{
command='Print',
flags=bit.bor(RANGE, WHOLEFOLD, COUNT, EXFLAGS, TRLBAR, CMDWIN),
addr_type=ADDR_LINES,
func='ex_print',
},
{
command='~',
enum='CMD_tilde',

View File

@@ -2401,9 +2401,8 @@ static char_u *find_command(exarg_T *eap, int *full)
break;
}
/* Look for a user defined command as a last resort. Let ":Print" be
* overruled by a user defined command. */
if ((eap->cmdidx == CMD_SIZE || eap->cmdidx == CMD_Print)
// Look for a user defined command as a last resort.
if ((eap->cmdidx == CMD_SIZE)
&& *eap->cmd >= 'A' && *eap->cmd <= 'Z') {
/* User defined commands may contain digits. */
while (ASCII_ISALNUM(*p))