0

I have installed Visual studio code and am able to run the "Code" application.

How do I add it as default IDE or at least as an option in the "Related applications" menu?

Please see the images:

Image 1:

enter image description here


Image 2 - The editor won't be found in the list at all till it's end:

enter image description here


Image 3 - That's the directory in which I manually activate the VSC program:

enter image description here

2

First, make a .desktop file. Edit a file in /usr/share/applications named code.desktop:

sudo gedit /usr/share/applications/code.desktop

Then type in the following lines:

[Desktop Entry]
Version=1.0
Name=Visual Studio Code
Comment=Visual Studio Code is a source code editor developed by Microsoft for Windows, Linux and OS X.
Exec=/home/user/Desktop/VSCode-linux-x64/code
Path=/home/user/Desktop/VSCode-linux-x64/
Icon=/usr/share/icons/path/to/your/icon.svg
Terminal=false
Type=Application
Categories=Utility;Application;Development;

... replacing user with your username and path/to/your/icon.svg with the name of whatever icon you want to use.

Now make sure the permissions are correct:

sudo chmod 644 code.desktop

Now right click your code file (colors.css). Select Properties. Then select the Open with tab, and search for the application you want it to open with by default. Click on that application and select the Set as default button at the bottom right.

  • You mean to make a symbolic link in the desktop and move it to the /usr/share/applications? – JohnDoea Jul 8 '16 at 13:40
  • Not quite, but close. You're creating a .desktop file (application reference file) in the default application reference folder, such that it should be detected automatically. The .desktop file in turn references your program. – anonymous2 Jul 8 '16 at 13:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.