embear / vim-localvimrc

Search local vimrc files (".lvimrc") in the tree (root dir up to current dir) and load them.
http://www.vim.org/scripts/script.php?script_id=441
GNU General Public License v3.0
484 stars 28 forks source link

Example #41

Closed aemonge closed 8 years ago

aemonge commented 8 years ago

I'm trying to au BufRead,BufNewFile,BufReadPost *.html set filetype=javascript but I really don't know how to do it in the _vimrc_local.vim file. I've also tryied to do it in a _vimrc_local.html file, but seams not to work.

embear commented 8 years ago

I'm not really understanding what you are trying to do. I suspect you want to set the filetype to javascript for files contained in a specific directory/tree and matching *.html. To achieve this just add a file named .lvimrc to this directory/tree containing theses lines:

if expand("<afile>:e") ==? 'html'
  set filetype=javascript
endif

If this is not the answer to your question please go into more detail...

aemonge commented 8 years ago

That's exactly what I meant !!! Thank you so very much !!!