Using Visual Studio Code on Fedora

A text editor is one of the most important tools for any programmer. Visual Studio Code is an open source text editor specifically designed for editing source code. Visual Studio Code was released by Microsoft in April 2015 and later became a free and open source software. The source code for Visual Studio Code is available on GitHub.

The editor includes debugging features, embedded git control, syntax highlighting, intelligent code completion, snippets, and code refactoring tools. Visual Studio Code has a wide range of extensions, available through a central repository. Extensions in Visual Studio Code perform a wide range of additional tasks,  including tools that that analyze code, such as linters and tools for static analysis.

Installing Visual Studio Code on Fedora

Visit the Visual Studio Code homepage, download the RPM version and install using Fedora Workstation’s Software application. Alternatively, Visual Studio code is available via a repository hosted by Microsoft. Setting up access to the repository will ensure that you get updates whenever they are released. Check out the documentation for details on setting this up on your Fedora system.

Basic Usage

The first launch of Visual Studio Code launches a helpful welcome screen. It contains shortcuts for opening a file or folder, as well as links to customization of the editor, and links to the awesome online help. As with most modern code editors, you can open a folder containing your project, and a handy browser tab is displayed on the left showing the contents.

Visual Studio Code with the folder view visible

Visual Studio Code with the folder view visible

The Command Palette is one of the most powerful tools in Visual Studio Code for performing actions. Simply use the Ctrl + Shift + p keyboard shortcut to bring it up, then search for a command. For example, to open a new folder / project, bring up the Command Palette, search for folder, then choose open Folder.

Opening a folder using the command palette

Opening a folder using the command palette

