I love working in my comfort zones of which visual studio code is one. The sight,the feel, the powerful tools that comes prebuilt and the ones I install is enough motivation for me to build anything I want to or even experiment the innovative ideas that comes to my mind. Visual studio code is my swiss army knife.
Visual Studio Code :
Initially, I used IDE and sublime text as an alternative. But, right now I ditched both of them in favour of Visual Studio Code because it gives the power of an IDE right within a light text editor.
Installing VSCode is easy. Head on to code.visualstudio.com. The website should detect the operating system you're using, but in case it's wrong or you download the setup for another operating system. The option is there as well. Download and install on your development machine.
Now that you have VSCode installed, let's go ahead to set it up for development. I will also share tweaks and settings to optmize its performance while we use it.
To go to settings, press cmd + ,
on mac or ctrl + ,
on windows/linux then there you go, we have settings. It's just a json file. I love fact that the settings is divided into two columns. All default settings are accessible the left column while custom settings are on the right. You can explore the defaults and tweak it much as you please.
{ "files.exclude": { "**/.git": true, "**/.svn": true, "**/.hg": true, "**/CVS": true, "**/.DS_Store": true, "node_modules": true }, "window.zoomLevel": -2, "files.autoSave": "onFocusChange", "editor.tabSize": 2, "editor.wordWrap": "on", }
In the settings above,
cmd and +' or
ctrl and +depending on your operating system to increase the font size and
cmd and -/
ctrl and -` to reduce font size.files.autosave
, this helps to ensure that your changes are automatically saved when you lose focus on the editor tab. This means you don't have to press cmd + s
or ctrl + s
to save before you see the effects of modifications you make.editor.wordWrap
ensures that you don't have to scroll right and left before you see all the codes that you type.Choosing a theme could be tricky. Install multitheme
it comes with tons of themes, with multitheme, you'll different flavour. My choice is multitheme Eggplant
. A quick shortcut to choosing and trying out themes is pressing these key combinations cmd + K
then cmd + t
or ctrl + k
then ctrl + t
.
******************************************************************************************************
You may also like:6 Essential VSCode Extensions for Angular Developers
******************************************************************************************************
This plugin scans through your workspace for css classes in your stylesheets and refrenced libraries to give you a richer intellisense in vscode. This works for pure html/css and even react classNames as well.
This plugins makes referencing of paths/directories a breeze as it provides intellisense for file paths.
Eslint helps lint your javascript code to ensure it's syntactically healthy (correct) following a popular style guide i.e Airbnb, google or Standard style guide. It however require you to have node installed on your machine and must have install eslint globally or insall it by running sudo npm i -g eslint
or npm i -g eslint
.
Git lens shows you authorship of the code you're editing line by line. Who wrote it and when it was written. Quite nifty when trying to reward a nice contribution to a code base and figuring out a culprit that plant a malicious code in to a code base as well.
Rest client makes you do more by enabling you to test APIs right within vscode.
A sample test looks like this
POST http://localhost:8080/api/v1/login content-type: application/json{
“username”: “tester”,
“password”: “testing”
}
this way, you can test your APIs by yourself as you build them within VSCode. You can also work with REST APIs to examine the URLs and check the responses without using tools like Postman. It allows you to send HTTP request and view the response in Visual Studio Code directly. Pretty nifty.
Several times, we plan to fix a bug or even plan to enhance a particular endpoint in our API , but being humans, we forget and it eventually escapes our mind. With this plugin,you don’t have to worry about that again. All you need to do is to do these right within your code
// TODO: use arrow function instead
function randId (charCount) {
return Math.random().toString(36).slice(-(charCount))
}
this gives the todo a coloring that makes it obvious in your code like this
before marking your projects as done on your task list.
If you use webpack and conscious of your bundle size, this extension will come handy. It shows me what size every import is, so I’ll be careful not to import what I don’t need.
Sometimes, developers could be lazy to close tags.Severally,I ring the bell; “close your tags” to my students at bootcamps. These two plugins help close tags as soon as you open them and rename tag pairs as well. This works for html, jsx and vue template syntaxes.
This extension is all you need for a smooth VueJS development it’s features includes
What other extension do you use and what tweaks have you done to your VSCode editor?
I would love to read them in the comments below.
Readers will learn and get more ideas on how to pimp their editor. You can also share a screenshot of your editor, I’ll love to see them.
21 VSCode Shortcuts to Make Coding Faster and More Fun
Write beautiful and consistent JavaScript code using ESLint, Prettier and VSCode
Originally published by Abdul-Samii Ajala at codementor.io
===========================================
Thanks for reading :heart: If you liked this post, share it with all of your programming buddies! Follow me on Facebook | Twitter
#visual-studio #web-development