Vim – Open file in existing window new tab on Windows

来源:互联网 发布:天盛网络 编辑:程序博客网 时间:2024/05/29 10:39

Opening files in Vim editor via context menu is quite simple, but what if I want to open a file in a new tab in existing window?
The solution is quite simple, at least on my Windows 7 machine, but I guess it should work also on previous versions of  Windows.
1. Open regedit
2. find HKEY_CLASSES_ROOT/*/shell
3. right click on “shell” folder and create a new Key and call it, i.e. “Open in a new Vim tab”
4. right click on currently created folder and create a new Key called “command”
5. into default string value enter following code:
C:\apps\Vim\vim73\gvim.exe --remote-tab-silent %1
ofcource the path to your gvim executable must be valid.

[custom_frame_center shadow="on"]

[/custom_frame_center]

6. check it

[custom_frame_center shadow="on"]

[/custom_frame_center]


Add icon to your created contextual menu

if you want to add an icon to your contextual shortcut, follow these few steps
1. find your previously created item in regedit

2. right click on the item and select “Expandable string value”

[custom_frame_center shadow="on"]

[/custom_frame_center]

3. change the “Name” of the new value to “Icon”

4. make modification and add path to your icon file

[custom_frame_center shadow="on"]

[/custom_frame_center]

5. check your update

[custom_frame_center shadow="on"]

[/custom_frame_center]


原创粉丝点击