I know the shortcut for Console.WriteLine()
is type cw and tab twice. Does anyone know what's the short cut for Console.ReadLine()
?
Alt+C is a keyboard shortcut most often used to view the favorites in Internet Explorer. How to use the Alt+C keyboard shortcut. Using Alt+C in Internet Explorer.
Alternatively referred to as Control+C, ^c, and C-c, Ctrl+C is a keyboard shortcut used to copy highlighted text or other object to the clipboard in a graphical user environment. On Apple computers, the keyboard shortcut to copy is Command + C .
There is no shortcut(code snippet) for Console.ReadLine()
. However you can create your own that.
Here is the snippet that I modified from the cw
:
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>rl</Title>
<Shortcut>rl</Shortcut>
<Description>Code snippet for Console.ReadLine</Description>
<Author>Xiaoy312</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>input</ID>
<ToolTip>variable for console input</ToolTip>
<Default>input</Default>
</Literal>
<Literal Editable="false">
<ID>SystemConsole</ID>
<Function>SimpleTypeName(global::System.Console)</Function>
</Literal>
</Declarations>
<Code Language="csharp"><![CDATA[var $input$ = $SystemConsole$.ReadLine();$end$]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
Just drop it in your snippet folder. I put mine there :
C:\Users\Xiaoy\Documents\Visual Studio 2015\CodeSnippets\Visual C#\My Code Snippets\rl.snippet
When you type rl
and tab twice, you get this :
var input = Console.ReadLine();
Save the following as a .snippet
and import it (used the cw snippet as a template)
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>cr</Title>
<Shortcut>cr</Shortcut>
<Description>Code snippet for Console.ReadLine</Description>
<Author>Whoever you want it to be</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal Editable="false">
<ID>SystemConsole</ID>
<Function>SimpleTypeName(global::System.Console)</Function>
</Literal>
</Declarations>
<Code Language="csharp"><![CDATA[$SystemConsole$.ReadLine();]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
Once imported, you can hit cr and tab twice to get Console.Readline();
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