CopyWithLineNumbers Manual (Visual Studio Plugin)

GitHub

https://github.com/m-tmatma/CopyWithLineNumbers

How to install

  1. you can download from here
  2. close all Visual Studio
  3. double click CopyWithLineNumbers.vsix

How to use

  1. select on active document
  2. right click on active document
  3. Select "Copy With Line Numbers"

How to customize

You can customize the format of the copying text by template

template variable

Variable Name Description Available version
{FileName} file name of the active document which doen't include directory name 1.2 or later
{FullPath} abosolute file path of the active docuemnt 1.2 or later
{RelativePath} relative file path of the active docuemnt from the solution directory 1.2 or later
{TopLineNumber} the line number of the first line of the selection 1.2 or later
{BottomLineNumber} the line number of the last line of the selection 1.2 or later
{Selection} the selection text which is added with the line number in each line 1.2 or later
{SelectionNoTab} the selection text which is added with the line number in each line and whose tabs are replaced to spaces 1.3 or later

how to set the template

  1. Select Tools Menu
  2. Select Options...
  3. Select CopyWithLineNumbers
  4. Select an item from ComboBox
  5. press Insert button

If you want to insert New Line, please press "Insert EOL" button
If you want to set to default, please press "Set Default" button

example

example setting

example output

c:\gitwork\github\copywithlinenumbers\copywithlinenumbers\copywithlinenumberscommand.cs(24):
24:         /// <summary>
25:         /// Command ID.
26:         /// </summary>
27:         public const int CommandId = 0x0100;
28: