Tip #640: See your vim templates in Windows Explorer's New context menu
tip karma |
Rating 0/2, Viewed by 688
|
created: |
|
January 20, 2004 20:17 |
|
complexity: |
|
basic |
author: |
|
Mark Fernandes |
|
as of Vim: |
|
5.7 |
Do you wish you had your own vim settings for a file appear automatically when
you right click in Windows Explorer? If so then read on, following these steps
sequentially:
- Create a template file where the last few lines control vim. See below for a
sample:
-[sample template file begins below this line]-
--------------------------------End of Text----------------------------------
The line below controls vim, which you can get free from: https://www.vim8.org/
vim:tw=80:ai:ft=txt:norl:
-[sample template file ends above this line]-
- Call the above sample template file GVIM.vtd and save it in
"C:\Windows\ShellNew\" directory. You may use another extension, but I
played it safe and used one that wasn't being used on my system. Moreover, I
did not change the default location of Windows installation, but you may
need to do so if your system does not match mine.
- Open Explorer and click on Tools->Folder Options... in the dialog box that
appears, click on File Types and then scroll the file types until you reach
VTD. Click on the file extension VTD and click on Change; now associate
gvim.exe with this file extension.
- Next, open the registry with regedit by clicking on Start->Run and typing
regedit in the Run dialog box
- In the registry, scroll HKEY_CLASSES_ROOT until you get to Vim.Application
- then add a key; call it "shell"
- next scroll into:
[HKEY_CLASSES_ROOT\Vim.Application\shell]
- and add a key; call it "open"
- once more scroll into:
[HKEY_CLASSES_ROOT\Vim.Application\shell\open]
- and add yet another key; call it "command"
- now change, by double clicking on, the "(Default)" value of
"command" to point it to the location of gvim.exe on your
hard drive. On my system, I entered the following in the text
field "Value data"
C:\PROGRA~1\Vim\vim62\gvim.exe "%1"
- Finally open up Explorer and navigate to any directory on your hard drive.
Now, right click on, the pane displaying the files, to see "Vim" as one of
your options. When you choose Vim, you will create a file called "New
Vim.vtd" in that directory. When you open "New Vim.vtd" you should see the
above sample text and Vim uses the settings used in the last line of the file.
- Any changes made to the original template in C:\Windows\ShellNew appear in
the new files that you create.
I tried to get this to work with using TweakUI but that did not help in Windows
XP, so I had to do it the long way. So, I hope this tip helps at least a few of
you,
Enjoy!
<<Comment highlight #ifdef DEBUG for code-read ease (C/C++) |
Highlighting of method names in the definition (C++) >>
Additional Notes
|