Sublime Forum

Install Plugins in v2

#1

I’ve read some older posts, from 2008 and 2009 but they haven’t solved my issue.

I’ve downloaded 3 plugins that I want to install, they all come down as .sublime-package (not as zip as someone had previously had an issue).

I have them set to open with ST2 but they simply open as viewable files inside the editor, there’s no popup dialogue. Is there a manual way to accomplish this?

I’m using the 64bit installed version on Win7.

Thanks.

0 Likes

#2

Plugins made for Sublime Text 1, which it sounds like you’ve got here, won’t work with Sublime Text 2 without modification

0 Likes

#3

Ah…that explains everything :smile:

Where can I find a list of plugins for 2?

Thanks!

0 Likes

#4

And how to run plugins?

I selected “New Plugin” from Tools menu and got a sample “hello world” plugin.

[code]import sublime, sublime_plugin

class ExampleCommand(sublime_plugin.TextCommand)
def run(self, edit):
self.view.insert(edit, 0, “Hello, World!”)[/code]

Saved it to Packages/User/sample-plugin.py. How do I run it?

0 Likes

#5

I added the following line to my user key bindings file:

{ "keys": "ctrl+alt+h"], "command": "example" }

It should display/insert “Hallo world!” somewhere. Nothing however happens when I press ctrl+alt+h. Am I missing sth?

0 Likes

#6

The above problem was caused but a small bug/omission. “New plugin” command opens a new tab with the following content:

[code]import sublime, sublime_plugin

class ExampleCommand(sublime_plugin.TextCommand)
def run(self, edit):
self.view.insert(edit, 0, “Hello, World!”)[/code]

Apparently there should be a colon at the end of line 3:

[code]import sublime, sublime_plugin

class ExampleCommand(sublime_plugin.TextCommand):
def run(self, edit):
self.view.insert(edit, 0, “Hello, World!”)[/code]

0 Likes