Home Download Buy Blog Forum Support

Install Plugins in v2

Install Plugins in v2

Postby nerotic on Sat Mar 19, 2011 12:17 am

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.
nerotic
 
Posts: 5
Joined: Sun Feb 06, 2011 10:14 am

Re: Install Plugins in v2

Postby jps on Sat Mar 19, 2011 2:30 am

Plugins made for Sublime Text 1, which it sounds like you've got here, won't work with Sublime Text 2 without modification
jps
Site Admin
 
Posts: 3062
Joined: Wed Mar 19, 2008 12:33 pm

Re: Install Plugins in v2

Postby nerotic on Sat Mar 19, 2011 7:31 am

Ah...that explains everything :)

Where can I find a list of plugins for 2?

Thanks!
nerotic
 
Posts: 5
Joined: Sun Feb 06, 2011 10:14 am

Re: Install Plugins in v2

Postby qqq on Sat Mar 19, 2011 2:38 pm

And how to run plugins?

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

Code: Select all
import sublime, sublime_plugin

class ExampleCommand(sublime_plugin.TextCommand)
   def run(self, edit):
      self.view.insert(edit, 0, "Hello, World!")


Saved it to Packages/User/sample-plugin.py. How do I run it?
ST2 Win7 64-bit
qqq
 
Posts: 57
Joined: Tue Mar 08, 2011 9:49 am

Re: Install Plugins in v2

Postby qqq on Sun Mar 20, 2011 7:04 pm

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

Code: Select all
{ "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?
ST2 Win7 64-bit
qqq
 
Posts: 57
Joined: Tue Mar 08, 2011 9:49 am

Re: Install Plugins in v2

Postby qqq on Sun Mar 20, 2011 8:15 pm

The above problem was caused but a small bug/omission. "New plugin" command opens a new tab with the following content:
Code: Select all
import sublime, sublime_plugin

class ExampleCommand(sublime_plugin.TextCommand)
   def run(self, edit):
      self.view.insert(edit, 0, "Hello, World!")


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

Code: Select all
import sublime, sublime_plugin

class ExampleCommand(sublime_plugin.TextCommand):
   def run(self, edit):
      self.view.insert(edit, 0, "Hello, World!")
ST2 Win7 64-bit
qqq
 
Posts: 57
Joined: Tue Mar 08, 2011 9:49 am


Return to Technical Support

Who is online

Users browsing this forum: No registered users and 12 guests