Sublime Text: Difference between revisions

From Dev Wiki
Jump to navigation Jump to search
(Create page)
 
(Add section about windows path)
 
(9 intermediate revisions by the same user not shown)
Line 3: Line 3:


== Ubuntu Installation ==
== Ubuntu Installation ==
Open a terminal and run the following commands:</code>
Open a terminal and run the following commands:
* <code>wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -</code>
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
* <code>echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list</code>
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
* <code>sudo apt update</code>
sudo apt update
* <code>sudo apt install sublime-text</code>
sudo apt install sublime-text


== Settings ==
== Baseline Settings ==
The following settings are a good default to get started. Simply copy into your settings window.
The following settings are a good default to get started. Simply copy into your settings window.
  {
  {
Line 15: Line 15:
     "default_line_ending": "unix",
     "default_line_ending": "unix",
     "ensure_newline_at_eof_on_save": true,
     "ensure_newline_at_eof_on_save": true,
    "font_size": 12,
     "ignored_packages":
     "ignored_packages":
     [
     [
        "Vintage"
     ],
     ],
     "line_padding_bottom": 2,
     "line_padding_bottom": 2,
     "line_padding_top": 2,
     "line_padding_top": 2,
    "rulers": [120],
     "save_on_focus_lost": true,
     "save_on_focus_lost": true,
     "scroll_past_end": true,
     "scroll_past_end": true,
     "shift_tab_unindent": true,
     "shift_tab_unindent": true,
     "theme": "Default.sublime-theme",
     "theme": "Adaptive.sublime-theme",
     "translate_tabs_to_spaces": true,
     "translate_tabs_to_spaces": true,
     "trim_trailing_white_space_on_save": true
     "trim_trailing_white_space_on_save": true,
  }
  }
== Installing Packages ==
First, install sublime text <code>Package Control</code> as indicated at https://packagecontrol.io/installation.<br>
Then, you can use <code>Package Control: Install Package</code> 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.<br>
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 {{ ic |sysdm.cpl}}.
* From here, edit {{ ic |Environment Variables}} > {{ ic |Path}}.
* Add your sublime text installation location (default of {{ ic |C:\Program Files\Sublime Text}}.
* Save changes and restart your command prompt.
* From here, you can type {{ ic |subl}} to open Sublime in general. Or {{ ic |subl <location>}} to open a specific file or folder. Aka, the same default handling as linux.

Latest revision as of 21:53, 4 February 2023

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.