Can I record/play macros in Visual Studio 2012/201

2019-01-03 05:13发布

Apparently macros were dropped from Visual Studio 2012.

Is there a plugin/extension/tool that will let me record & play keyboard macros (much like the record/play temporary macro in Visual Studio 2010)?

For example, I typically would use a macro when converting code from one language to another or to quickly generate properties from a text list, etc.

10条回答
Evening l夕情丶
2楼-- · 2019-01-03 05:53

Since using Sublime Text I found that there are in fact better ways to edit text than by using macros.

Sublime allows you to to edit your text with multiple cursors at once. It's hard to explain but there are several animations that show it off at http://www.sublimetext.com

Sublime Screenshot

I've also added Sublime as an external tool to Visual Studio:

  • open Tools/External Tools
  • add: Sublime, select the exe and use these arguments: $(ItemPath):$(CurLine):$(CurCol)
  • (also move it to the top as this makes the next step easier, otherwise remember its position)
  • then go to customize/Keyboard, search for Tools.ExternalCommand1 and add your preferred keyboard shortcut.

This will open the current document in Sublime at the same cursor position that you were in VS.

(also, Sublime can do macros in case you still need them)

查看更多
虎瘦雄心在
3楼-- · 2019-01-03 05:54

Stand out and vote for bringing macros back!

http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/2650757-bring-back-macros

UPDATE (10/4/2013):

Yay! Thank to your votes the macros are now considered for return! Keep pushing!

We are currently reviewing the feasibility of delivering a scripting capability in a future version of Visual Studio. Please continue to offer your comments on what scripting capability we should offer while we research this suggestion.

Tony Goodhew, Program Manager, VS Pro.

查看更多
叛逆
4楼-- · 2019-01-03 05:54

VSScript allows recording, writing, and editing macros in Lua, though I have not yet been able to make it work with Visual Studio 2015 (the command button is greyed out; documentation says Visual Studio 2005 to 2015 RC are supported).

It is currently released as a freeware.

查看更多
在下西门庆
5楼-- · 2019-01-03 05:56

I just was brought to my attention that Microsoft released an extension to Visual Studio 2013 to support macro's back again:

https://visualstudiogallery.msdn.microsoft.com/d3fbf133-e51b-41a2-b86f-9560a96ff62b

I'd advice to still vote for the feature to encourage them to make the extension available for Visual studio 2015 too: https://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/2650757-bring-back-macros

查看更多
登录 后发表回答