I want to save myself a few keystrokes when typing C# interpolated strings in VS 2015/2017.
From what I can see, there isn't any built in functionality for this.
Somewhat related question here: Automatic interpolated strings
I'm settling on an AHK script for now that makes ctrl+[
a hotkey for this in VS. I'm wondering if anyone knows of a better way?
#SingleInstance force
#IfWinActive, ahk_exe devenv.exe
^[::
SendInput,$"
I also considered the script below to directly expand the typing of $
, but this would hinder the typing of $
on its own.
#SingleInstance force
#IfWinActive, ahk_exe devenv.exe
:*:$::$"
You can add the IDE behavior directly to the script
#SingleInstance force
#IfWinActive, ahk_exe devenv.exe
^[::
SendInput,$""{Left}
If this doesn't answer your question please add more information for non VS users about what you are trying to achieve
来源:https://stackoverflow.com/questions/46477608/hotkey-or-auto-expansion-for-interpolated-strings-in-vs