Configuring and using Sublime Text in 2026
I wanted to share (and mostly document for future me) my Sublime Text setup for a Turborepo monorepo running TypeScript, React, Next.js, CSS modules and Biome.
This is the second time I write about Sublime Text. As I said in my first post, I've been a Sublime Text user for the longest time and I still enjoy using it. It's very fast and supports most of the features I need every day. It's also as minimalist as it gets and, after years of daily use, the keyboard shortcuts are muscle memory at this point.
1) Package control
If not already installed, go to Tools > Install Package Control. This is the extension marketplace equivalent.
2) Core packages
Open the command palette (Cmd+Shift+P), run Package Control: Install Package, and install the following packages:
LSP and language support:
- LSP: the base LSP client
- LSP-typescript: TypeScript/JS via tsserver
- LSP-biome: Biome linting, formatting, and code actions
- LSP-css: CSS language server
- LSP-copilot: GitHub Copilot support
Developer experience:
- SideBarEnhancements: adds missing file operations to the sidebar
- A File Icon: file type icons
- BracketHighlighter: bracket pair matching
- AutoFileName: path autocomplete in import strings
- Pretty JSON: to parse and format JSON files
- MDX: MDX syntax definitions
We use Biome for linting and code formatting, but if your codebase uses ESLint and Prettier instead of Biome, check out this other post.
Tip: you can use the Package Control: Advanced Install Packages option to install multiple packages in one go.
Note: I don't use any Git packages in Sublime Text because I use Sublime Merge for things like visually scanning diffs more easily and checking the history of a file. For most other things I use Git directly in my terminal (iTerm). If you'd like to use both Git and the terminal from within Sublime Text, look into the Terminus and GitSavvy packages.
3) TypeScript support
To get TypeScript to work you'll need to point LSP-typescript at your monorepo root's TypeScript install. Go to Settings > Package Settings > LSP-typescript > Settings and add:
// Settings in here override those in "LSP-typescript/LSP-typescript.sublime-settings"
{
"typescript-tsdk": "/Users/fed/workspace/repository-name/node_modules/typescript/lib"
}Note: the ~ home directory shortcut does not work in Sublime settings. You'll need to use the full absolute path.
Something handy to add is support for "jump to definition" using Option+click. For this we'll add a new mouse shortcut (Settings > Mouse Bindings) and add the following:
[
{
"button": "button1", // left mouse button
"count": 1, // single click
"modifiers": ["option"],
"press_command": "drag_select",
"command": "lsp_symbol_definition"
}
]4) LSP settings
Go to Settings > Package Settings > LSP > Settings. This is where the global LSP configuration lives. This is the full config I ended up with:
// Settings in here override those in "LSP/LSP.sublime-settings"
{
"lsp_format_on_save": true,
"clients": {
"LSP-biome": {
"enabled": true,
"initializationOptions": {
"requireConfiguration": true
}
},
"LSP-typescript": {
"enabled": true,
"settings": {
"typescript.format.enable": false,
"javascript.format.enable": false
}
}
}
}Note: requireConfiguration: true ensures Biome only starts running where a biome.json exists. TypeScript formatting is disabled because Biome (or Prettier) handles that instead.
5) Project file
Create a <something>.sublime-project file at your repo root. Don't call it .sublime-project with a leading dot as Sublime will append .sublime-project again and produce a broken double extension filename. The name could be anything, it doesn't really matter. If you are set on not using a name, make sure you don't have a double extension.
Here's the content of my .sublime-project file:
{
"folders": [
{
"path": ".",
"folder_exclude_patterns": ["node_modules", ".turbo", "dist", ".cache"],
"file_exclude_patterns": ["*.lock"]
}
]
}To open the codebase in Sublime Text, we'll open the project via Project > Open Project (and not File > Open). If the Open button is disabled, click the .sublime-project file itself rather than just navigating to the folder. If you can't see it because it starts with a dot, press Cmd+Shift+. to show all hidden files.
If you get an error like Unable to read project .sublime-project.sublime-project, delete the .sublime-workspace file, as it may still reference the old broken filename, and Sublime will regenerate it:
rm <something>.sublime-workspaceAlternatively, you could also open the project from your terminal (more on this later):
subl /path/to/project/.sublime-project6) Solving the Node.js PATH problem
This step took me a while to figure out. When you open Sublime from the Dock or Finder, it won't inherit your shell's PATH. This means it can't find Node when nvm manages it, and in turn, LSP packages that depend on Node (like LSP-biome and LSP-typescript) cannot find the Node runtime.
This is the error message I was getting:
Could not start LSP-biome due to not being able to resolve suitable Node.js runtime on the PATH.The easiest solution is to install a stable Node via Homebrew:
brew install nodeThis gets you a copy of Node at /opt/homebrew/bin/node, which never changes regardless of what you are doing with nvm. Your nvm Node is still active in the terminal for any actual project work, and more importantly they don't conflict.
Note: If you're disciplined about always using opening your projects using subl, you don't strictly need this setting (see below).
7) Opening a project from the terminal
Similarly, when you launch Sublime from your terminal using open -a "Sublime Text", macOS starts it as a GUI application outside of your shell environment. Again, this doesn't load .zshrc or .zprofile, so Sublime Text has no knowledge of anything you've set up there, including nvm, Homebrew's bin directory, or your custom PATH.
To properly open Sublime from the terminal you need the subl binary on your PATH. Apparently there's no UI option for this in Sublime Text 4 on Mac, so the workaround is to add the Sublime bin folder to your PATH in your ~/.zprofile:
echo 'export PATH="/Applications/Sublime Text.app/Contents/SharedSupport/bin:$PATH"' >> ~/.zprofileNow you can open your project with:
subl /path/to/<something>.sublime-project8) User settings
Besides your editor preferences in Settings > Settings, we'll need to add these two settings:
{
// ... the rest of your user settings ...
"index_files": false,
"show_definitions": false
}index_files: falsedisables Sublime's built-in code indexing, which is redundant when LSP is running and just wastes CPU.show_definitions: falseprevents Sublime's native hover popup from conflicting with LSP hovers.
This is what my entire Preferences.sublime-settings file looks like:
{
"font_size": 20,
"index_files": false,
"line_padding_top": 4,
"line_padding_bottom": 4,
"word_wrap": true,
"highlight_line": true,
"block_caret": true,
"caret_style": "smooth",
"scroll_past_end": 0.5,
"show_definitions": false,
"mini_diff": true,
"highlight_modified_tabs": true,
"indent_guide_options": ["draw_normal", "draw_active"],
"rulers": [100, 120]
}9) Using Copilot via LSP-copilot
Once the LSP-copilot plugin is installed, make sure to log in with the browser.
I wrote this lsp-copilot-chat-context plugin to get the file and line(s) context automatically populated in the Copilot chat window, and also disabled the autocompletion functionality in the LSP-copilot settings:
// Settings in here override those in "LSP-copilot/LSP-copilot.sublime-settings"
{
"settings": {
"auto_ask_completions": false
}
}10) Wishlist
Something I couldn't get to work is CSS Modules class name autocompletion. It seems there's no Sublime equivalent to the VSCode CSS Modules extension. LSP-css gives us vanilla CSS completions but won't resolve styles.myClass across files.