|
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? -- Shawn Wilson 703-517-1201 -- 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 |
|
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 -- 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 |
|
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 |
|
In reply to this post by shawn wilson
Hi shawn!
On Sa, 04 Aug 2012, 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? Here is a patch, allowing :o! diff --git a/src/ex_cmds.h b/src/ex_cmds.h --- a/src/ex_cmds.h +++ b/src/ex_cmds.h @@ -662,7 +662,7 @@ EX(CMD_nunmenu, "nunmenu", ex_menu, EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN), EX(CMD_open, "open", ex_open, - RANGE|EXTRA), + RANGE|EXTRA|BANG), EX(CMD_oldfiles, "oldfiles", ex_oldfiles, BANG|TRLBAR|SBOXOK|CMDWIN), EX(CMD_omap, "omap", ex_map, regards, Christian -- 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 |
|
In reply to this post by shawn wilson
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? Look up the help for :open and you will see that it's not acutally supported. It's an outdated Vi command. Perhaps you want to use :edit ? -- hundred-and-one symptoms of being an internet addict: 213. Your kids start referring to you as "that guy in front of the monitor." /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org /// -- 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 |
| Powered by Nabble | Edit this page |