Additionally, there are many direct keyboard shortcuts for many commands. See the documentation for a full list, but some useful shortcuts to get started with are:

  • Open a Folder / Project — Ctrl + o
  • Create a new file — Ctrl + n
  • Open the terminal pane — Ctrl + `

Installing Extensions

The Visual Studio Code comes with a large number of extensions for making your code editing easier. These range from editor themes to additional support for specific programming and scripting languages. Extensions also exist that allow you add VIM and Emacs keybindings and modes. To browse and install extensions use the Extensions side page. To bring this up either search for Extensions in the Command Palette, click the bottom icon in the left toolbar, or use the Ctrl + Shift + x keyboard shortcut.

Debugging

The editor comes with a debugging support built-in. It has built-in debugging support for the for the Node.js runtime and can debug JavaScript & TypeScript. For debugging other languages (including C#, Python, C++ and others) install one of the many debugging extensions.

Git Support

Visual Studio Code has integrated support for Git. Other source control providers are available through extensions. Furthermore, the editor supports the use of multiple source control providers simultaneously, which means one can open multiple SCM based repositories and work seamlessly work across them.

Themes

Visual Studio Code also has editor themes. Install new themes in the Extensions pane. To use the theme switcher, simply search for Themes in the command palette.

Fedora Project community

30 Comments

  1. I’m not happy that it installs as code rather than vscode. I’m not sure I should have expect anything else from the company behind Office and Windows. Nice editor all the same.

    • Leslie Satenstein

      I am appreciative that it is code, compiled to be fast in execution. I will be downloading a copy for evaluation.

      Linux is not going to support a vscode facility when it is only needed for an editor.

      • Joe

        I may be wrong, as I have not tested the install name, but I read the comment from Daniel A. to read “the installed binary is named ‘code’ not ‘vscode’, and I would have preferred the later. At last that is how I read it.

  2. eeee

    it is no needed for normal programmers

  3. The Google – Microsoft collaboration is producing results; and adding to choices in this space is to be applauded. This fine developer’s tool is another welcomed addition.

  4. Bill Chatfield

    Nice review. Thanks. I think it’s cool that the Evil Empire released an open source product that works on Linux. It even looks very cool. I wonder if it has vi key mappings. 🙂

    • Curtis Nelson

      Indeed, there is an extension for Vi key mappings.

  5. Leslie Satenstein

    I use qt-creator for C/C++, vim and qt-creator for scripts, gedit for data files.
    It all depends if I am in GUI mode or terminal mode.

    Out of curiosity, I will install to evaluate.

    I rarely say no to a free lunch.

  6. Nice article!

    In order to improve the look and feel in Gnome desktop , I have created a theme named Adwaita-base16, based on the adwaita-dark theme for the UI and base16-tomorrow-night for the syntax highlighting.

  7. V

    Open Source ?

    Have you read their License of use and what data they are collecting ?

    If you scroll down to their main site they have 2 links . one link for their EULA and one link of what data … they collect ! i will not add them , because the last time i added links my post never published …

    from what data they collect:

    “Support data. When you engage Microsoft for support, we collect data about you and your hardware, software, and other details related to the support incident. Such data includes contact or authentication data, the content of your chats and other communications with Microsoft support, diagnostic data about the condition of the device and the application when the error occurred and system and registry data about software installations and hardware configurations. ”

    Authentication data ? lol
    Software and Hardware and …. other details LoL x 2

    from their License Argument .

    “DATA. The software may collect information about you and your use of the software, and send that to Microsoft. Microsoft may use this information to provide services and improve our products and services. There may also be some features in the software that enable you to collect data from users of your applications.”

    Good luck with this one and …their customers… sorry to say it but you don’t have customers anymore , they are their customers !

    From their License again …

    ” UPDATES. The software may install automatic updates. By using the software, you agree to receive automatic updates without any additional notice, and permit Microsoft to download and install them for you … ”

    and

    “SUPPORT SERVICES. Because this software is “as is,” we may not provide support services for it. ”

    Good luck with auto updates and the lack of support service . these two create a nice conflict

    and the Last Hit from their ” open source” EULA …

    “SCOPE OF LICENSE. The software is licensed, not sold. This agreement only gives you some rights to use the software. Microsoft reserves all other rights”

    Some rights , that are not named but named only those that they don’t want to do with their software …. hahahahaha , i will not comment farther… do it by your self

    i can’t stop laughing while writing on my windows VFIO VM that is the most brilliant open source kernel feature that makes Linux the base ( the Host ) to all other operating systems , including windows and macos for almost every usage !!!

    • Laurent Tréguier

      The EULA is for Microsoft’s redistributed binary. You can have an MIT licensed editor if you just build it yourself (https://github.com/Microsoft/vscode).

    • S

      Agree’d. Many don’t read the fine print, and MS never gives anything away for free…

    • Lewis T Powell

      “Embrace, extend, and extinguish”, also known as “Embrace, extend, and exterminate”, is a phrase that the U.S. Department of Justice found was used internally by Micro$oft to describe its strategy for entering product categories involving widely used “OPEN” standards, extending those standards with proprietary capabilities, and then using those differences to disadvantage its competitors. ( Micro$oft Embrace Open Source ) Visual Studio Code was released under the MIT License, although the official download is under a proprietary license. I wouldn’t touch it with a ten-foot pole.

      While I’m Awaiting moderation for 8h I allowed myself to share with you a small digression.

    • J K

      So what are we supposed to use then.

      • A. Rodef

        There is “atom”,

        another dev tool which seems very similar to the one described here.
        It is extendable by packages, themes etc (e.g., languages, beautification) with an in-window installer; browsing side pane, git support, and probably more that I haven’t found use for trying.

        It has even welcome screen that must be similar to the one described. Seems like a drop-in alternative, with more noble parentage.

        Featured earlier here:
        https://fedoramagazine.org/install-atom-fedora/

    • DM

      Read the license, decide whether you want to use the software. I use Eclipse IDE because of it’s Java history and IBM was kind enough to “donate” VisualAge Micro Edition. How do you make money?

    • Miorin

      https://github.com/Microsoft/vscode/issues/60#issuecomment-161792005

      Get the source and compile it for the MIT licensed version. 😉

    • Holger

      I haven’t read the EULA myself, but your quotes and your interpretation of them seems to be way off.

      »Support data. When you engage Microsoft for support, […] and hardware configurations. «

      Authentication data ? lol
      Software and Hardware and …. other details LoL x 2
      All of these seem to be perfectly fine for a support request. Also when it comes to authentication data, they certainly refrain to info how you authenticate to them,.

      »DATA. […]. There may also be some features in the software that enable you to collect data from users of your applications.«

      Good luck with this one and …their customers… sorry to say it but you don’t have >customers anymore , they are their customers !
      Again you seem to misread their EULA. “You” as developer may collect data from customer. It doesn’t say they (MS) collect any data from you users.

      Maybe we should put away our pitchforks this time.

  8. I really like VSCode. It’s one of my favourites. Thanks for the review!

  9. Mark Tinberg

    I’ve been using this editor for a while now and I like it, it has a good plugin ecosystem that includes Perl (perltidy, perlcritic, ctags and the perl debugger), RPM Spec files (rpmlint) as well as syntax highlighters for perl Template Toolkit, TCL, shell, Vagrant, etc. It’s nice that the more advanced features don’t get in the way of it being just a simple syntax highlighting code editor if you don’t want it to, there is no enforced “Project” workflow, and you can learn at your own pace because the searchable command palate and menus show the keyboard shortcuts for each function. The default settings are nicely organized and documented with comments as a JSON file with a simple editor mode for editing your overrides side by side with the defaults.

    This is another project based on Github Electron and is a fork of the Github Atom editor but with some additional polish work put in. It’s on Github itself and seems to have no problem taking contributions so is truly a public project, and because it’s implemented with a toolkit that a lot of people know (JavaScript, CSS) it’s more hackable by the average developer than say Emacs where you would have to learn elisp first, a language you would probably not use anywhere else.

  10. dev_null

    I do not install software that is not in Fedora repositories.

  11. Night Romantic

    There’s a typo in “Git Support” section: “… can open multiple SCM based repositories and work seamlessly work across them” – work once should be sufficient.

  12. alistair

    I’ve been using for about a month now, and been really enjoying it.

  13. Maciej

    I see that some people are really annoyed that Microsoft made really decent and useful piece of software for Linux. 😛

  14. Zach

    I’m just leery because its Microsoft and they’re way heavy on data collection, privacy invasion, and have in recent times, had a severe lack of user control. I’m also not seeing the real difference between this and the Atom project with they’re new IDE modules, but i’m no serious programmer.

  15. GroovieMan

    I was surprised, that the installation was based upon rpm, and moreover i was getting excited to see, that i get updated. Not bad, but …

    The editor is not very fast compared to other. i.e.:

    1) IntelliJ on my work

    2) Kdevelop as a free dev-platform for Qt, c++ and lot of other application

    3) kate for a quick editor

    4) for console

    i do not see any need for it. Besides Kdevelop is not the only application for oss software development, there a lot of others. So give me a hint to expose my private data to redmont. Why should i accept this ?

  16. I think its the single best user facing application Microsoft ever did. Especially that you can seamless code Go(lang), Java, JS, HTML, CSS and more without changing the editor.

    One should as well have a look on the https://extensions.gnome.org/extension/1207/vscode-search-provider/ extension for Gnome3.

    Very nice and useful is the internal Terminal that allows you to just use your terminal from within. It on top adds a tiny nice feature. It detects lines formated as “filename:linenumber” or “filename:linenumber:column” such as “myfile.go:3:5” and you can ctrl+left click on it to open the file with cursor on the given position. That way a “grep -Hrn Searchterm” becomes powerful.

    I could go on … i love it i like the post and i would strongly suggest to not be stubborn and hate Microsoft just because.

    • S

      “I could go on … i love it i like the post and i would strongly suggest to not be stubborn and hate Microsoft just because.”

      It isn’t “just because”. Microsoft has never truly embraced the Open Source community, although they are quick to exploit what is available out there. The mode of operation at Microsoft is for profit, and towards that end they will use all means and avenues available to them, including “giving something to the community” in order to swallow up the annoying little community supported projects that just won’t “die on the vine”. If you truly take an impartial look at how MS distributes their products and how many people and institutions are running their computing on software they don’t own the rights to, just the right to use, you can see why they want the Open Source Community to shrivel up and go away. Open Source projects, lead to innovation, collaboration, education, and tighter integration of ecosystem around the Linux Kernel. Proprietary closed software leads to vertical market saturation, competition stifling, a stagnation of ideas, and a propensity to milk every last coin from the user, even at the expense of innovation.

      As for a calling vscode an editor, it is a misnomer since it is an IDE, not just an editor.

      I’ll stick with emacs and vim, and QT Creator and Eclipse for my coding thank you very much. No MS products will ever be afforded a place on my ‘nix box.

      • Afaik Microsoft is changing in a bigger scale. Check out who was hired for what lately … just because they did bad things does not mean they do to much bad things right now.

        P.S. once you mastered vim and/or emacs there is not that much need to get into any other editor as they are super mighty … but learning them in the first place is kind of a wall not everyone needs and likes to climb over.

        • Thanks for the spirited discussion on the topic of Microsoft. The Fedora Magazine’s policy is to include topics of popular, licit software we know users are interested in. We concentrate on free and open source software but not exclusively, although we are always focused on Fedora users specifically, and how to enable them in their preferred choices. It’s good to know there is a wide spectrum of software preferences. We’ll likely moderate further discussion along those lines, since it’s unlikely to break novel ground.

Comments are Closed

The opinions expressed on this website are those of each author, not of the author's employer or of Red Hat. Fedora Magazine aspires to publish all content under a Creative Commons license but may not be able to do so in all cases. You are responsible for ensuring that you have the necessary permission to reuse any work on this site. The Fedora logo is a trademark of Red Hat, Inc. Terms and Conditions

%d bloggers like this: