PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Visual Studio Code Setup  (Read 284 times)

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 9313
  • Windows 10
    • PlanetSquires Software
Visual Studio Code Setup
« on: June 03, 2020, 10:24:22 PM »

It is important to remember that we must always start the Visual Studio Code editor using a script/batch file that we create ourselves. It is modeled after the code.cmd script/batch file found in the root directly. We do not use the code.cmd file itself because that file would get overwritten whenever we do an upgrade of VSCode with new versions. Our new file will set specific environment variables that the editor needs in order to function properly.

Create a new file in the root VSCode folder called start_vscode.cmd. Open that file using any simple text editor like Notepad and copy the following code into it:
Code: [Select]
@echo off
Setlocal

set VSCODE_APPDATA=%~dp0data\appdata
set VSCODE_LOGS=%~dp0data\logs
set VSCODE_EXTENSIONS=%~dp0data\extensions

set VSCODE_DEV=
set ELECTRON_RUN_AS_NODE=1

set PATH=%~dp0data\tools\TDM-GCC-64\bin;%~dp0data\tools\cmake-3.17.3-win64-x64;%PATH%

set VSCODE_FOLDER=%~dp0app
set VSCODE_TOOLS=%~dp0data\tools

call "%~dp0app\Code.exe" "%~dp0app\resources\app\out\cli.js" %*
endlocal

Extensions

Go to “Extensions” to install the following extensions:

-   Bookmarks by Alessandro Fragnani
-   C/C++ IntelliSense, debugging… by Microsoft
-   C/C++ Snippets by Harsh
-   CMake Tools by Microsoft
-   Todo Tree by Gruntfuggly
-   Material Theme by Mattia Astorino


VSCode Settings

Access the settings via Ctrl+,
-   Editor: Font Size
   I changed my value to “16” because I have a 4K display.

-   Match Brackets
   I changed mine to “never” because I find it distracting. Maybe later down the road I will find it more useful and will re-enable it.

-   Occurrences Highlight
   I unchecked this option as I find it to be distracting.

-   Selection Highlight
   I unchecked this option as I find it to be distracting.

-   Minimap – Enabled
   I unchecked this option as I find it to be distracting.

-   Color Theme
   Material Theme Darker High Contrast

-   Icon Theme
   Change to “null” because I find that VSCode shows way too many distracting icons everywhere.

-   Tree Indent
   Changed to “14” in order to make the filenames in the Explorer treeview stand out better.

-   Update: Enable Windows Background Updates
   Unchecked. We are using the portable version so we do not want to be bothered having to dismiss the popup dialog box every time a new version becomes available.


Keyboard shortcuts:

Here is where I made a lot of changes. Obviously, these are all personal choices and everyone’s taste for what shortcut should do what, is something that can’t be dictated. I have used my own tools of JellyFish Editor, FireFly, and WinFBE, for so many years that I have become accustomed to what keyboard shortcuts work for me.

Click File, Preferences, Keyboard Shortcuts (Ctrl+K Ctrl+S)

-   (F2) Bookmarks: Jump to Next
-   (Shift+F2) Bookmarks: Jump to Previous
-   (Ctrl+F2) Bookmarks: Toggle
-   (Ctrl+Y) Cut
-   (Ctrl+D) Duplicate Selection
-   (Ctrl+Shift+DownArrow) Move Line Down
-   (Ctrl+Shift+UpArrow) Move Line Up

If you run into (and you will) the situation where a key combination already exists and is tied to another action then you need to delete that binding first. When I was setting up the shortcuts above, none of the bindings that I deleted seemed to relate to anything that I would use regularly in my daily programming.
« Last Edit: June 03, 2020, 11:16:05 PM by Paul Squires »
Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer