Scholte, J.C.M. wrote:
> Is there a way to (automaticaly) make a logging of the files edited?
> Hans Scholte
I believe that it is possible to log all messages to a file, _including_
messages about files read or written, see ":help :redir"; however, you
would thereby be depriving yourself of the usefulness of the ":redir"
command for other purposes (for instance, redirecting the output of
":version" to the clipboard in order to paste it into an email). Also,
some scripts use ":redir" internally, and you would have to avoid them.
Another possibility would be to cabbrev e -- or maybe to intercept the
BufReadPost, BufNewFile, etc. events -- in order to log the editfile
(and possibly the date, time, etc.) at the end of some logfile: either
:cabbrev e Edit
:autocmd BufReadPost,BufNewFile * call LogEditFile()
"The details of the solution are left as an exercise to the reader." ;-)
> Is there a way to (automaticaly) make a logging of the files
My first thought would be putting the following three lines in my
au filelogging BufRead * redir >> /path/to/filelog.txt | echo
expand("%") | redir END
This doesn't capture new (":new" or ":enew") buffers, or reading
with ":r" but it should do for regular file editing. It also has
an annoying side effect that you have to press Enter to dismiss
the "Hit ENTER or type command to continue" message.
One might be able to jockey/tweak the items in the 'shortmess'
setting to eliminate the "Hit ENTER" prompt, but when you start
adding that much code, I'd create a function to simply log the
current file name, and then have my autocmd call that function.