Thursday, May 6, 2010

Re: scratch buffer on start up

On 06/05/10 10:37, john Maclean wrote:
> Chaps,
>
> Check this out - going from emacs to vim, (again) as emacs' keybindings
> are a pain on a mac book pro.
>
> There must be a way to have vim create a scratch buffer on start up. At
> the moment am using this -
>
> map <Leader>a :new scratch.foo<cr>
>
> which works but... would be nice to have this automated.
>
>

When you start Vim without a file name, it starts up with an empty
[NoName] buffer. You can then give it any name you want, for instance

:saveas scratch.foo

which will save it to disk (as a zero-length file, if you haven't yet
added anything in it). Or if you don't want to ever save it, just keep
it as [NoName], then you don't even have to rename it. To edit an
existing file in a different window, use

:new foo.txt

(read-write) or

:sview bar.txt

(read-only), in both cases optionally prefixed by :tab if you want to
open it in a new tab page. When you're finished with the [NoName]
buffer, use :q! to quit it without saving. (Of course, if no other
non-help buffer is open in Vim at the time, your Vim session will
terminate.)


Best regards,
Tony.
--
MORTICIAN: What?
CUSTOMER: Nothing -- here's your nine pence.
DEAD PERSON: I'm not dead!
MORTICIAN: Here -- he says he's not dead!
CUSTOMER: Yes, he is.
DEAD PERSON: I'm not!
The Quest for the Holy Grail (Monty
Python)

--
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

No comments: