0
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-09-19 04:01:21 +02:00
ohmyzsh/plugins/sublime
Marc Cornellà 095d56b5ea Fix WSL check for WSL 2 and simplify nohup in open_command
WSL 2 changes the output of `uname -r`. For instance,

  WSL 1: 4.4.0-18980-Microsoft
  WSL 2: 4.19.67-microsoft-standard

Since WSL 2 lowercases the M, we can match for the rest of the string
which remains lowercase throughout both versions. Another option would
be to match for both upper- and lower-case Ms, like that:

  $(uname -r) = *[Mm]icrosoft*

Fixed use of nohup in open_command where it was only necessary for
xdg-open (and actually harmful for cmd.exe in WSL 2). The current logic
is simpler and more future-proof.
2019-09-19 16:20:02 +02:00
..
README.md sublime: refactor plugin and fix documentation (#7715) 2019-04-15 16:55:18 +02:00
sublime.plugin.zsh Fix WSL check for WSL 2 and simplify nohup in open_command 2019-09-19 16:20:02 +02:00

sublime

Plugin for Sublime Text, a cross platform text and code editor, available for Linux, macOS, and Windows.

To use the plugin, add sublime to the plugins array of your zshrc file:

plugins=(... sublime)

Sublime Text has to be installed to use the plugin.

Usage

The plugin defines several aliases, such as:

  • st: opens Sublime Text. If passed a file or directory, Sublime Text will open it.

  • stt: open Sublime Text on the current directory.

  • sst: if sudo is available, sst will open Sublime Text with root permissions, so that you can modify any file or directory that you pass it. Useful to edit system files.

There are also a few functions available:

  • find_project (or stp alias): if called, the function will search for a .sublime-project file on the current directory or its parents, until it finds none.

    If there is no .sublime-project file but the current folder is in a Git repository, it will open Sublime Text on the root directory of the repository.

    If there is no Git repository, it will then open Sublime Text on the current directory.

  • create_project (or stn alias): if called without an argument, create a stub .sublime-project file in the current working directory, if one does not already exist. If passed a directory, create a stub .sublime-project file in it.