I find that typing lambdas can be cumbersome in visual studio. Is there any shortcut for a lambda expressions similar to how you can type ctor to generate a constructor? Even something as simple as m => m.[StartIntellisenseHere] or () => would be good to have some quick snips for. Are there any hotkeys like this I'm unaware of out of the box in Visual Studio, or with a free add in/extension?
No. But you can define your own:
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>lambda</Title>
<Shortcut>lambda</Shortcut>
<Description>Code snippet for lambda statement</Description>
<Author>Me</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
<SnippetType>SurroundsWith</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Code Language="csharp"><![CDATA[(() =>
{
$selected$ $end$
});]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
And save it on C:\Users[YOU]\Documents\Visual Studio 201?\Code Snippets\Visual C#\My Code Snippets
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With