Sublime Text

  1. Sublime Text Configuration
    1. Adding Terminal To Sublime Text
      1. Configuring A Hotkey for Terminus
    2. Launching Sublime Text via Terminal
    3. Sublime Text Preference Settings
    4. Random Notes Dumpster

Sublime Text Configuration

Sublime Text is awesome. With Terminus and a good theme, it’s a very good text editor. Yes, VS Code has terminal built in but everybody knows that liking is wholly based on subjective parameters and we should just focus our logic inside the functions you make. :stuck_out_tongue_winking_eye:

Adding Terminal To Sublime Text

Now, to add a terminal to Sublime Text, install Terminus package1.

  1. <Ctrl> + <Shift> + <P> to open the command palette.
  2. Install Package Control.
  3. Install Terminus.
  4. Restart Sublime Text.
  5. Paste and save the following code to Preferences > Package Settings > Terminus > Command Palette:
    [
    {
         "caption": "Terminal (panel)",
         "command": "terminus_open",
         "args"   : {
            "cmd": "bash",
            "cwd": "${file_path:${folder}}",
            "title": "Command Prompt",
            "panel_name": "Terminus"
         }
    },
    ]
    

Configuring A Hotkey for Terminus

  1. To set Alt + 1 to activate the terminal, paste and save the code below to Preferences > Package Settings > Terminus > Key Bindings:
    [
    {
        "keys": ["alt+1"],
        "command": "terminus_open",
        "args" : {
            "cmd": "bash",
            "cwd": "${file_path:${folder}}",
            "panel_name": "Terminus"
        }
    }
    ]
    

    Using the hotkey also works like clear in addition to invoking the terminal inside subl. At least, that’s how I think about it.

Launching Sublime Text via Terminal

In Linux, this is done just by using subl2. If this is not the behavior by default, enter the command below in the terminal:

sudo ln -s /opt/sublime_text/sublime_text /usr/local/bin/subl

Sublime Text Preference Settings

{
  "theme": "Adaptive.sublime-theme",
  "font_size": 10,
  "font_face": "Jetbrains Mono",
  "save_on_focus_lost": true,
  "highlight_line": true,
  "caret_style": "phase",
  "ignored_packages":
  [],
}

Random Notes Dumpster

Toggle focus between terminal and editor. Check this issue out: https://github.com/randy3k/Terminus/issues/302#issuecomment-1137223130

Just use ctrl + \ to switch focus to editor, and alt + 1` for switching focus to terminal.


© 2024. Mockingjays Are Just Curious.