Skip to content

Instantly share code, notes, and snippets.

@lancejpollard
Created May 23, 2012 22:30
Show Gist options
  • Select an option

  • Save lancejpollard/2778234 to your computer and use it in GitHub Desktop.

Select an option

Save lancejpollard/2778234 to your computer and use it in GitHub Desktop.
Sublime vs. Textmate Notes

In TextMate, I could press CTRL-OPTION-SHIFT-<some letter> and a popup would appear showing the languages starting with that letter. So if I pressed CTRL-OPTION-SHIFT-J, javascript, java, and json would be choices, and I could press 1 to get javascript, etc. This made it so, even if the file was a .md markdown file, I could quickly switch to javascript to get some syntax highlighting as I wrote some sample code.

In Sublime Text 2 I can do vertical block selection, but I can't do it the way vim does, and this feature has been requested before:

http://sublimetext.userecho.com/topic/61014-vintage-mode-requests/

In vim you can do CTRL-V then navigate up/down to select a block, then insert some text, for example:

Vertical Text Selection in Vim

I would like to be able to practice the vim version using Sublime Text 2, rather than holding OPTION and dragging the mouse.

Last thing, in TextMate I was able to align = and : by pressing CMD-SHIFT-U when a block of text was selected. It would take stuff like this:

var a = 'Hello World';
var foo = 'bar';

var object = {
  key: 'value',
  aLongerKey: 'value'
}

And make it like this:

var a   = 'Hello World';
var foo = 'bar';

var object = {
  key:        'value',
  aLongerKey: 'value'
}

That is, it would align the = signs to the right, and the : to the left, and align the text on the right. In addition, it would always align it so there were an even number of characters from the start of the line to the right-indented word:

12345678
var a   = 'Hello World';
var foo = 'bar';

I have tried out http://wbond.net/sublime_packages/alignment briefly, but it only works on = and doesn't do the whole even spacing thing.

How do you accomplish this in Sublime Text 2?

One last thing... how do you put the sidebar on the right?

Other issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment