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

Shell​VE

by pykong ST3 Linux

Automagically opens a shell with a project's virtual environment already started.

Details

Installs

  • Total 27
  • Win 0
  • OS X 0
  • Linux 27
Jan 22 Jan 21 Jan 20 Jan 19 Jan 18 Jan 17 Jan 16 Jan 15 Jan 14 Jan 13 Jan 12 Jan 11 Jan 10 Jan 9 Jan 8 Jan 7 Jan 6 Jan 5 Jan 4 Jan 3 Jan 2 Jan 1 Dec 31 Dec 30 Dec 29 Dec 28 Dec 27 Dec 26 Dec 25 Dec 24 Dec 23 Dec 22 Dec 21 Dec 20 Dec 19 Dec 18 Dec 17 Dec 16 Dec 15 Dec 14 Dec 13 Dec 12 Dec 11 Dec 10 Dec 9 Dec 8
Windows 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 0 0 0 0 0 0 0 0
OS X 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 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 1 0 0 1 1 0 0 0 0 1 0 1 0 0 0 0 0 0 0 1 2 1 0 0 0 0 1

Readme

Source
raw.​githubusercontent.​com

ShellVE

Sublime Text 3 plugin to automagically open TerminalView tab with a project's virtual environment already started.

Why?

I always liked how PyCharm linked a project with a perticular virtual environment. You, easily set it up once. Then you never need to remember the correct virtual environment to start in you shell. One project, one virtual environment. And you project automatically runs with the correct one. The Virtualenv plugin for Sublime Text makes a similar linkage possible, but it is only for build systems. If you need more control, e.g. when wanting to install libs to your VE, you are going to need a shell. ShellVE fills that gap for you.

Installation

Do it via PackageControl. You likely know how to. (Else see PackageControl Usage.)

Satisfy dependencies

As the plugin relies on TerminalView as the terminal emulator and sole dependency. Hence you need to install TerminalView before you can use ShellVE.

Usage

1. Make sure virtual environment path is included into your .sublime-project:

[
          "settings": {
              "python_interpreter": "/home/user/.virtualenvs/example/bin/python"
          }
    ]

Note: This is the same format for specifying the VE path as used in the essential python development plugin Anaconda. Yet, the format is different from that used in the plugin Virtualenv.

2a. Just open the project and a view with a shell window with your virtual environment already started will automatically open.

How cool is that?
This is dependend on the sophisticated terminal plugin TerminalView by the ingenious Wramberg.

2b. Alternatively open via keybinding.

This is useful if you closed the automatically spawnded TerminalView.

Default keybindings:

Linux: ctrl + super + v

Limitations

  1. Currently works only on Linux. I am not going to expand it to other platforms, yet I will welcome any pull requests in this regard.

  2. Currently only works with TerminalView as the dependend terminal plugin. There are other great terminal emulators for Sublime Text, like Terminal or Glue. I am not going to expand it to other terminal plugins though either. Yet, also welcome regarding pull requests.

  3. Environment variables are not inherited from the virtual environment currently

TODO

  • Making sure terminal is always started in project folder.
  • Ensure environment variables are always the same, irrespective if a virtual environment is started in the system terminal or ShellVE.

Contributors

  • A big ThankYou to Wramberg for providing the amazing TerminalView plugin!