Remove :open command

From the documentation itself:

  :[range]o[pen]                 Works like |:visual|: end Ex mode.
                                 {Vi: start editing in open mode}
  ...

  Vim does not support open mode, since it's not really useful.  For
  those situations where ":open" would start open mode Vim will leave Ex
  mode, which allows executing the same commands, but updates the whole
  screen instead of only one line.

Part of the reason behind this is to make removing vi_diff.txt easier,
although it's also because :open is not too useful.

Helped-by: @fdinoff
Helped-by: @dsummersl
Helped-by: @mhinz
Helped-by: @justinmk
This commit is contained in:
Michael Reed 2015-10-30 14:35:12 -04:00
parent 2bc97b2099
commit c40dff6453
8 changed files with 17 additions and 76 deletions

View File

@ -1141,8 +1141,8 @@ If you want to always use ":confirm", set the 'confirm' option.
|:mkvimrc|, |:mksession|, |:mkview|, |:split|,
|:vsplit|, |:tabe|, |:tabnew|, |:cfile|, |:cgetfile|,
|:caddfile|, |:lfile|, |:lgetfile|, |:laddfile|,
|:diffsplit|, |:diffpatch|, |:open|, |:pedit|,
|:redir|, |:source|, |:update|, |:visual|, |:vsplit|,
|:diffsplit|, |:diffpatch|, |:pedit|, |:redir|,
|:source|, |:update|, |:visual|, |:vsplit|,
and |:qall| if 'confirm' is set.
{only in Win32, Athena, Motif, GTK and Mac GUI}
When ":browse" is not possible you get an error

View File

@ -1359,8 +1359,7 @@ tag command action ~
|:number| :nu[mber] print lines with line number
|:nunmap| :nun[map] like ":unmap" but for Normal mode
|:nunmenu| :nunme[nu] remove menu for Normal mode
|:oldfiles| :ol[dfiles] list files that have marks in the ShaDa file
|:open| :o[pen] start open mode (not implemented)
|:oldfiles| :o[ldfiles] list files that have marks in the ShaDa file
|:omap| :om[ap] like ":map" but for Operator-pending mode
|:omapclear| :omapc[lear] remove all mappings for Operator-pending mode
|:omenu| :ome[nu] add menu for Operator-pending mode

View File

@ -1163,13 +1163,13 @@ running) you have additional options:
*:wv* *:wviminfo*
:wv[iminfo][!] [file] Deprecated alias to |:wshada| command.
*:ol* *:oldfiles*
:ol[dfiles] List the files that have marks stored in the ShaDa
*:o* *:ol* *:oldfiles*
:o[ldfiles] List the files that have marks stored in the ShaDa
file. This list is read on startup and only changes
afterwards with ":rshada!". Also see |v:oldfiles|.
The number can be used with |c_#<|.
:bro[wse] ol[dfiles][!]
:bro[wse] o[ldfiles][!]
List file names as with |:oldfiles|, and then prompt
for a number. When the number is valid that file from
the list is edited.

View File

@ -10,33 +10,14 @@ Throughout the help files differences between Vim and Vi/Ex are given in
curly braces, like "{not in Vi}". This file only lists what has not been
mentioned in other files and gives an overview.
1. Simulated command |simulated-command|
2. Missing options |missing-options|
3. Limits |limits|
4. The most interesting additions |vim-additions|
5. Other vim features |other-features|
6. Command-line arguments |cmdline-arguments|
1. Missing options |missing-options|
2. Limits |limits|
3. The most interesting additions |vim-additions|
4. Other vim features |other-features|
5. Command-line arguments |cmdline-arguments|
==============================================================================
1. Simulated command *simulated-command*
This command is in Vi, but Vim only simulates it:
*:o* *:op* *:open*
:[range]o[pen] Works like |:visual|: end Ex mode.
{Vi: start editing in open mode}
:[range]o[pen] /pattern/ As above, additionally move the cursor to the
column where "pattern" matches in the cursor
line.
Vim does not support open mode, since it's not really useful. For those
situations where ":open" would start open mode Vim will leave Ex mode, which
allows executing the same commands, but updates the whole screen instead of
only one line.
==============================================================================
2. Missing options *missing-options*
1. Missing options *missing-options*
These options are in the Unix Vi, but not in Vim.
@ -58,7 +39,7 @@ w1200 number (default 23) *'w1200'*
w9600 number (default 23) *'w9600'*
==============================================================================
3. Limits *limits*
2. Limits *limits*
Vim has only a few limits for the files that can be edited {Vi: can not handle
<Nul> characters and characters above 128, has limited line length, many other
@ -102,7 +83,7 @@ don't want a swap file at all, set 'updatecount' to 0, or use the "-n"
argument when starting Vim.
==============================================================================
4. The most interesting additions *vim-additions*
3. The most interesting additions *vim-additions*
Vi compatibility. |'compatible'|
Although Vim is 99% Vi compatible, some things in Vi can be
@ -744,7 +725,7 @@ The "No lines in buffer" message is a normal message instead of an error
message, since that may cause a mapping to be aborted.
==============================================================================
6. Command-line arguments *cmdline-arguments*
5. Command-line arguments *cmdline-arguments*
Different versions of Vi have different command-line arguments. This can be
confusing. To help you, this section gives an overview of the differences.

View File

@ -210,6 +210,7 @@ Other commands:
:Print
:fixdel
:mode (no longer accepts an argument)
:open
:shell
:tearoff

View File

@ -19,7 +19,7 @@ syn cluster vimCommentGroup contains=vimTodo,@Spell
" Special and plugin vim commands {{{2
syn match vimCommand contained "\<z[-+^.=]\="
syn keyword vimOnlyCommand contained fix[del] sh[ell] P[rint]
syn keyword vimOnlyCommand contained fix[del] op[en] sh[ell] P[rint]
syn keyword vimStdPlugin contained DiffOrig Man N[ext] S TOhtml XMLent XMLns
" Vim-specific options {{{2

View File

@ -1753,12 +1753,6 @@ return {
addr_type=ADDR_LINES,
func='ex_menu',
},
{
command='open',
flags=bit.bor(RANGE, BANG, EXTRA),
addr_type=ADDR_LINES,
func='ex_open',
},
{
command='oldfiles',
flags=bit.bor(BANG, TRLBAR, SBOXOK, CMDWIN),

View File

@ -6466,40 +6466,6 @@ static void ex_find(exarg_T *eap)
}
}
/*
* ":open" simulation: for now just work like ":visual".
*/
static void ex_open(exarg_T *eap)
{
regmatch_T regmatch;
char_u *p;
curwin->w_cursor.lnum = eap->line2;
beginline(BL_SOL | BL_FIX);
if (*eap->arg == '/') {
/* ":open /pattern/": put cursor in column found with pattern */
++eap->arg;
p = skip_regexp(eap->arg, '/', p_magic, NULL);
*p = NUL;
regmatch.regprog = vim_regcomp(eap->arg, p_magic ? RE_MAGIC : 0);
if (regmatch.regprog != NULL) {
regmatch.rm_ic = p_ic;
p = get_cursor_line_ptr();
if (vim_regexec(&regmatch, p, (colnr_T)0))
curwin->w_cursor.col = (colnr_T)(regmatch.startp[0] - p);
else
EMSG(_(e_nomatch));
vim_regfree(regmatch.regprog);
}
/* Move to the NUL, ignore any other arguments. */
eap->arg += STRLEN(eap->arg);
}
check_cursor();
eap->cmdidx = CMD_visual;
do_exedit(eap, NULL);
}
/*
* ":edit", ":badd", ":visual".
*/