VS 中内插字符串的热键或自动扩展 [英] HotKey or Auto-Expansion for Interpolated Strings in VS

查看:17
本文介绍了VS 中内插字符串的热键或自动扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在 VS 2015/2017 中输入 C# 内插字符串时省去几次按键操作.

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.

这里有点相关的问题:自动插值字符串

我现在正在解决一个 AHK 脚本,它使 ctrl+[ 成为 VS 中的热键.我想知道是否有人知道更好的方法?

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
:*:$::$"

推荐答案

您可以直接将 IDE 行为添加到脚本中

You can add the IDE behavior directly to the script

#SingleInstance force
#IfWinActive, ahk_exe devenv.exe
^[::
SendInput,$""{Left}

如果这不能回答您的问题,请为非 VS 用户添加有关您要实现的目标的更多信息

这篇关于VS 中内插字符串的热键或自动扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