For Windows users that use file associations to [[Launch_files_in_new_tabs_under_Windows|automatically launch files in Vim]], a gem I've found is, in a command prompt window:
+
For Windows users that use [[Windows file associations]] to [[Launch_files_in_new_tabs_under_Windows|automatically launch files in Vim]], a gem I've found is, in a command prompt window:
<pre>
<pre>
Line 23:
Line 23:
You may need to logout and log back in before this will take effect.
You may need to logout and log back in before this will take effect.
−
==Comments==
+
{{RegistryWarning}}
−
Thisdoesn'tseem to workforme.
+
Youcanalso use the Windows Registry to setupthe extensionless file association. For example, by importing the following registry file (adjust for correct Vim version):
−
I've set ftype:
+
<pre>
−
C:\>ftype|greptxtfile
+
WindowsRegistryEditorVersion 5.00
−
txtfile="C:\Program Files\Vim\vim71\gvim.exe"
+
[HKEY_CLASSES_ROOT\.]
+
[HKEY_CLASSES_ROOT\.\shell]
+
[HKEY_CLASSES_ROOT\.\shell\open]
+
[HKEY_CLASSES_ROOT\.\shell\open\command]
+
@="\"C:\\Vim\\vim61\\gvim.exe\" \"%1\""
+
</pre>
−
ThenI set assoc:
+
==Seealso==
−
C:\>assoc|grep .=txt
+
*[[VimTip279]]forautomaticallylaunching Vim for files which may have an extension but have no file association.
−
.=txtfile
−
This method does work for file extensions (.abcd) but not for extension-less files, I still get the "Open with ..." dialog.
+
==Comments==
−
−
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?
−
−
[[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)
−
−
----
−
I'm on vista, the .= method worked for me right away, without the need to log off.
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.
WARNING: Editing your Windows registry may cause unintended side effects that render your system inoperable. Although this tip has worked in the past for some people, there is no guarantee that it will work for you. Use with caution, and at your own risk.
You can also use the Windows Registry to set up the extensionless file association. For example, by importing the following registry file (adjust for correct Vim version):
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.]
[HKEY_CLASSES_ROOT\.\shell]
[HKEY_CLASSES_ROOT\.\shell\open]
[HKEY_CLASSES_ROOT\.\shell\open\command]
@="\"C:\\Vim\\vim61\\gvim.exe\" \"%1\""