Thursday, August 2, 2012

Windows : autocmd fires up on right-click "edit with vim", not on double click

Hi all,

I'm having an issue running Vim 7.3 on my Windows 7 workstation. I'm using it partly for editing todo files, for which I created a simple custom syntax file. I use the following command to use my syntax file on *.todo files, in my vimrc :

$ au BufNewFile,BufRead *.todo set ft=todo

This works perfectly when I open the files using right-click "Edit with Vim" entry, but it doesn't when I double click the file in the explorer, or use the app launcher launchy (http://launchy.net) to open the file (":set ft" returns nothing, and the syntax highlighting is indeed not applied).

I made some tests and tried to apply the filetype to txt files as well using the following command in my vimrc :

$ au BufNewFile,BufRead *.txt set ft=todo

...and it's working great in both cases. Any idea what I'm missing here ? I made some research this morning, went through some help files and tried other autocmd events, but didn't find anything better.

Thanks for your help !
Cheers,

Paddy

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: