• Stars
    star
    596
  • Rank 73,441 (Top 2 %)
  • Language
    Python
  • License
    MIT License
  • Created almost 13 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Launch terminals from the current file or the root project folder

Sublime Terminal

Shortcuts and menu entries for opening a terminal at the current file, or the current root project folder in Sublime Text.

Features

  • Opens a terminal in the folder containing the currently edited file
  • Opens a terminal in the project folder containing the currently edited file

Installation

Download Package Control and use the Package Control: Install Package command from the command palette. Using Package Control ensures Terminal will stay up to date automatically.

Usage

  • Open Terminal at File Press ctrl+shift+t on Windows and Linux, or cmd+shift+t on OS X
  • Open Terminal at Project Folder Press ctrl+alt+shift+t on Windows and Linux, or cmd+alt+shift+t on OS X

In addition to the key bindings, terminals can also be opened via the editor context menu and the sidebar context menus.

Package Settings

The default settings can be viewed by accessing the Preferences > Package Settings > Terminal > Settings – Default menu entry. To ensure settings are not lost when the package is upgraded, make sure all edits are saved to Settings – User.

  • terminal
    • The terminal to execute, will default to the OS default if blank. OS X users may enter iTerm.sh to launch iTerm if installed.
    • Default: ""
  • parameters
    • The parameters to pass to the terminal. These parameters will be used if no custom parameters are passed via a key binding.
    • Default: []
  • env
    • The environment variables changeset. Default environment variables used when invoking the terminal are inherited from sublime.
    • The changeset may be used to overwrite/unset environment variables. Use null to indicate that the environment variable should be unset.
    • Default: {}

Examples

Here are some example setups:

Cmder on Windows

{
  // Replace with your own path to cmder.exe
  "terminal": "C:\\Program Files\\cmder_mini\\cmder.exe",
  "parameters": ["/START", "%CWD%"]
}

xterm on GNU/Linux

{
  "terminal": "xterm"
}

gnome-terminal for CJK users on GNU/Linux

{
  "terminal": "gnome-terminal",
  // Unset LD_PRELOAD which may cause problems for sublime with imfix
  "env": {"LD_PRELOAD": null}
}

iTerm on OS X

{
  "terminal": "iTerm.sh"
}

iTerm on OS X with tabs

{
  "terminal": "iTerm.sh",
  "parameters": ["--open-in-tab"]
}

iTerm2 v3 on OS X

{
  "terminal": "iTerm2-v3.sh"
}

Hyper on OS X

{
  "terminal": "hyper.sh"
}

Windows Terminal

{
  "terminal": "C:/Users/yourusername/AppData/Local/Microsoft/WindowsApps/wt.exe",
  "parameters": ["-d", "."]
}

Custom Parameters

With the parameters argument to the open_terminal and open_terminal_project_folder commands, it is possible to construct custom terminal environments.

The following is an example of passing the parameters -T 'Custom Window Title' to a terminal. Please note that this example is just an example, and is tailored to the XFCE terminal application. Your terminal may use the -T option for some other features or setting. Custom key bindings such as this would be added to the file opened when accessing the Preferences > Key Bindings – User menu entry (the file name varies by operating system).

{
  "keys": ["ctrl+alt+t"],
  "command": "open_terminal",
  "args": {
    "parameters": ["-T", "Custom Window Title"]
  }
}

A parameter may also contain the %CWD% placeholder, which will be substituted with the current working directory the terminal was opened to.

{
  "keys": ["ctrl+alt+t"],
  "command": "open_terminal",
  "args": {
    "parameters": ["-T", "Working in directory %CWD%"]
  }
}

More Repositories

1

package_control

The Sublime Text package manager
Python
4,755
star
2

package_control_channel

Default channel file for Package Control. Follow the directions at:
Python
1,242
star
3

sublime_alignment

Easy alignment of multiple selections and multi-line selections
Python
521
star
4

oscrypto

Compiler-free Python crypto library backed by the OS, supporting CPython and PyPy
Python
321
star
5

asn1crypto

Python ASN.1 library with a focus on performance and a pythonic API
Python
320
star
6

sublime_prefixr

A Sublime Text 2 plugin that runs CSS through the Prefixr API
Python
199
star
7

pybars3

Handlebars.js template support for Python 3 and 2
Python
175
star
8

packagecontrol.io

The Package Control website
Python
110
star
9

certvalidator

Python library for validating X.509 certificates and paths
Python
106
star
10

md5-js

A modification of Joseph Myers's high-preformance javascript md5 function that hashes unicode characters by first converting to UTF-8. http://jsperf.com/md5-shootout
JavaScript
98
star
11

vat_moss-python

A Python library for dealing with VAT MOSS and Norway VAT on digital services. Includes VAT ID validation, rate calculation based on place of supply, exchange rate and currency tools for invoices.
Python
65
star
12

mtmux

A script that uses tmux for multi-server administration with a tiling interface and synchronized keyboard input along the lines of terminator, clusterssh, multi-gnome-terminal, pconsole, etc.
Shell
51
star
13

vat-moss.js

A Javascript library for dealing with VAT MOSS and Norway VAT on digital services. Includes VAT ID checking, rate calculation based on place of supply, exchange rate and currency tools for invoices.
JavaScript
51
star
14

puremagic

A pure lua module for detecting the mime type of a file based on the contents - inspired by libmagic
Lua
38
star
15

certbuilder

Python library for generating and signing X.509 certificates
Python
34
star
16

ocspbuilder

Python library for generating OCSP requests and responses
Python
32
star
17

badtls.io

Keys, certificates, scripts and configuration for badtls.io
Python
27
star
18

sublime_tortoise

Keyboard shortcuts and menu entries to execute TortoiseSVN, TortoiseHg and TortoiseGit commands
Python
26
star
19

pi-github-runner

Docker config to easily enable arm and arm64 GitHub Actions via the self-hosted runner mechanism
Shell
24
star
20

pymeta3

A Python 3 compatible fork of https://launchpad.net/pymeta
Python
18
star
21

csrbuilder

Python library for generating certificate signing requests (CSRs)
Python
18
star
22

crc32-js-php

A javascript function and PHP snippet that produce identical crc32 checksums
JavaScript
17
star
23

crlbuilder

Python library for creating and signing certificate revocation lists (CRLs)
Python
16
star
24

swift-for-sublime

A modern Swift (5.6) syntax definition for Sublime Text 4
Swift
15
star
25

ChannelRepositoryTools

A Sublime Text package for working with channels and repositories
Python
11
star
26

sublime-sql-tmlanguage

A fork of the default SQL.tmLanguage with support for SQL Server data types and functions
9
star
27

shadow_password_crypt

A python script that generates sha512 password hashes suitable for use with useradd(8)
Python
5
star
28

wbond

4
star
29

SublimeSyntaxHTMLColorizer

Python
4
star
30

unittest_data

A pair of decorators to add data providers/test generators to unittest in Python 2.6, 2.7, 3.3 and 3.4
Python
3
star
31

subversion-cross-compile

Scripts to cross-compile Subversion 1.6, 1.7 and 1.8 from Linux/OS X to Windows
C
2
star
32

handlebars.py

MIT-licensed port of Handlebars.js to Python
Python
2
star
33

package_control-json

A repo to host repository and channel JSON files for testing Package Control
2
star
34

subversion

A fork of subversion that handle localization of dates on windows by only using numbers
C
2
star
35

gears-libsass

Python
1
star