Duplicate Line Visual Studio

  
  • Go to Tools Options Environment Keyboards Under Show commands containing: write Edit.Duplicate Place cursor to Press shortcut keys: and press Ctrl + D and click Assign button click OK to save your new keyboard shortcut.
  • Sort lines of text in Visual Studio Code. The following types of sorting are supported. Sort lines (line length descending). Sort lines (remove duplicate lines).
  • In this article, I am going to explain how to set up your Visual Studio Code for Python Development. Visual Studio Code or, popularly known as VS Code, is one of the free and open-source code editors developed by Microsoft and is mostly preferred by developers of all the major programming languages due to its flexibility and other integrated development tools like debugging, IntelliSense, etc.
  • Adds duplicate text functionality to vscode similar to that in Sublime Text or Resharper. When nothing is selected, the whole line is duplicated and caret is placed on the lower line When text is selected, the selection is duplicated and the new copy is selected Works with multiple selections.

Using Microsofts Visual Studio Code, how do I duplicate a line of code and then move it up and down? (Similar to how Sublimes cmd+shift+d)

In Visual Studio 2019. In Visual Studio 2017 (v15.6 and after) Ctrl + D. In Visual Studio 2017 (pre v15.6) (edit) This feature is now built-in in VS2017: Ctrl + E, V duplicates a line if nothing is selected, or duplicates selection. You can assign it to a different key combination, or find it in the menu: See this reference for more.

It's a feature that I use constantly, and am struggling using Visual Studio Code without it.

The commands your are looking for are editor.action.copyLinesDownAction and editor.action.copyLinesUpAction. You can see the associated keybindings by picking File Preferences Keyboard Shortcuts. The keybinding is Shift+Alt+Down and Shift+Alt+Up on Windows and Mac and Ctrl+Shift+Alt+Down and Ctrl+Shift+Alt+Up on Linux.

Furthermore, commands editor.action.moveLinesUpAction and editor.action.moveLinesDownAction are the ones to move lines and they are bound to Alt+Down and Alt+Up on Windows and Mac and Ctrl+Down and Ctrl+Up on Linux.

Visual Studio Code Permanently Deletes Files

This is a known issue that will be addressed with the second update after our first update next week.

Visual Studio Code: Treat other extensions as HTML

This is a commonly asked feature request and we are looking into this issue for the future. As a workaround if you need to have a solutio now: close VS Code open C:Users<your name>AppDataLocalCodeapp-<latest-version>resourcesappserverlibmime.js find the object literal knownTextMimes for the file extension you want add the proper mime type...

code . shortcut fails on OSX

osx,terminal,vscode

Make sure you have Visual Studio Code 0.3.0 installed. We recently changed the bundle identifier!

Is there a tabbed view for VSCode?

Not as of v0.3.0, as far as I know. Feature requests: http://visualstudio.uservoice.com/forums/293070-visual-studio-code Issue reporting: https://code.visualstudio.com/Issues/List...

How to compile c# in Microsoft's new Visual Studio Code?

Intellisense does work for C# 6, and it's great. For running console apps you should set up some additional tools: ASP.NET 5; in Powershell: &{$Branch='dev';iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.ps1'))} Node.js including package manager npm. The rest of required tools including Yeoman yo: npm install -g yo grunt-cli generator-aspnet bower You should also...

Multiline git commit message in VSCode

Currently you can only write single line commit messages. We are working on a solution for the next update (post 0.3.0).

Visual Studio Code - debug by “Attach” does not work on Mac OS

node.js,vscode

I got the answer from MS Support Team, it works like a champ now :) Love VSCode and the team so much. Below is the answer from Andre Weinand of VSCode Team: In 'Attach' mode the VSCode debugger needs to connect to the debug port of the node runtime, which...

Visual Studio Code for Mac crashes on startup

osx,vscode

I resolved my issue by: Following the steps to make the Mac version of Visual Studio Code able to be launched from Terminal: https://code.visualstudio.com/Docs/setup Launching Visual Studio Code from Terminal If it continues to not work, maybe try launching from a different folder....

