-3

I would like to set gvim as the default program for opening files which do not have an extension (e.g. no .txt, .php, .js, .css, .html etc... suffix as part of the file name; for instance the file could be simply called README or INSTALL).

I would like to do this on any version of Windows (although I am currently running Windows 7).

closed as off-topic by toro2k, kenorb, Martin Tournoij, Doorknob, muru Mar 8 '15 at 18:27

  • This question does not appear to be about Vi and Vim family of editors, within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 7
    I'm voting to close this question as off-topic because it is about the configuration of the Windows operating system. – toro2k Mar 6 '15 at 11:28
  • 3
    superuser.com/a/13947/334516 - apparently someone got the answer from the Vim Wikia. :D – muru Mar 6 '15 at 12:44
  • 2
    This is a useful question as such, but I agree with @toro2k that this question belongs on SuperUser.com. It has almost nothing to do with Vim. – Martin Tournoij Mar 6 '15 at 19:44
2

You must have full Administrator privileges to set the default program to launch when files with no extension are clicked. From a DOS prompt:

Use the assoc command with the extension . (which is used to denote the case where no file extension is present) and specify "No Extension" as the file type to associate with such extension:

assoc .="No Extension"

Now use the ftype command to specify the command to run when a file with no extension is clicked (the following assumes the latest version of Vim is installed in its default location on the C: drive):

ftype "No Extension"="C:\Program Files (x86)\Vim\vim74\gvim.exe" "%1"

Not the answer you're looking for? Browse other questions tagged or ask your own question.