Vim Tips Wiki
(Add comment: Does not work for me)
m (comment)
Line 18: Line 18:
   
 
This will cause files with no extension (e.g. "Makefile") to open automatically in Vim.
 
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.
   
 
==Comments==
 
==Comments==
Line 41: Line 43:
 
[[User:Carpetsmoker|Carpetsmoker]] 18:00, 13 April 2008 (UTC)
 
[[User:Carpetsmoker|Carpetsmoker]] 18:00, 13 April 2008 (UTC)
 
----
 
----
  +
  +
: I log out and back in and it does work, pfffft, Windows O.o [[User:Carpetsmoker|Carpetsmoker]] 18:36, 13 April 2008 (UTC)
   
 
[[Category:File Handling]]
 
[[Category:File Handling]]

Revision as of 18:36, 13 April 2008

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.

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)