From 4455fc3f05ccee06d416d269d3a83a423b0b15b8 Mon Sep 17 00:00:00 2001 From: Michael Reed Date: Sun, 19 Jul 2015 06:14:26 -0400 Subject: 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 Helped-by: @jusga --- runtime/doc/index.txt | 1 - runtime/doc/map.txt | 5 +---- runtime/doc/usr_40.txt | 4 ++-- runtime/doc/various.txt | 7 ------- runtime/doc/vim_diff.txt | 1 + runtime/syntax/vim.vim | 4 ++-- src/nvim/ex_cmds.lua | 6 ------ src/nvim/ex_docmd.c | 5 ++--- 8 files changed, 8 insertions(+), 25 deletions(-) diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt index fd5bf1c50e..a1f593765f 100644 --- a/runtime/doc/index.txt +++ b/runtime/doc/index.txt @@ -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 diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt index 699915a86f..37e1235a81 100644 --- a/runtime/doc/map.txt +++ b/runtime/doc/map.txt @@ -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. diff --git a/runtime/doc/usr_40.txt b/runtime/doc/usr_40.txt index 9d706481df..b802c9534a 100644 --- a/runtime/doc/usr_40.txt +++ b/runtime/doc/usr_40.txt @@ -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: > diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt index a241e2beaf..5fb6dac402 100644 --- a/runtime/doc/various.txt +++ b/runtime/doc/various.txt @@ -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* diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index 5e6a89b7fe..a586fe4644 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -150,6 +150,7 @@ Other options: 'weirdinvert' Other commands: + :Print :fixdel :mode (no longer accepts an argument) :shell diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index eae973fa90..198c159dee 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -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 "\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)) -- cgit