History Report a problem
Article Edit this page Discussion

Associate files with no extension to Vim under Windows

From Vim Tips Wiki

(Redirected from VimTip1301)
Jump to: navigation, search

Tip 1301 Previous TipNext Tip

Created: August 10, 2006 Complexity: basic Author: John Little Minimum version: 5.7 Karma: 87/32 Imported from: Tip#1301


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.

[edit] Comments

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
.=txtfile

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)

Rate this article:

Share this article:

Hubs Highlights International Sites Wikia messages
Entertainment
Gaming
Cartoons & Comics
Science Fiction
Hobbies
Sports
See all...
Grand Theft Auto
Pushing Daisies
Legend of Zelda Wiki
Terminator Wiki
Everquest II Wiki
Astronomy Wiki
German
Spanish
Chinese
Japanese
More...
Wikia is hiring for several open positions


Vote for featured Wikia!

Send this article to a friend
"Associate files with no extension to Vim under Windows"
 
 
Hi!

I thought you'd like this page from Wikia!

http://vim.wikia.com

Come check it out!
Send confirmation