Tip 1301 Printable Monobook Previous Next

created August 10, 2006 · complexity basic · author John Little · version 5.7

For Windows users that use file associations to automatically launch files in Vim, a gem I've found is, in a command prompt window:

assoc .=txtfile

Where txtfile has been defined as a file type that is opened with Vim. See VimTip1003, and try ftype /? at the command prompt.

This will cause files with no extension (e.g. "Makefile") to open automatically in Vim.

You may need to logout and log back in before this will take effect.


This doesn't seem to work for me.

I've set ftype:

C:\>ftype | grep txtfile
txtfile="C:\Program Files\Vim\vim71\gvim.exe"

Then I set assoc:

C:\>assoc | grep .=txt

This method does work for file extensions (.abcd) but not for extension-less files, I still get the "Open with ..." dialog.

What does work for me is:

C:\>assoc *=txtfile

I'm not a Windows expert, but AFAIK this is the correct method for associating files without an extension.

Does anyone know how these two are different?

Carpetsmoker 18:00, 13 April 2008 (UTC)

I log out and back in and it does work, pfffft, Windows O.o Carpetsmoker 18:36, 13 April 2008 (UTC)

I'm on vista, the .= method worked for me right away, without the need to log off.

Community content is available under CC-BY-SA unless otherwise noted.