Remove trailing spaces automatically or with a shortcut

Duplicate Line Visual Studio Code Mac

Our next update (end of month) will provide a new setting to enable automatic trimming of trailing whitespaces on save. There will also be a command to explicitly run this action.

Multiple Launch Files in Visual Studio Code

VSCode supports only one launch.json, but you can have multiple launch configurations inside one launch.json. The example at https://code.visualstudio.com/Docs/debugging has 3 different launch configurations. You can specify any amount, and choose the active one using a drop down in the debug view.

Is there a shortcut to hide the side bar in Visual Studio Code?

The command can be triggered via Ctrl+B on Windows and Linux or Cmd+B on the Mac.

How can we edit Rust files in VSCode? [closed]

rust,vscode

Support for Rust syntax coloring will be in the next VSCode update. 'VSCode is based on Atom'. This is not accurate. VSCode is built on top of the Electron (was the AtomShell), the editor and workbench are a totally different code based (the Monaco editor)...

User Setting for default save and open locations in VS Code

There is not. The workaround would be to create a shortcut to launch vscode with the location of the folder you want to open on startup. You can append a path as argument for VS Code to open. In addition, VS Code will always remember the last folder you opened...

JS Code didn't work, trying do a demo in css lessons

javascript,jquery,css,visual-studio,vscode

Instead of using JQuery you can do it with CSS using :active #demoButton:active { transform: scale(0.2, 0.2); -webkit-transform: scale(0.2, 0.2); } Docs: http://www.w3schools.com/cssref/sel_active.asp...

Vscode attach debug output window

Since VSCode is not an IDE, we do not have a built-in terminal. I tried the terminals on OS X, Linux, and Windows. They all allow me to select and copy text (however on Windows it is through the 'Edit' > 'Mark' mechanism). Andre Weinand, Visual Studio Code...

Is there a way to refresh the task list in VSCode?

gulp,vscode

It is not a very convenient way of reloading - but try Command Palette -> Reload Window instead of restarting VSCode.

VSCode debugging not working for NodeJs application

Your breakpoints are probably set too early and are not registered by node. It should help if you set the breakpoints after you have attached. We have improved this experience in VSCode and it should be available in 0.4.0...

How do I set up VSCode to compile C++ code?

