Friday, August 3, 2012

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

Paddy wrote:
> 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

It's a long time since I thought about this, but while your
command should work, I think the "proper" procedure is to create
file $HOME/vimfiles/filetype.vim (on Windows) with content like:

if exists("did_load_filetypes")
finish
endif
augroup filetypedetect
au! BufNewFile,BufRead *.csv setf csv
au! BufNewFile,BufRead *.todo setf todo
augroup END

My guess is that you are invoking a different Vim, or invoking
the same Vim with some different environment. When it works, use
the following to capture the scripts that have been loaded. Then
do the same when it does not work and compare.

:set nomore
:redir @a
:scriptnames
:redir END
:new
:put a
:set more

John

--
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: