m (See your vim templates in Windows Explorer's New context menu moved to Add Vim to the Windows Explorer context menu: Page moved by JohnBot to improve title) |
(Change <tt> to <code>, perhaps also minor tweak.) |
||
(6 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
{{review}} |
{{review}} |
||
+ | {{TipImported |
||
− | {{Tip |
||
|id=640 |
|id=640 |
||
+ | |previous=639 |
||
− | |title=See your vim templates in Windows Explorer's New context menu |
||
+ | |next=641 |
||
− | |created= |
+ | |created=2004 |
|complexity=basic |
|complexity=basic |
||
|author=Mark Fernandes |
|author=Mark Fernandes |
||
|version=5.7 |
|version=5.7 |
||
|rating=4/3 |
|rating=4/3 |
||
+ | |category1=Windows |
||
− | |text= |
||
+ | |category2= |
||
⚫ | |||
⚫ | |||
+ | {{deprecated|All Windows installers for Vim that I've seen will create the context menu entry for you. Make sure to 'run as admin'}} |
||
+ | {{dodgy|What on earth is the .vtd file for?}} |
||
⚫ | |||
⚫ | |||
− | you right click in Windows Explorer? If so then read on, following these steps |
||
+ | <pre> |
||
− | sequentially: |
||
⚫ | |||
⚫ | |||
⚫ | |||
+ | </pre> |
||
+ | Call the above sample template file GVIM.vtd and save it in the "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. |
||
⚫ | |||
+ | Click Start, Run and enter <code>regedit</code>. |
||
− | sample: |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
+ | *Double click the "(Default)" value of "command" and change it to point to the location of gvim.exe on your system. I entered the following in the text field "Value data" <code>C:\PROGRA~1\Vim\vim62\gvim.exe "%1"</code> |
||
⚫ | |||
⚫ | |||
− | -[sample template file begins below this line]- |
||
+ | Click on "ShellNew" and add a string value called "FileName". Double click on "FileName" and enter<code> GVIM.vtd</code> |
||
+ | In Windows Explorer, navigate to any directory. Right click 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. |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
+ | {{todo}} |
||
− | |||
+ | '''The installers don't seem to create the context menu entries on 64-bit Windows XP (and possibly other 64-bit systems.''' Maybe we should resurrect this tip? Or maybe we have another tip on this? |
||
⚫ | |||
+ | --[[User:Fritzophrenic|Fritzophrenic]] 16:12, January 3, 2012 (UTC) |
||
− | |||
− | -[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 |
||
− | |||
− | |||
− | |||
⚫ | |||
− | |||
⚫ | |||
− | |||
− | - next scroll into: |
||
− | |||
⚫ | |||
− | |||
− | - and add a key; call it "open" |
||
− | |||
− | - once more scroll into: |
||
− | |||
⚫ | |||
− | |||
− | - 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. |
||
− | |||
− | |||
− | |||
⚫ | |||
− | |||
− | 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! |
||
− | |||
− | |||
⚫ | |||
− | |||
⚫ | |||
− | Sorry I forgot to add this important information too... |
||
− | - In the registry editor (Start->Run->regedit) goto HKEY_CLASSES_ROOT and then |
||
⚫ | |||
⚫ | |||
⚫ | |||
− | double click on "FileName" and enter GVIM.vtd |
||
− | |||
− | |||
− | Mark Fernandes |
||
− | , January 20, 2004 20:42 |
||
---- |
---- |
||
⚫ | |||
− | I found this truly useful! Thanks. |
||
− | |||
⚫ | |||
⚫ | |||
− | |||
⚫ | |||
⚫ | |||
⚫ | |||
− | - next click on "ShellNew" and add a String Value; call it "FileName"; |
||
− | double click on "FileName" and enter GVIM.vtd |
||
− | with - next click on "ShellNew" and add a String Value; call it "NullFile"; |
||
− | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
+ | :Click on "ShellNew" and add a string value called "FileName". Double click on "FileName" and enter<code> GVIM.vtd</code> |
||
+ | *to |
||
⚫ | |||
− | hugokraw--AT--gmail.com |
||
− | , August 31, 2006 13:25 |
||
---- |
---- |
||
− | <!-- parsed by vimtips.py in 0.484844 seconds--> |
Latest revision as of 05:40, 13 July 2012
created 2004 · complexity basic · author Mark Fernandes · version 5.7
This tip is deprecated for the following reasons:
All Windows installers for Vim that I've seen will create the context menu entry for you. Make sure to 'run as admin'
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. Example contents:
--------------------------------End of Text---------------------------------- The line below controls Vim, which you can get free from: http://www.vim.org/ vim:tw=80:ai:ft=txt:norl:
Call the above sample template file GVIM.vtd and save it in the "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.
Click Start, Run and enter regedit
.
In the registry, scroll HKEY_CLASSES_ROOT until you get to Vim.Application
- Add a key called "shell".
- In [HKEY_CLASSES_ROOT\Vim.Application\shell] and a key called "open".
- In [HKEY_CLASSES_ROOT\Vim.Application\shell\open] and a key called "command".
- Double click the "(Default)" value of "command" and change it to point to the location of gvim.exe on your system. I entered the following in the text field "Value data"
C:\PROGRA~1\Vim\vim62\gvim.exe "%1"
In regedit, find HKEY_CLASSES_ROOT and scroll to ".vtd", then change the string value (Default) to Vim.Application
Click on [HKEY_CLASSES_ROOT\.vtd] and add a key called "ShellNew".
Click on "ShellNew" and add a string value called "FileName". Double click on "FileName" and enter GVIM.vtd
In Windows Explorer, navigate to any directory. Right click 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 new files that you create.
Comments[]
TO DO
The installers don't seem to create the context menu entries on 64-bit Windows XP (and possibly other 64-bit systems. Maybe we should resurrect this tip? Or maybe we have another tip on this?
--Fritzophrenic 16:12, January 3, 2012 (UTC)
You can also do without the template file.
In this case, when right clicking on New->vim an empty file called "New Vim.vtd" is created which inherits all the setting defined in vimrc. I find this more useful and it also simplifies the instructions.
The only changes to the instructions in this tip are
- Skip the whole creation of the file gvim.vtd
- Change the instructions:
- Click on "ShellNew" and add a string value called "FileName". Double click on "FileName" and enter
GVIM.vtd
- to
- Click on "ShellNew" and add a string value called "NullFile".