On 2014-12-09, jy yap wrote:

> For example, a computer user opens test123.txt using vim, makes
> some editions and save as test456.txt.
> 
> How can I obtain these filenames so that I could include them in
> my customized logs?

The name of the file in the current buffer is in the % register.
The name of the file matching an autocommand pattern is in <afile>
and/or <amatch>.  See

    :help registers
    :help quote_%
    :help <afile>
    :help filename-modifiers
    :help fnamemodify()
    :help expand()

> Meanwhile, I am experimenting with autocmd. I find that the
> autocmd that I have defined disappears after I close the vim
> program. How can I make the autocmd permanent?

The most common place to put settings and other commands you wish to
make permanent is in your ~/.vimrc file.  See

    :help usr_05.txt

Regards,
Gary

-- 
-- 
You received this message from the "vim_dev" 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_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui