On 04/08/12 23:31, Florian Rehnisch wrote:
> On Sat, Aug 04, 2012 at 04:50:20PM -0400, shawn wilson wrote:
>> so, i go to open a file:
>> :o t2.pl
>> E37: No write since last change (add ! to override)
>>
>> ok, fine:
>> :o! t2.pl
>> E477: No ! allowed
>>
>> so, what is the issue and shouldn't the error be better / more descriptive?
>
> Yepp, there is an inconsitency between ":open! file" and
> ":visual! file"/":edit! file" (The latter two silently
> drop your old changes).
>
> In Joy's good old vi :open stood for something
> completely different, namely switch to a mode
> suited for really dumb terminals.
>
> Vi clones don't have this open mode, so :open
> was aliased to :visual in Vim.
>
> But to implement the ! flag was forgotten, as
> nearly everyone would use :edit to load
> another file, I guess.
>
> flori
>
There is no :open file, it's :open or :open /pattern/, to simulate
legacy Vi's command for going out of ex mode into open mode (in Vim:
into Normal mode): a rarely used command in Vim, except maybe for vi
old-timers. In no case does it open a new file. See :help :open
To open a file in a running Vim, there is:
:e[dit] file
open the new file in the current window
one of
:new file
:sp[lit] file
open the file in a new window in the current tab
one of
:tabnew file
:tabe[dit] file
:tab new file
:tab sp[lit] file
open the file in a new tab
or, in the same order but readonly
:vie[w] file " same window
:sv[iew] file " new window, same tab
:tab sv[iew] file " new tab
Don't type the brackets, of course: they are just there to show how far
the command names may be abbreviated.
Best regards,
Tony.
--
You know you've been spending too much time on the computer when your
friend misdates a check, and you suggest adding a "++" to fix it.
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Sunday, August 5, 2012
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment