On Sep 16, 8:14 am, "J.A.J. Pater" <[email protected]> wrote:
> Ben, thanks for your answer!
>
> I think your answer is the way to go.
>
> > If by "specific file" you mean a VERY specific file of a given name
> > (or list of names) then it would be a little safer to structure your
> > autocmd to only file for those specific files:
> >
> > au BufReadPost file1,file2,file3 echomsg "doing the command!"
>
> I see, but I'd be often editing my .vimrc e.g. when changing the
> name of a file.
> So I thought about having vim check for a kind of per file vimrc file
> (e.g. .example.txt.fvimrc for example.txt) so I could automatically
> execute some functions, commands etc. without having to put anything
> inside the file (example.txt).
>
> But in order to pursue that lead I'll have to read a little more about
> programming vim I guess.
>
The filereadable() function may be useful to determine if there is a
file of a given name on your disk, if you make sure that the "per-
file .vimrc" is named in a very predictable way so that you can build
the name from the name of the file you're editing. The :source command
will run it for you (along with :execute so that you can use a
variable name in the :source command).
> Another question tied in with my question is if (and if yes: how)
> I can keep mappings (like inoremap) or functions, local
> (constrained to one buffer or file).
>
> But maybe I should start a new thread for that?
>
Yes, you should start new threads for new questions or you stand the
chance of it being missed.
For this particular question, see :help :map-local. If that doesn't
solve it, start a new thread, don't reply here on this new topic.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---