Hi,
I sometimes open files with names like
display.c_bla
I want vim to understand that whatever comes after the underscore
should not matter in the filetype detection.
Now this is fairly easy if the extension (.c) is also the name of the
filetype (c):
autocmd BufReadPost,BufNewFile *.*_* execute "set filetype=" . expand
("%:e")[0 : (stridx(expand("%:e"), "_")) - 1]
(is there a cleverer way to do the same thing?)
But what if I have
display.cxx_bla
where the extension is "cxx" but the corresponding filetype is "cpp"?
Is there a way to tell vim:
- ignore what comes after the underscore, and *autoset* the filetype
according to what's left
instead of
- ignore what comes after the underscore, and set the filetype to
what's left?
Thanks,
Sam
- ignore what comes after the underscore, and *autoset* the filetype
according to what's left in the extension?
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---