The build tasks are project specific. To create a new project, open a directory in VSCode. Following the instructions here, press Ctrl+Shift+P, type Run Tasks, select it and press Enter. The tasks.json file will be opened. Paste the following build script into the file, and save it: { 'version': '0.1.0',...

the use of Developer Tools in VS Code?

When you select the option Help > Toggle Developer Tools, the Chrome DevTools window should open. Visual Studio Code is built with Electron, which is simply put a wrapper or container for creating desktop applications built with HTML and Javascript. With this in mind, the Developer Tools can be especially...

VS Code keybindings on Mac for cmd+delete

Mac Keyboards do not usually have a delete key, you may be thinking of backspace. { 'key': 'cmd+backspace', 'command': 'editor.action.deleteLines', 'when': 'editorTextFocus' } ...

vscode file icons

vscode,file-icons

Currently it is not possible to use extensions but we plan to support this in the future. See also: http://visualstudio.uservoice.com/forums/293070-visual-studio-code/suggestions/7752408-plugin-system

How do I support jasmine and es6 syntax in Visual studio Code?

jasmine,ecmascript-6,vscode

According to the only Q&A item in the section Common Questions support for user defined languages is not possible at the moment. So if the language is not supported out of the box, then it's not supported. But support for it may be near, and support for ES6 may be...

Visual studio Code Collapse panes

With the next update we will add a command to close all editors.

Remove git integrations from VSCode

Currently it is not possible to disable git via option. Please report this issue to us (from the Help menu you can report issues). As a workaround/hack, you could open C:Users<your name>AppDataLocalCodeapp-0.1.0resourcesappindex.js and change enableGit from true to false. However this change will not survive future updates....

How to add a post tsc build task that copy files?

typescript,vscode

You can use a task runner like gulp to accomplish this... You can configure vscode to run the build task below, which is dependent upon the compile task. var gulp = require('gulp'), exec = require('child_process').exec; gulp.task('build', ['compile'], function () { return gulp.src('./config/**/*.json') .pipe(gulp.dest('./dist')); }); gulp.task('compile', function (done) { exec('tsc -p...

Error when debugging Ruby code in VSCode (Mac OS X)

ruby,node.js,osx,debugging,vscode

Visual Studio Code Preview does not support debugging Ruby. If you would like to see this feature in a future version of VSCode you can vote for it here. In your launch configuration from above you've tried to configure 'node' to run your ruby program (which cannot work). Source: I...

VSCode Creates an automatic breakpoint that I can't delete

There is an option in the launch.json file called 'stopOnEntry' (You can access the file by hitting the Configure icon on the Debug panel). Set it to false and it should solve your problem.

Visual Studio Code - is there a Compare feature like that plugin for Notepad ++?

You can compare files from the explorer either from the working files section or the folder section. You can also trigger the global compare action from the command palette.

Visual Studio Code not recognizing the built-in typescript definition files

vscode,typescript1.5

Typescript in VSCode is working fine with your example. Create a new folder in VSCode Create a simple tsconfig.json file with compiler options { 'compilerOptions': { 'target': 'ES3', 'module': 'amd', 'sourceMap': false } } Create example code to in app.ts export interface IPerson { firstName: string; lastName: string; } export...

Visual Studio Code layout render bug - mouse actions work only in full screen mode

vscode,windows-10

In the update after the upcoming one we plan to update to a more recent version of Chrome (43). We investigate if the issue is fixed by this update.

How do I duplicate a line within Visual Studio Code?

The commands your are looking for are editor.action.copyLinesDownAction and editor.action.copyLinesUpAction. You can see the associated keybindings by picking File Preferences Keyboard Shortcuts. The keybinding is Shift+Alt+Down and Shift+Alt+Up on Windows and Mac and Ctrl+Shift+Alt+Down and Ctrl+Shift+Alt+Up on Linux. Furthermore, commands editor.action.moveLinesUpAction and editor.action.moveLinesDownAction are the ones to move...

How to use triple-slash references for libraries in Visual Studio Code?

javascript,vscode

You Need To Refefence the jQuery TypeScript Definition File. You need a 'typings' folder in the root of your app or site. Within the 'typings' folder you need a jquery.d.ts file. Your reference to the file should be similar to the following depending upon where the file reference is located...

Is there a way to make Visual Studio Code recognize HTML syntax in EJS files

Actually, you can. Click on the 'Plain text' tab at the bottom of the VS Code window and change it to 'HTML', screenshot below: http://screencast.com/t/8tkwY3swNwJT...

Cannot display JSON file created and saved in Visual Studio Code

json,vscode

This is a bug in VS Code. If you are running into it, rather than setting the language of the file, save the file with the .json extension, and VS Code will detect the language and correctly display the file. I've submitted the bug here: https://code.visualstudio.com/issues/detail/16781...

Building C# code in VSCode on Mac

c#,osx,xamarin,command-line-interface,vscode

You can setup a build task to compile the modified source. See https://code.visualstudio.com/Docs/tasks or http://blog.denouter.net/2015/04/compile-visual-studio-solution-in.html

Does Visual Studio Code have box select/multi-line edit?

Funnily enough, some parts of Visual Studio Code are actually based on ATOM http://thenextweb.com/apps/2015/04/30/microsofts-cross-platform-visual-studio-code-app-is-based-on-githubs-atom-editor/ If you mean multiple cursors, Code does support this (see section on multiple cursors):- https://code.visualstudio.com/docs/editingevolved...

Close Working File on Mac?

If you press Cmd+W (or Ctrl+W on Windows) you are actually closing the editor area. If you have more than one editor area open, you can reduce the number of areas until all are closed. Pressing it again in that state will close the window. With the next update we...

VSCode - adding c# assembly reference

You also need to add 'System.IO.FileSystem' to your dependencies.

Create Custom Language in Visual Studio Code

It's not possible right now, but is coming soon.

Using VSCode: How to debug a mono process which is started from another mono process

c#,debugging,mono,vscode

Just passing 'mono' to the ProcessStartInfo and adding all the arguments (mono's debug args, your *.exe, and your program's args) should do the trick. Make sure to use a different port if you want to be able to debug the a.exe and the b.exe.

Collapse XML to elements in Visual Studio Code

This is currently not possible but we plan to provide this feature in the future. You can suggest new features like this from our User Voice page. You can find your suggestion there.

What is the correct tasks.json config for compiling typescript in Visual Studio Code?

typescript,vscode

I had the same problem. It was a wrong PATH variable to the TypeScript compiler. (try to type 'tsc -v' in a command window). The tsconfig.json is supported in TypeScript version 1.5. My PATH variable was set to version 1. When I changed the system PATH variable to the updated...

How to configure Visual Studio Code and tslint?

vscode,tslint

You can add a linting task to your gulpfile like below. Or even a watcher task. Notice I just use TypeScript, not gulp plug in nor tslint, though they are fine too. gulp.task('ts-watcher', function() { gulp.watch('./src/**/*.ts', ['ts-compile']); }); gulp.task('ts-compile', function(done) { runTSC('src/client', done); }); function runTSC(directory, done) { var tscjs...

How to ignore `node_modules` folder in Visual Studio Code or TypeScript compiler

typescript,vscode

If you don't supply a file list, Code will compile all. { 'compilerOptions': { 'target': 'ES5' } } You can change this by supplying only the files you want compiled. { 'compilerOptions': { 'target': 'ES6' }, 'files': [ 'app.ts', 'other.ts', 'more.ts' ] } Hopefully Code will soon support filesGlob, which...

View code changes without restarting the server

c#,asp.net,asp.net-5,vscode,dnx

Vscode Copy Line Down

This is the expected behavior. You can use something like gulp-aspnet-k to automate this process. More detailed info available here: Building and Running Your ASP.NET vNext Application with Gulp. Note that this gulp integration unfortunately only works on Windows now but all it does is to watch the dnx process...

Debugging a node app hosted on a VM using Visual Studio Code

node.js,vscode

Duplicate Line Visual Studio 2017

I have verified that tunnelling the port 5858 via ssh works in so far that you can connect to node running inside the VM and use debugger functionality that does not involve source paths (Source paths are used for breakpoints and step events, etc.) The problem with source paths is...

Show whitespace in Visual Studio Code

whitespace,vscode

I think you have to set editor.renderWhitespace to true. It's false by default. 'editor.renderWhitespace': true...

Visual

Are there bookmarks in Visual Studio Code?

Visual Studio Code currently does not support bookmarks. Please add this as feature request to our user voice page (http://visualstudio.uservoice.com/forums/293070-visual-studio-code). In the meantime there are some ways to navigate around the code based on your navigation history. You can Ctrl+Tab to quickly jump to previously opened files. You can also...

How to change tabSize and insertSpaces in vscode

whitespace,indentation,vscode

There is a trailing comma in your snippet and currently VSCode fails to understand settings with malformed JSON. I am happy to say that with the next update, this issue should be fixed :)! The working version of settings is: // Place your settings in this file to overwrite the...

How do I set up a link to open up Visual Studio Code from terminal on OSX?

Duplicate Line Visual Studio Code

osx,bash,terminal,vscode

With VSCode 0.3.0 the startup script should now be configured to be this: code () { VSCODE_CWD='$PWD' open -n -b 'com.microsoft.VSCode' --args $* } UPDATE: If this doesnt work for you uninstall VSC and reinstall it; for this will only work with 0.3.0+...