How can I copy the entire line without selection? The 2019 Stack Overflow Developer Survey Results Are InHow do I duplicate a line or selection within Visual Studio Code?Turn Off Whole Line Copy in Visual Studio CodeVisual Studio Code: Keyboard shortcut for “Line Comment and Move down” combinationKeyboard shortcut to do the opposite of ENTER in VSCode (unindent and remove line feed)?How to scroll without moving my cursor in Visual Studio Code from the KeyboardVSCode - Line Select DownHow to move selected code segment to the left in VS Code?Cut line shortcut in Visual Studio Code (Ctrl+L in VS) (not delete line!)Select all active indent keyboard shortcut in VS CodeVSCode copy and paste 1 line without newline character being prepended
What is the closest word meaning "respect for time / mindful"
Is there a symbol for a right arrow with a square in the middle?
Why is the maximum length of OpenWrt’s root password 8 characters?
Geography at the pixel level
Are children permitted to help build the Beis Hamikdash?
What did it mean to "align" a radio?
Falsification in Math vs Science
How to save as into a customized destination on macOS?
How to answer pointed "are you quitting" questioning when I don't want them to suspect
Multiply Two Integer Polynomials
Can a flute soloist sit?
What does Linus Torvalds mean when he says that Git "never ever" tracks a file?
For what reasons would an animal species NOT cross a *horizontal* land bridge?
Delete all lines which don't have n characters before delimiter
Is bread bad for ducks?
What is the motivation for a law requiring 2 parties to consent for recording a conversation
What to do when moving next to a bird sanctuary with a loosely-domesticated cat?
Why was M87 targetted for the Event Horizon Telescope instead of Sagittarius A*?
What is the most effective way of iterating a std::vector and why?
Have you ever entered Singapore using a different passport or name?
What are the motivations for publishing new editions of an existing textbook, beyond new discoveries in a field?
Output the Arecibo Message
How technical should a Scrum Master be to effectively remove impediments?
If a Druid sees an animal’s corpse, can they wild shape into that animal?
How can I copy the entire line without selection?
The 2019 Stack Overflow Developer Survey Results Are InHow do I duplicate a line or selection within Visual Studio Code?Turn Off Whole Line Copy in Visual Studio CodeVisual Studio Code: Keyboard shortcut for “Line Comment and Move down” combinationKeyboard shortcut to do the opposite of ENTER in VSCode (unindent and remove line feed)?How to scroll without moving my cursor in Visual Studio Code from the KeyboardVSCode - Line Select DownHow to move selected code segment to the left in VS Code?Cut line shortcut in Visual Studio Code (Ctrl+L in VS) (not delete line!)Select all active indent keyboard shortcut in VS CodeVSCode copy and paste 1 line without newline character being prepended
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I wonder if there's a keyboard shortcut to copy the entire line where the cursor is without having to select it.
NOTE: I know how to duplicate it up and down, and how to move it too, but the problem is that sometimes I want to copy the same line of code to another different method, even to another different file.
visual-studio-code
add a comment |
I wonder if there's a keyboard shortcut to copy the entire line where the cursor is without having to select it.
NOTE: I know how to duplicate it up and down, and how to move it too, but the problem is that sometimes I want to copy the same line of code to another different method, even to another different file.
visual-studio-code
add a comment |
I wonder if there's a keyboard shortcut to copy the entire line where the cursor is without having to select it.
NOTE: I know how to duplicate it up and down, and how to move it too, but the problem is that sometimes I want to copy the same line of code to another different method, even to another different file.
visual-studio-code
I wonder if there's a keyboard shortcut to copy the entire line where the cursor is without having to select it.
NOTE: I know how to duplicate it up and down, and how to move it too, but the problem is that sometimes I want to copy the same line of code to another different method, even to another different file.
visual-studio-code
visual-studio-code
asked Mar 8 at 9:23
tastydbtastydb
927
927
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
You are looking for the editor.action.clipboardCopyAction command (docs). It copies either the current selection or, when nothing is selected, the whole line to the clipboard.
By default it is bound to Ctrl + C (Cmd + C on macOS).
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55060156%2fhow-can-i-copy-the-entire-line-without-selection%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You are looking for the editor.action.clipboardCopyAction command (docs). It copies either the current selection or, when nothing is selected, the whole line to the clipboard.
By default it is bound to Ctrl + C (Cmd + C on macOS).
add a comment |
You are looking for the editor.action.clipboardCopyAction command (docs). It copies either the current selection or, when nothing is selected, the whole line to the clipboard.
By default it is bound to Ctrl + C (Cmd + C on macOS).
add a comment |
You are looking for the editor.action.clipboardCopyAction command (docs). It copies either the current selection or, when nothing is selected, the whole line to the clipboard.
By default it is bound to Ctrl + C (Cmd + C on macOS).
You are looking for the editor.action.clipboardCopyAction command (docs). It copies either the current selection or, when nothing is selected, the whole line to the clipboard.
By default it is bound to Ctrl + C (Cmd + C on macOS).
answered Mar 8 at 9:36
HaaLeoHaaLeo
1,9861724
1,9861724
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55060156%2fhow-can-i-copy-the-entire-line-without-selection%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown