VS Code

                      VS Code a generic IDE

You can purchase the course from Udemy for VS Code. All these notes are from same course.

Boost your productivity with Visual Studio Code, the best code editor of the moment! Completely updated in 2024! 

Best part of this course is that it is for lifetime and will never expire and will get update as well whenever developer of course think it is needed.


You can download the software form VS code official website.


After installing VSCODE in Windows you can check the vscode version and command to launch it through cmd.


 Cmd command to check VS code version:




Cmd command to launch VS code from present folder:


VS Code image:


cmd command for launching VS Code with specific location:


 

VS Code image and folder details:



VS Code Details:

It provide details about workspace status, action bar, Folder structure, workspace and terminals part.


 Explore file and folder in VS Code:


You can use VSCode as windows explorer to read files and to delete them and even can copy them from one folder to another and can move them as well.



VS Code in background run lightmode browser hence it is similar to html or web developer tools as well.
A person can open multiple files in different modes according to his.
A person can open two files side by side to compare files.
Can open many files side by side to work at a time.

As is a developer tool hence will allow you to expand and collapse part of codes according to your need.
You can open a folder in VS Code simply by dragging the folder in workspace.


Command palette and key shortcuts:

Whenever you will move your mouse curser to any icon then VS Code will show its respective shortcut keys. If you want to see entire list of shortcut keys then go to setting in VS Code.

You are even allowed to amend keyboard shortcuts.
To open command palette you need to press F1 key.
You can even import keybindings of other IDE into VS Code.

You can download even any other editor as plugin or extension to VS Code.


Visual Customization of VS Code:

You can search for theme in command palette or you can check it in setting. Choose it according to your need and preference.
You can even search in extension for themes and use them according to your preference.

Zoom in and Zoom out is done by ctrl + and ctrl -.

Settings for VS Code:

In Settings we have User settings and Workspace settings. You can navigate the tabs or you can directly search for a setting in VS Code.
When you modify this settings then new folder will be created as .vscode and all settings detail will be stored in setting file.
Workspace related settings are for specific folder where it is applied but user setting will be applied globally.

If by mistake you have enabled some setting which you don't want then go to setting option and open it in json format and then remove the respective tag from setting file and your VS Code will reset. 


VS Code Extension:

It is a market place from where you can download different extensions for VS Code to program in different languages and other things.

Key points to notedown before installing a new extension.
1. Author
2. Popularity
3. Compatibility
4. Ratings

You can uninstall extension or even can disable it globally or for perticular workspace.

So in extension tab all extensions are classified properly as all installed extensions will be clubed together, popular in popular group and recommanded will also have it's own group.

You can even sort different extensions for your favourite language.
Just type Java @sort:installs.

We can even find an extension which is part of multiple extensions as package to help developers in installing all compatible version of extensions in one go.

As VS Code provide extension support so be wise in installing them and do install only according to your need and uninstall them when you don't need them as one extension can disturb other or even can make VS Code slow.

Search feature of VS Code:

ctrl+f command help you to search in VS Code. It will help you to search for keyword in file and will help you to resolve any error or to correct your code or to modify the content.

It will higlight all the words which are matching. You can refine your search as well by using the options present in search tab. You can even use the tab for replacement of a word in document. You can also use regular expressions in this search tab in VS Code as VS Code support regular expression.

File search:

cntrl+p will help us to search for file by name in entire workspace. To search for a file you can provide it's name or you can use the identing upper case letters to search for file in entire workspace.

You can even open search tab by clicking on microscope icon in activity bar. VS Code will also give you chance to edit the data of a file through this microscope option as it will open the list of all files which will have the keyword and then you can select perticular for modification without even opening the file as content will be visible in search tab under file name. 

If you will select the open in editor option then it will open all the files content in one file as you see in github. You can even define the amount of lines you want to visible around the searching keyword which are present in different files.

If you will go to ... option in search tab then you can even include and exclude the list of files or files by there extensions.

In complicated or huge project you can even go for finding file and content restricted to only one folder in this case you need to select the folder and then need to right click for options and then need to select find option in it. It will help us when we don't have any idea to write folder path or name for include option.

Cursor tricks:

It will help to perform repeatative tasks. ctrl+d is command to do it. It will help to highlight all matching keywords in file one by one adding into list of keywords presence in a file. After multiple selections you can modify them in a one go parallely. Just modify one other will follow. If arrangement or alignment get disturbed then use document format option to align changes in one go. cntrl+shift+L to select all matching keywords in one go.
You can even use alt+click of mouse to select multiple lines location for multi-curser option. You can even modify the animation associated with cursers to make them more smooth in settings. Just search for curser smooth and switch the option on.

Workspaces:

Now suppose you are using VS Code from years and you have created many projects and many codes and folders to identify them but ultimately they belong one single parent folder and to search for right files unfortunately you need to select parent folder for search and to visualise them in VS Code so to avoid this mess-up workspace concept is introduced.

Now other situation we have a project which use both backend and frontend design and coding and both of them are present on different location and we need to modify both of them side by side then how can we achieve it. We need to use workspace for it.

Now to make it possible you need to select perticular folders and need to add them to your workspace. Now we will able to see two folders one after another in explorer of VS Code under same workspace. After performing this task save the workspace.

It will provide option to make settings even on folder level along with workspace level.

Coding in VS Code:

Terminal:

VS Code will open terminal in your native OS. As for me it will open power-shell as I am a window user.

You can choose multiple terminals if you have them installed in your VS Code.
You can customize the look of your terminals and if you have opened multiple terminals then you can color them for identification.
You can even rename your terminals as well for identification.

You have problem tab as well to see the problems highlighted with your code or with build to run the code.
In VS code you can use problem tab to identify typo mistakes or even import issues or any syntactical type issues.

You even have output tab for output visualization.You just need to just select right task to see it's output.


Intellisense:

It will provide suggestions for coding and will try to find what you are trying to achieve.
You can press cntrl+space to trigger it for providing suggestions. In short it is an autocomplete facility of VS Code.


Comments facility:

ctrl+/ will allow you to comment any code line in VS Code irrespective of language.
If you press it on any commented line then it will uncomment that line of code.
You can comment out multiple lines as well and can uncomment them as well.
Java and javascript documentation is also supported by VS Code. As documentation will help to understand the code and make easy for others to work with your code and to utilize it wisely and easily.
Type /** + enter to start a documentation in VS Code.

File Formatting:

ctrl+shift+I in unix and shift+alt=F shortcut keys in windows and you can use it as well by using command palette.
Formatting as well have different versions you can format only specific peace of code or can format entire code as well.

You can even modify the tab distance space as well to make a custom format for your code to match your requirement.

By default in VS Code tab is considered as 4 spaces but you can modify it as well according to your need.
You can even go to setting and can set the time of formatting at the time of saving a file or even at the time of copying the code in editor as it will save you from manually formatting the code and will save you from human error of not having a formatted code for your product.

But be causious about it as it may misbehave and can increase your burden hence use it wisely and according to your need.

Comments

Popular posts from this blog

Python in VSCode

Apache Spark and PySpark

AWS