by Rob
24. January 2010 17:13
I've recently been following the Is This Thing On - Visual Studio 2010 tip of the day series. I highly recommend subscribing. The best tip yet was around Reference highlighting. In a nut shell every time you move over a symbol all instances are highlighted. You can see below that all references have been highlighted for MainWindow:

Once the symbols have been highlighted you can move to the next occurrence with Ctrl+Shift+Down Arrow and move to the previous occurrence with Ctrl+Shift+Up Arrow. For ViEmu users it will be unnatural to reach over for the arrow keys, so it's time to remap these using AutoHotkey. The idea is based on this blog post by JP Boodhoo where he maps ReSharper Go to next member to Alt+J and ReSharper Go to Previous Member to Alt+K. So here’s the update you need for your AutoHotkey script:
$^+k:: send, ^+{up}
$^+j:: send, ^+{down}
This will map Ctrl+Shift+J to Ctrl+Shift+Down Arrow and Ctrl+Shift+K to Ctrl+Shift+Up Arrow. Now you can happily move between highlighted references without leaving the home row.
Enjoy
by Rob
16. January 2010 14:47
I use GVim a lot for editing most types of files. More than likely I'll launch files straight from a command line. One problem with this method is that each file appears in a new instance of GVim. This can quickly become difficult to manage. You can solve this problem by using the clientserver feature of GVim. Below is what the documentation says about clientserver functionality.
When compiled with the |+clientserver| option, Vim can act as a command server. It accepts messages from a client and executes them.
This means that your shell of choice can act as a client and fire commands to an existing instance of GVim. I use PowerShell ISE for simple file operations and launch all my programs from there. To launch a named server instance of GVim I run the following command:
C:\Mydrop~1\Apps\gVimPortable\gVimPortable.exe --servername gvim
I keep GVim in my DropBoxso it moves with me to other computers. So you'll need to edit the path to the location of GVim on your computer. The servername argument is set to the name gvim, but you can set this to anything you like.
Now when you wish to open a new tab in this instance run the following command:
C:\Mydrop~1\Apps\gVimPortable\gVimPortable.exe --servername GVIM --remote-tab .\main.ahk
In my case this launches the main AutoHotkey script into a new tab in the existing instance of GVim. You may be thinking this will mean more typing and ultimately take more time. To speed this whole process up I store a couple of snippets in an AutoHotkey script. This allows me to type "gvit" and expand this out to:
C:\Mydrop~1\Apps\gVimPortable\gVimPortable.exe --servername GVIM --remote-tab
I can then just add the file name to the end of the command to launch into my gvim instance. Not everyone's cup of tea, but I hope someone will find this useful. To find out more about snippets in AutoHotkey you can take a look at another of my blog posts.
del.icio.us Tags:
GVim,
AutoHotkey