Home Download Buy Blog Forum Support

Please help me keep Sublime Text 2!

Please help me keep Sublime Text 2!

Postby kakubei on Sun Dec 18, 2011 6:57 am

Hello, here's my problem in a nutshell:

Love SublimeText 2, bought it, been using it now for months. However I came from Textmate and now that there's an alpha of Textmate2 out I find myself drifting back because of a couple of things I really like in Textmate. If some kind souls could point me in the right direction to replicate the Textmate features in Sublime I'd be ever so grateful. Mainly:

    Highlight matching pairs of parentheses or brackets
    Textmate autocompletion: invoked by Escape key (can't find where to change that in the ST2 prefs) and hitting the key again cycles through completion list
    Better completion (in Textmate on a Ruby doc, hitting '#' inside double quotes will automatically make it '#{}'. And typing '<%=' will close it with a '%>'. These are small but wonderful improvements)
    Better undo. With SublimeCode Intel installed, undo in ST2 is one character at a time!
    Bundle expansion: Under Bundles-> Ruby on Rails-> Models there is a whole list of often used commands to insert or tools to use, this would be great in ST2.

I'll start with these so as not to get crazy. Thanks in advance.
kakubei
 
Posts: 58
Joined: Sun Sep 25, 2011 9:19 am

Re: Please help me keep Sublime Text 2!

Postby skaet on Sun Dec 18, 2011 8:12 am

Allow me to refer you to https://github.com/facelessuser/BracketHighlighter which is available through Package Control.

SublimeCodeIntel allows you to cycle through an autocompletion list with ctrl+space.
skaet
 
Posts: 93
Joined: Thu Sep 16, 2010 3:37 pm

Re: Please help me keep Sublime Text 2!

Postby kakubei on Sun Dec 18, 2011 10:53 am

skaet wrote:Allow me to refer you to https://github.com/facelessuser/BracketHighlighter which is available through Package Control.

SublimeCodeIntel allows you to cycle through an autocompletion list with ctrl+space.

Thanks, I've downloaded BracketHighlighter, but it doesn't behave as Textmate does where it highlights the brackets in a clear yellow solid colour. It seems to put an underscore on them (something recent versions of ST2 already did) but the solid option, though turned on in the prefs, does not work for me.

Also, CodeIntel I had to disable due to the undo problem.
kakubei
 
Posts: 58
Joined: Sun Sep 25, 2011 9:19 am

Re: Please help me keep Sublime Text 2!

Postby leeturner on Sun Dec 18, 2011 1:27 pm

kakubei wrote:Highlight matching pairs of parentheses or brackets.


I use SublimeBrackets for this type of thing - https://github.com/pyparadigm/SublimeBrackets

Cheers
Lee
leeturner
 
Posts: 4
Joined: Sat Dec 17, 2011 8:26 pm

Re: Please help me keep Sublime Text 2!

Postby facelessuser on Sun Dec 18, 2011 3:34 pm

kakubei wrote:Thanks, I've downloaded BracketHighlighter, but it doesn't behave as Textmate does where it highlights the brackets in a clear yellow solid colour. It seems to put an underscore on them (something recent versions of ST2 already did) but the solid option, though turned on in the prefs, does not work for me.


BracketHighlighter only does the style you set in the settings

Code: Select all
//Outline? (solid/outline/underline/none) ->
   "quote_style" : "solid",
   "curly_style" : "solid",
   "round_style" : "solid",
   "square_style": "solid",
   "angle_style" : "solid",
   "tag_style"   : "outline",


If you are getting underlining as well as colored blocks, it is because you have ST2's version of bracket highlighting enabled as well. You can turn off ST2's default bracket matching, and use just BracketHighlighters, and then configure BracketHighlighter to the style and color you prefer.

leeturner wrote:I use SublimeBrackets for this type of thing - https://github.com/pyparadigm/SublimeBrackets

Originally I used SublimeBrackets as well, but it will bog down the editor with its current implementation in large files; this is an outstanding issue that I could not live with. BracketHighlighter is a fork of SublimeBrackets and SublimeTagmatcher that fixes these performance issues and adds new features. I never got a response back from pyparadigm about the performance issue which is why I decided to create BracketHighlighter. By no means am I saying you need to switch to BracketHighlighter, but I wanted to illustrate why there are two different highlight packages, and illustrate why SublimeBrackets will not give you extremely different results since BracketHighlighter and SublimeBrackets both have the same origin. BracketHighlighter streamlined the matching processes into one that will not bog down your system and cause your typing and selecting to stutter.
facelessuser
 
Posts: 1460
Joined: Tue Apr 05, 2011 7:38 pm

Re: Please help me keep Sublime Text 2!

Postby C0D312 on Sun Dec 18, 2011 5:15 pm

Textmate autocompletion


Check out the Textmate autocomplete plugin: https://github.com/alexstaubo/sublime_text_alternative_autocompletion

Better completion (in Textmate on a Ruby doc, hitting '#' inside double quotes will automatically make it '#{}'. And typing '<%=' will close it with a '%>'. These are small but wonderful improvements)

For the ruby completion, add this to your User key-bindings:
Code: Select all
[
  {
    "args": {
      "contents": "#{${0:$SELECTION}}"
    },
    "command": "insert_snippet",
    "context": [
      {
        "key": "selector",
        "match_all": true,
        "operand": "string.quoted.double.ruby",
        "operator": "equal"
      }
    ],
    "keys": [
      "#"
    ]
  },


Better undo. With SublimeCode Intel installed, undo in ST2 is one character at a time!

This has been fixed in the lastest dev build.
C0D312
 
Posts: 1063
Joined: Sun Jul 10, 2011 3:23 am

Re: Please help me keep Sublime Text 2!

Postby leeturner on Sun Dec 18, 2011 8:05 pm

facelessuser wrote:
leeturner wrote:I use SublimeBrackets for this type of thing - https://github.com/pyparadigm/SublimeBrackets

Originally I used SublimeBrackets as well, but it will bog down the editor with its current implementation in large files; this is an outstanding issue that I could not live with. BracketHighlighter is a fork of SublimeBrackets and SublimeTagmatcher that fixes these performance issues and adds new features. I never got a response back from pyparadigm about the performance issue which is why I decided to create BracketHighlighter. By no means am I saying you need to switch to BracketHighlighter, but I wanted to illustrate why there are two different highlight packages, and illustrate why SublimeBrackets will not give you extremely different results since BracketHighlighter and SublimeBrackets both have the same origin. BracketHighlighter streamlined the matching processes into one that will not bog down your system and cause your typing and selecting to stutter.


Ah, I didn't know this. Many thanks for the info. I am new to Sublime Text (3 days and counting) so just getting my head around the different plugins.

L
leeturner
 
Posts: 4
Joined: Sat Dec 17, 2011 8:26 pm

Re: Please help me keep Sublime Text 2!

Postby kakubei on Mon Dec 19, 2011 9:50 am

C0D312 wrote:For the ruby completion, add this to your User key-bindings:

Superb! Thanks. What about getting it to close the <%= and <% tags, how can I accomplish that?

This has been fixed in the lastest dev build.

Dev build of ST2 or SublimeCodeIntel? I've got the latest ST2 (just updated right now) I installed SCI from ST2's package manager, should I get it from Github instead?
kakubei
 
Posts: 58
Joined: Sun Sep 25, 2011 9:19 am

Re: Please help me keep Sublime Text 2!

Postby kakubei on Mon Dec 19, 2011 9:54 am

Aha, installing the plugin from github instead of using the Package Manager within sublime has actually done the trick!

My next question is how to change the colour of the highlights? I don't see it anywhere in the prefs.

Thanks.
kakubei
 
Posts: 58
Joined: Sun Sep 25, 2011 9:19 am

Re: Please help me keep Sublime Text 2!

Postby kakubei on Mon Dec 19, 2011 10:28 am

C0D312 wrote:Check out the Textmate autocomplete plugin: https://github.com/alexstaubo/sublime_text_alternative_autocompletion


Terrific! Thanks so much, this has REALLY been bothering me for a long time, I just didn't have time to hunt around. Now I am much happier :D

To close the <% I guess I could create my own snippets, just wondering if there is a better way to do it.
kakubei
 
Posts: 58
Joined: Sun Sep 25, 2011 9:19 am

Next

Return to Technical Support

Who is online

Users browsing this forum: antonio.anacleto, Yahoo [Bot] and 34 guests

cron