Wednesday, 23 October 2019

windows - Firefox — How to open a link (to any text-based file) in Vim?

Rather often, I see web pages with links to files that I want to open directly in gVim (when browsing with Firefox on Windows). Chrome-specific answer — also good to have.


Attempting to get this working, I was messing around with Firefox's Tools > Options > Applications settings (where it chooses what to do based on MIME type). To no avail. For most of these files (e.g. Python source files), clicking on them brings up the "Opening filename.py" dialog with the options "Open with", "Save file", and other options. Against "Open With" I can select from a dropdown "Other..." and I get the "Choose Helper Application" dialog. Now, "Vi Improved - A Text Editor" does appear in that list for me, but the problem is that choosing it opens up vim.exe in a shell window, while I want to see gVim.exe. In the "Choose Helper Application", I can select "Browse..." and navigate to Vim's directory, choose "gvim.exe", and then it works. But for the next file, it doesn't remember this setting, and I have to do it all again.


How can I make it stick there, or use another way to easily open files in gVim?


From reading Firefox bug reports, I figured that the "Choose Helper Application" dialog is populated based on the given file's MIME type, and, unless the user changed some settings, this is taken from the Windows Registry. But I want to be able to open any file with gVim, so it's not a good solution for me to set the default in Windows for every extension I possibly want to open.

No comments:

Post a Comment

How can I VLOOKUP in multiple Excel documents?

I am trying to VLOOKUP reference data with around 400 seperate Excel files. Is it possible to do this in a quick way rather than doing it m...