Copy selected line number(s) with absolute/relative file path
result e.g. path/to/file.txt:1-10
- Line numbers start with 1 by default (see Configuration to change this)
- if nothing is selected the line of the cursor is taken
Just what the description says: copy line numbers with absolute/relative file path
- Use
ctrl+shift+c
to copy the file path & selected line numbers
- Use
ctrl+shift+a
to copy the file path & selected line numbers with the wrapping additional texts (seecopyReferenceAdvanced.prependToCopiedText
andcopyReferenceAdvanced.appendToCopiedText
)
or
use the command palette search for CopyReference Advanced
or CopyReference Advanced with additional text
copyReferenceAdvanced.lineOffset
The line number to start with (this is added to the zero-based value of the line number)
copyReferenceAdvanced.pathLineNumberDelimiter
The delimiter for the path and line number section e.g.-
would givesome/path.txt
-1-5
,:
would givesome/path.txt
:1-5
copyReferenceAdvanced.lineNumberDelimiter
The delimiter for the line numbers e.g.--
would give1--5
copyReferenceAdvanced.collapseSingleLineNumbers
True: when only one line was selected e.g. 16 the output will be 16 without the line number delimiter, false: the output will always include the line number delimiter
copyReferenceAdvanced.prependToPath
Some string to prepend to the file path
copyReferenceAdvanced.appendToPath
Some string to append to the file path
copyReferenceAdvanced.pathMode
:absolutePaths
will copy absolute file paths,relativePaths
will copy relative file paths if the file is inside a opened workspace folder,relativePathsWithoutFolderName
the same asrelativePaths
but the folder name is removed
copyReferenceAdvanced.failIfNoFolderIsOpen
IfpathMode
is set to relative and no folder is open... True: notify warning because we cannot get a relative path (noting is copied), false: just copy the absolute path
copyReferenceAdvanced.displayCopiedTimeoutInMs
The copied text is displayed as a status bar item for X ms. Use a value <= 0 to always hide the status bar item
copyReferenceAdvanced.prependToCopiedText
Some text that should be prepended to the whole copied text
copyReferenceAdvanced.appendToCopiedText
Some text that should be appended to the whole copied text
See Changelog
https://code.visualstudio.com/Docs/editor/extension-gallery#_common-questions
macOS: ~/.vscode/extensions