Sublime Text

From Dev Wiki
Revision as of 21:53, 4 February 2023 by Brodriguez (talk | contribs) (Add section about windows path)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Sublime Text is a universal text editor that's very useful for coding. It's kind of like notepad++, except it exists for essentially all OS types, and is much more customizable.
It also has support for various extensions, which can make it almost as good as an IDE for most languages.

Ubuntu Installation

Open a terminal and run the following commands:

wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
sudo apt update
sudo apt install sublime-text

Baseline Settings

The following settings are a good default to get started. Simply copy into your settings window.

{
    "caret_style": "phase",
    "default_line_ending": "unix",
    "ensure_newline_at_eof_on_save": true,
    "font_size": 12,
    "ignored_packages":
    [
        "Vintage"
    ],
    "line_padding_bottom": 2,
    "line_padding_top": 2,
    "rulers": [120],
    "save_on_focus_lost": true,
    "scroll_past_end": true,
    "shift_tab_unindent": true,
    "theme": "Adaptive.sublime-theme",
    "translate_tabs_to_spaces": true,
    "trim_trailing_white_space_on_save": true,
}


Installing Packages

First, install sublime text Package Control as indicated at https://packagecontrol.io/installation.
Then, you can use Package Control: Install Package to add packages as desired.

Some useful packages are listed below.

Dayle Rees Color Schemes

A whole set of various, well made color schemes for sublime text.

Personal Favorites:

  • Glowfish
  • Iceberg
  • Snappy Light

Editor Config

Allows sublime to take advantage of editorconfig files.
See https://git.brandon-rodriguez.com/other/editorconfig and https://editorconfig.org/ for more info.


Allow Opening from Windows Command Prompt

To do this, we need to add it to window's Path variable.

  • Open standard command prompt and type sysdm.cpl.
  • From here, edit Environment Variables > Path.
  • Add your sublime text installation location (default of C:\Program Files\Sublime Text.
  • Save changes and restart your command prompt.
  • From here, you can type subl to open Sublime in general. Or subl <location> to open a specific file or folder. Aka, the same default handling as linux.