Tuesday, February 26, 2013

Re: How to refresh (reload) an opened file?

* Tim Chase <vim@tim.thechases.com> [2013-02-26 20:36]:
> Or, you can leave the current buffer pointed at
> the file and read the new file into a new buffer:
> :new " create a new empty buffer
> :r filename.txt " read in the contents from disk
> :1d " delete the initial blank line

slight variation:

:new " create a new empty buffer
:r # " read in the contents from disk
:1d " delete the initial blank line

where the '#' is the "alternate file name" (read:
the file name associated with the alternate buffer).

you can probably map this to a key...

map <f9> :new|:r #|:1d

but when i enter this mapping then the '#' is
expanded right away and gives me an error:

E484: Can't open file #

how to stop that from happening again?

Sven

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment