Dear list members,

Since not all commands are allowed in a modeline.
I guess inoremap is one of them.

How could I use such a comment only for a specific file
(not for a filetype)?

Vim help gives the hint:

 >If you would like to do something else than setting an option, you could
 >define an autocommand that checks the file for a specific string.  For
 >example:
 >>    au BufReadPost * if getline(1) =~ "VAR" | call SetVar() | endif

Could I use something like this in my .vimrc?

au BufReadPost * if getline(1) =~ "% inoremap ' x" | inoremap ' x |
endif

Are better options available?
For instance if I want to execute a lot of commands not allowed from
modeline?

I know about the localvimrc plugin and the (less safe) dirsettings
plugin.
But they work directory specific and not file specific.

Thanks in advance,

Adriaan.


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to