ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Mise

by guille ST4

A Sublime Text package for interaction with Mise

Labels build system

Details

Installs

  • Total 10
  • Win 2
  • Mac 4
  • Linux 4
Apr 25 Apr 24 Apr 23 Apr 22 Apr 21 Apr 20 Apr 19 Apr 18 Apr 17 Apr 16 Apr 15 Apr 14 Apr 13 Apr 12 Apr 11 Apr 10 Apr 9 Apr 8 Apr 7 Apr 6 Apr 5 Apr 4 Apr 3 Apr 2 Apr 1 Mar 31 Mar 30 Mar 29 Mar 28 Mar 27 Mar 26 Mar 25 Mar 24 Mar 23 Mar 22 Mar 21 Mar 20 Mar 19 Mar 18 Mar 17 Mar 16 Mar 15 Mar 14 Mar 13 Mar 12
Windows 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0
Mac 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 1 0 0 0 1 0 0
Linux 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0

Readme

Source
raw.​githubusercontent.​com

Mise integration for Sublime Text

A Sublime Text package that integrates with mise.

build example

What this does

Environment loading

This package will load the environment variables that Mise provides when you open a project and clean up after itself after changing.

This feature looks through the folders configured in your sublime-project file, trying to find any that have a mise.toml or mise.local.toml in its root.

The package will load environments from any top-level folders, but it will give priority to ancestors when there are clashes.

I'll illustrate with an example: if your directory structure is like this:

root
├── mise.toml (defines FOO=1)
└── server
    ├── mise.toml (defines BAR=2)
    └── component
        └── mise.toml (defines BAZ=3 and FOO=9)

This package will load the following variables:

FOO=1
BAR=2
BAZ=3

Build system

The package provides a build system for the mise task runner. When using the provided build system it will:

  • List available tasks
  • Interactively prompt you for a task to run
  • Execute that task and how syntax-highlighted output in Sublime Text's build output panel

Commands

Another way of interacting with Mise is through the “Mise: Run task” command, available in the Command Palette. This will fetch the available tasks defined in your project and give you a menu to select from. The selected task will be ran.

There is also a command to execute mise trust from the editor. It is available in the Command Palette as “Mise: Trust config”.

In order to find the directory from which to run Mise for a command, the preference is: 1. The directory of the currently-open file. 2. The first directory you have in the sidebar/project. 3. Your $HOME directory.

Installation

Package Control

  1. Open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P)
  2. Search for “Package Control: Install Package”
  3. Search for “Mise” and install

Manual

Put this repository inside your Sublime Text Packages folder.

Requirements

  • mise must be in Sublime's PATH

Limitations and future work

  • It hasn't been tested on Windows. Let me know if it works or not so I can fix it/remove this line.
  • Doesn't support all the config file paths Mise supports. That means if you store your mise config in e.g. mise/config.toml, Sublime won't automatically offer you Mise as an option for building. Environment loading also won't work.
  • Planned features (read: will likely never bother, feel free to open a PR)
    • Load global Mise environment on plugin load (configurable via setting)
    • Better syntax highlighting of the results.
    • A “Mise Exec” build system that prompts the user for any command and does mise exec -- $input