显然,Visual Studio 2012中删除了宏。
有没有插件/扩展/工具可以让我录制和播放键盘宏(就像Visual Studio 2010中的录制/播放临时宏一样)?
例如,在将代码从一种语言转换为另一种语言或从文本列表中快速生成属性等时,我通常会使用宏。
显然,Visual Studio 2012中删除了宏。
有没有插件/扩展/工具可以让我录制和播放键盘宏(就像Visual Studio 2010中的录制/播放临时宏一样)?
例如,在将代码从一种语言转换为另一种语言或从文本列表中快速生成属性等时,我通常会使用宏。
当前回答
VSScript允许在Lua中记录、编写和编辑宏,尽管我还不能让它与Visual Studio 2015一起工作(命令按钮是灰色的;文档说Visual Studio 2005到2015 RC是支持的)。
它目前是作为免费软件发布的。
其他回答
In this version of Visual Studio, while there are literally hundreds of features, there are some we’ve actually taken out. One of those is the macros automation feature, including macro record/replay, macro projects and the Macros IDE. While we know that macros have been valuable for those who use them, unfortunately our usage data shows that less than 1% of Visual Studio developers take advantage of this feature. Therefore, we’ve found ourselves investing more deeply in the Visual Studio areas that get used every day, and have not updated macros for several releases.
来源:Visual Studio 11开发者预览中的宏
我已经开始绕过这个(虽然不方便)通过剪切/粘贴到notepad++,记录和运行宏,然后剪切/粘贴回Visual Studio 2012。
自从使用Sublime Text后,我发现实际上有比使用宏更好的方法来编辑文本。
Sublime允许您一次用多个游标编辑文本。这很难解释,但在http://www.sublimetext.com上有几个动画展示了它
我还添加了Sublime作为Visual Studio的外部工具:
打开工具/外部工具 添加:Sublime,选择exe并使用这些参数:$(ItemPath):$(CurLine):$(CurCol) (也移动到顶部,因为这使下一步更容易,否则请记住它的位置) 然后进入自定义/键盘,搜索工具。ExternalCommand1并添加您首选的键盘快捷方式。
这将在Sublime中打开当前文档,光标位置与你在VS中的位置相同。
(同时,Sublime可以做宏,以防你仍然需要它们)
我刚刚注意到微软发布了Visual Studio 2013的扩展来再次支持宏的back:
https://visualstudiogallery.msdn.microsoft.com/d3fbf133-e51b-41a2-b86f-9560a96ff62b
我建议大家还是投票支持这个功能,鼓励他们在Visual studio 2015中也可以使用这个扩展: https://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/2650757-bring-back-macros
Visual Commander扩展(由我开发)支持Visual Studio 2015/2017/2019中的代码编辑宏录制和回放。
VSScript允许在Lua中记录、编写和编辑宏,尽管我还不能让它与Visual Studio 2015一起工作(命令按钮是灰色的;文档说Visual Studio 2005到2015 RC是支持的)。
它目前是作为免费软件发布的。