About Me

Training

Nothin But .Net Developer Bootcamp

Navigation

Search

Categories

On this page

VS + ViEmu + (ReSharper modded with AutoHotkey)

Archive

Blogroll

 Agile Developer Venkat's Blog
 Ayende @ Blog
 B#
 Barry Gervin's Software Architecture Perspectives
 Boy Meets World
 Brad Abrams
 Canadian Developers
 Christopher Steen
 Claritude Software News
 Clemens Vasters: Enterprise Development and Alien Abductions
 Coding Horror
 Coding in an Igloo
 Dare Obasanjo aka Carnage4Life
 Darrell Norton's Blog [MVP]
 David Hayden [MVP C#]
 Don Box's Spoutlet
 Eric Gunnerson's C# Compendium
 EZWeb guy: Jeffrey Palermo [C# MVP]
 Fear and Loathing
 Generalities & Details: Adventures in the High-tech Underbelly
 Greg Young [MVP]
 Greg's Cool [Insert Clever Name] of the Day
 IanG on Tap
 Ingo Rammer's Weblog
 ISerializable - Roy Osherove's Blog
 James Kovacs' Weblog
 Jason Haley
 Jean-Luc David
 Jeremy D. Miller -- The Shade Tree Developer
 JetBrains .NET Tools Blog
 Jimmy Nilsson's weblog
 John Bristowe's Weblog
 John Papa [MVP C#]
 Jon Skeet's Coding Blog
 JonGalloway.ToString()
 Jump the Fence or Walk Around
 Lambda the Ultimate - Programming Languages Weblog
 Larkware News
 Lutz Roeder
 Marquee de Sells: Chris's insight outlet
 Martin Fowler's Bliki
 Mike Nichols - SonOfNun Technology
 MSDN Magazine - .NET Matters
 MSDN Magazine - All Articles
 OdeToCode Blogs
 Onion Blog
 Planet TW
 Raymond Lewallen [MVP]
 Rockford Lhotka
 RodMan's Corner
 Roger Johansson's blog
 Sahil Malik - blah.winsmarts.com
 Sam Gentile's Blog
 Scott Bellware [MVP]
 Scott Hanselman's Computer Zen
 ScottGu's Blog
 secretGeek
 Service Station, by Aaron Skonnard
 Signum sine tinnitu--by Guy Kawasaki
 Stephen Toub
 Steve Eichert's Blog
 Steven Rockarts
 The Blog Ride
 The Coding Hillbilly
 The Daily WTF
 TheServerSide.net: News
 Tim Gifford
 Vance Morrison's Weblog
 you've been HAACKED

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

RSS 2.0 | Atom 1.0 | CDF

Send mail to the author(s) E-mail

Total Posts: 477
This Year: 47
This Month: 2
This Week: 4
Comments: 1344

 Thursday, July 31, 2008
Thursday, July 31, 2008 2:00:43 PM (Mountain Standard Time, UTC-07:00) ( Programming )

Now that I have been using Vim for a couple of months I feel very comfortable with it. Thanks to someone in my last class who has been a Vim user for years, I have started to use Vim for more than just editing (more on that in a later post). Vim has permeated a lot of the applications that I use:

  • Firefox
  • Visual Studio
  • Word
  • SQL Server Management Studio

 

Anyone who knows me well is aware of the fact that I am a keyboard junkie who is obsessed with keeping my hands as close to home row as possible! This is why for the longest time I have not used the ALT-Insert Resharper shortcut, but rather ALT-R-C-G-I, which is the traversal path to get to the ReSharper generate dialog.

Some of the features that I love about ReSharper also require the use of arrow keys, features such as:

  • Go to next member/tag
  • Go to previous member/tag
  • Move code up
  • Move code down
  • Go to next usage
  • Go to previous usage

I use ViEmu in studio, but also use ReSharper for the awesome features it provides. As cool as the above ReSharper features are, I have never liked having to reach for the arrow keys (or memorize the menu traversal path) when editing with ReSharper. A couple of days ago I decided to use AutoHotkey to allow me to tweak the keyboard so that I could perform all of the above operations using the exact keystrokes as ReSharper except replacing the use of the arrow keys with the appropriate Vim alternative (H,J,K,L). So now I can do the above as follows:

  • Go to next member/tag
    • Original - Alt + Down Arrow
    • Now - Alt + J
  • Go to previous member/tag
    • Original - Alt + Up Arrow
    • Now - Alt + K
  • Move code up
    • Original - Ctrl + Shift + Alt + Up Arrow
    • Now - Ctrl + Shift + Alt + K
  • Move code down
    • Original - Ctrl + Shift + Alt + Down Arrow
    • Now - Ctrl + Shift + Alt + J
  • Go to next usage
    • Original - Ctrl + Alt + Down Arrow
    • Now - Shift + Alt + J
  • Go to previous usage
    • Original - Ctrl + Alt + Up Arrow
    • Now - Shift + Alt + J
  • Generate Code
    • Original - Alt - Insert
    • Now - Alt + I

 

Only the go to next usage functions got a key replacement (Shift instead of Ctrl). Of course, none of the scripts affect the original ReSharper shortcuts, so when I am pairing with someone proficient with ReSharper and not Vim, they do not have an issue as they don't need to use the alternatives (and I can hit the shortcut to temporarily disable ViEmu also). They can carry on using the original ReSharper shortcuts. Notice that I also did the Generate Code so that now I can just hit ALT + I to do the same thing as ALT - Insert (no flight path for the hands at all!!). The nice thing is that now I can pull off all of the above functionality without having to leave home row and I get the benefit of consistent Vim style navigation.

 

Here are the scripts (simplified for brevity):

;=============================
;Process Go to next member/tag
;=============================
$!J::
    Send, !{Down}
return

;=================================
;Process Go to previous member/tag
;=================================
$!K::
    Send, !{Up}
return

;==========================
;Process Move Code Up
;==========================
$^+!K::
    Send, ^+!{Up}
return

;==========================
;Process Move Code Down
;==========================
$^+!J::
    Send, ^+!{Down}
return

;==========================
;Process Go to next usage
;==========================
$+!J::
    Send, ^!{Down}
return

;==========================
;Process Go to previous usage
;==========================
$+!k::
    Send, ^!{Up}
return

;==========================
;Process Generate Code
;==========================
$!I::
    Send, !{Insert}
return

 

Develop With Passion!!