DEV Community

Lev Eidelman Nagar
Lev Eidelman Nagar

Posted on

Migrating from VS Code to Sublime Text in 2022

VSCode needs no introduction as it is probably the most popular IDE/code editor at the moment. It has many useful built-in features as well as tons of 3rd party extensions in it's marketplace.
It is maintained and regularly updated by Microsoft and has a vibrant community of users and developers.

Image description

However VSCode has a dark side to it... No, I'm not talking about Microsoft harvesting your data for their nefarious purposes (although that's certainly an issue in my opinion). What I am referring to is VSCode's comparatively sluggish performance and the strain it puts on the computer's resources.

Although Microsoft did an amazing job of optimizing and squeezing every last bit of performance out of Electron, there's no getting away from the fact that VSCode will always be at a disadvantage compared to other code editors written in more low-level languages.

Also, and this is obviously more of a personal preference, I find VS Code's design and layout to be a bit too "busy" for my tastes as I prefer a more clean and minimalist UI with less distractions.

Fortunately, as you'll soon see, there are alternatives. But first a couple of small caveats:

  1. VSCode is great! No, really. It's not my intention to bash it or any other editor/IDE for that matter.
    The fact that it's free and mostly open source should be celebrated.
    Beside the above mentioned reasons, using VSCode is also the path of least resistance. Speaking from experience, it is super easy to set up and be productive with in no time. This is especially important for novices as almost any other tool will require you to put in some extra effort into setting it up.
    However, if you're the type of person who enjoys maintaining and fiddling with your tools this guide might just be for you.

  2. I am a full stack web developer working mostly with Node.js, React and Typescript. This setup is what works best for me, but may not work as well/at all for you. Having said that, many of these ideas and concepts will translate well into other languages and paradigms.

With these out of the way, let's move on and see why I chose to use Sublime Text and how I set it up as a powerful alternative to VSCode.

Sublime Text

Image description

Sublime is a closed source code editor written in C++. It also has a python API which can be used to extend it with additional functionality.

It's not free software, but you can "evaluate" it indefinitely if you don't mind the occasional popup window.
However, if you enjoy using it and can afford it, I highly recommend to buy a license and support the developers.

Although, not as popular as VSCode it has a devoted following and plenty of packages on it's marketplace called package control

In my experience, any sufficiently popular extension for VSCode will sooner or later be ported to Sublime (and vice versa).

Sublime is a fast and capable code editor, able to handle large files with ease, but it is still "just" a text editor. Let's see how we can turn it into more of an IDE.

Intellisense and Diagnostics

Luckily for us, the same autocompletion engine that powers VS Code is available to us in sublime through the LSP family of plugins.
To make a long story short, the Language Server Protocol is a protocol that standardizes the way code editors communicate with compilers through language servers.
Install the language servers relevant for your setup (for me it's lsp-typescript, lsp-css, lsp-json and a lsp-tailwindcss) and you'll be rewarded with powerful autocompletions, helpful diagnostics and excellent developer experience.

Image description

Linting

While sublime has a dedicated linter plugin, you may not need it. Both eslint and stylelint have language server plugins. This way all your errors will be shown in the same place.

LSP Modal Window

Prettier

Simply istall the JsPrettier plugin and you're all set.

Terminal

While sublime does not have a built-in terminal the Terminus package steps in to fill the gap.

Terminus

Debugging

The Debugger plugin implements Debug Adapter Protocol or DAP, allowing you to debug your code without leaving sublime. While not as refined as VS Codes's debugger, it is functional and receives frequent updates.

Debugger in action

Conclusion

Although this is a short guide, I hope it gave you some idea of Sublime Text's capabilities and how it can be set up to maximize your productivity and accommodate your daily workflows.

Top comments (6)

Collapse
 
airtonix profile image
Zenobius Jiricek • Edited

Other plugins you'd want:

  • AutoFileName
  • GitSavvy
  • GitGutter
  • Origami
  • MarkdownEditing
  • VimModeLines
  • Quokka

My current loadout:

Image description

Plugins I'd love to find:

  • Debugger is ok, but it's still not there.
  • proper support for the devcontainer spec. Probably requires significant support from the sublimetext team.

related to the devcontainer spec (and reliant on some headless-sublime-server-thing) but the vscode-remote-ssh plugin is amazing for when you're forced to keep code and execution of that code on company machines, but those machines don't have a UI or you don't want to use those machines UI (ie: macosx)

Things I'd like improved:

  • lsp-typescript is pretty slow
  • I absolutely loathe how sublime-lsp wants to install the language-engine of the tool, i already have ASDF managing everything and it's super important to me that my editor tooling operate under the same constraints as my projects code. Apparently the lsp developers are able to exist in a commercial fantasy world where code always works on whatever the latest hotness is.
Collapse
 
eidellev profile image
Lev Eidelman Nagar

Thanks!
Agreed on debugger unfortunately. Though they made several big improvements lately, I think they're constrained by the APIs sublime exposes (the way they implemented tabs for instance is pretty hacky from what I've seen).

Let's hope the sublime team get their shit together in the near future.

Collapse
 
blackjyn profile image
ZVHR El Ekhsaan • Edited

Me as a long time SB user feel very grateful finally LSP comes to SB4.
The SB4 is IMHO the greatest improvement on SB ecosystem.

I can now even code Java and C++ right from SB4, no need Eclipse IDE anymore (though its Java fxs are provided via Eclipse JDTLs , lol)

I once setup VScode but use it rarely except for AIR development, which is missing in SB ecosystem

Collapse
 
kevnk profile image
Kevin Kirchner

I was thinking maybe I should finally migrate from Sublime to VSCode... but your post saved me! I do more frontend dev code and the speed of Sublime Text is amazing... I'm sticking to it... I only wish creating packages was easier!

Collapse
 
eidellev profile image
Lev Eidelman Nagar

Thank you!

Collapse
 
adrian_widerski profile image
Adrian

Yes! Sublime with LSP plugins is awesome :) I have exactly the same feelings about VSCode. The editor is great, but unfortunately it's heavy and I don't really like the look of it - even if I use any theme available. VSCode is more functional, but the lightness and look of Sublime Text wins everything here. It's just a shame that many ST plugins haven't been updated in a long time, especially I'm talking about themes.