显然,Visual Studio 2012中删除了宏。
有没有插件/扩展/工具可以让我录制和播放键盘宏(就像Visual Studio 2010中的录制/播放临时宏一样)?
例如,在将代码从一种语言转换为另一种语言或从文本列表中快速生成属性等时,我通常会使用宏。
显然,Visual Studio 2012中删除了宏。
有没有插件/扩展/工具可以让我录制和播放键盘宏(就像Visual Studio 2010中的录制/播放临时宏一样)?
例如,在将代码从一种语言转换为另一种语言或从文本列表中快速生成属性等时,我通常会使用宏。
当前回答
VSScript允许在Lua中记录、编写和编辑宏,尽管我还不能让它与Visual Studio 2015一起工作(命令按钮是灰色的;文档说Visual Studio 2005到2015 RC是支持的)。
它目前是作为免费软件发布的。
其他回答
自从使用Sublime Text后,我发现实际上有比使用宏更好的方法来编辑文本。
Sublime允许您一次用多个游标编辑文本。这很难解释,但在http://www.sublimetext.com上有几个动画展示了它
我还添加了Sublime作为Visual Studio的外部工具:
打开工具/外部工具 添加:Sublime,选择exe并使用这些参数:$(ItemPath):$(CurLine):$(CurCol) (也移动到顶部,因为这使下一步更容易,否则请记住它的位置) 然后进入自定义/键盘,搜索工具。ExternalCommand1并添加您首选的键盘快捷方式。
这将在Sublime中打开当前文档,光标位置与你在VS中的位置相同。
(同时,Sublime可以做宏,以防你仍然需要它们)
宏又回来了!
Under Review → Completed We’ve heard your feedback loud and clear, and we’ve been working on a solution. We’re therefore very happy to announce that we’ve now released a version of Macros that supports both Visual Studio 2015 and Visual Studio 2013. While we were at it, we took the opportunity to fix a couple of bugs and improved the keyboard shortcuts. We hope you enjoy it. For more information, see the blog post here: http://aka.ms/vsmacros We’ve also open-sourced the code under the MIT license. If you have any suggestions or contributions, feel free to create an issue or a pull request in the new GitHub repo: http://github.com/Microsoft/VS-Macros Justin Clareburt Senior Program Manager
用于Visual Studio的宏
Macros for Visual Studio是Visual Studio 2013和Visual Studio 2015的扩展,允许使用宏来自动化IDE中的重复任务。该扩展可以记录Visual Studio中的大多数命令,包括文本编辑操作。 特性
记录并回放活动的文档操作和Visual Studio IDE命令 播放多次 使用宏资源管理器管理和持久化宏 为任何宏分配键盘绑定 宏记录为JavaScript文件,调用VS DTE api 宏编辑在Visual Studio与DTE智能感知 停止播放 示例宏
使用Visual Studio 2013 + 2015的宏
宏开源URL: https://github.com/Microsoft/VS-Macros
在MSDN博客上的公告:宏扩展:VS 2015支持和开源
你可以尝试文本宏for Visual Studio 2012-2022扩展(我是作者)。它基本上做的事情与notepad++宏相同(文本编辑,没有UI自动化)。
代码是开源的(GitHub),所以请随时贡献改进:-)
Visual Commander扩展(由我开发)支持Visual Studio 2015/2017/2019中的代码编辑宏录制和回放。