
Setting up Sublime Text 2 - maccman
http://blog.alexmaccaw.com/sublime-text
======
looki
"The default website, icon, and theme are ugly to say the least" I can't be
the only one who completely, utterly disagrees with this? I absolutely love
the default theme and I think the icon looks great (much better than the
alternative provided). That being said, I don't want to start a whole
pointless discussion about taste here, it just kind of bothered me to read
something like that in a blog post that talks about setting up a text editor.

~~~
pdog
Yeah, I didn't understand this either. "Sublime's initial look leaves a lot to
be desired." Really? I think it looks great.

Here's another post that calls Sublime's default theme "pretty ugly" and "god-
awful": [http://floatleft.com/notebook/making-sublime-
text-2-beautifu...](http://floatleft.com/notebook/making-sublime-
text-2-beautiful)

~~~
Helianthus
I love the icon. I don't have an opinion about the default theme except to say
that part of the whole point of Sublime (to me) is to find a custom color
theme for your code. It's like css for your workspace!

I use a modified Cobalt that has much more green in it. Honestly I love that
Sublime allows you to fulfill that urge to express yourself while you're
expressing yourself (yo dawg etc.).

~~~
jasonm23
It's a bit like a teenies version of Emacs.

------
snotrockets
I tried to like Sublime, I really did. Bought a license and used it for four
months, before going back to Emacs.

Sublime is nice, and easy to extend, but it only extends so far, while Emacs
is infinitely extensible.

You can practically live in Emacs[1]; some things I wanted to do in Emacs were
hard to pull off, but I'm yet to find something it can't do. And it does so
for years.

Fashionable editors come and go, but Emacs forever stands; and if there is one
thing I don't think I'll be able to ever do again, is learn another set of
editor shortcuts. Those I used were drilled there ~10 years ago, and I don't
think they'll ever come out.

Also, author seems to take great deal about changing the editor theme and
icon. Why should you ever care about that, outside a screenshot contest?

Editor should look good by rendering a nice font at a size you find
comfortable, highlighted in colors you find easy on the eyes. If you look at
the chrome, well, you're not spending enough effort editing.

[1] I'm not the one to start wars. vi might be just as good, but I'm not going
to learn it this side of the river Styx.

~~~
swah
I love Emasc but it can't even do proper full screen. I really wish ST3 has
more APIs in the Emacs spirit, but keeping it modern.

~~~
snotrockets

      (defun full-screen ()
        "Indicate to the window manager that this frame should be full screen"
        (interactive)
        (x-send-client-message nil 0 nil "_NET_WM_STATE" 32 '(2 "_NET_WM_STATE_FULLSCREEN" 0)))

~~~
swah
That removes the borders? Any way, Unix only...

~~~
snotrockets
<http://tomayko.com/writings/that-dilbert-cartoon>

------
andrethegiant
One setting I find invaluable is to use Paste and Indent for ⌘V instead of the
standard Paste. This adjusts your indentation to automatically match the
context it's pasted in.

To do this, put the following in your Key Bindings - User file:

    
    
      [
        { "keys": ["super+v"], "command": "paste_and_indent" }, 
        { "keys": ["super+shift+v"], "command": "paste" } 
      ]

~~~
gfunk911
You just (minimally) changed my world. Thank you sir.

------
spacesuit
A few more Sublime Text plugins worth checking out:

AdvancedNewFile -- easy file/directory creation

Alignment -- shortcut for instant alignment

Emmet -- essential for HTML/CSS

GitGutter -- see diff marks in gutter

Origami -- additional shortcuts for split panes

VintageEx -- emulation of Vim's Ex-mode

The Vim emulation isn't one-to-one, but it's pretty good with Vintage mode
enabled and the VintageEx plugin installed.

------
hauget
This helped me a lot when I got started with Sublime
[http://net.tutsplus.com/articles/news/perfect-workflow-in-
su...](http://net.tutsplus.com/articles/news/perfect-workflow-in-sublime-text-
free-course) Good intro to basic configuration, shortcuts & vintage mode

~~~
baby
It's also free, and written by someone who actually used ST2 for more than a
month.

------
ricardobeat
You shouldn't set "trim_trailing_white_space_on_save": true unless you work
alone, otherwise you're going to have random whitespace changes polluting your
diffs.

~~~
maccman
Our coding guidelines at Stripe specify that whitespace is to be stripped. It
works if everyone does it.

On the occasion where whitespace does pollute the diff, GitHub has a
convenient feature where you can append '?w=1' to any diff URL and whitespace
changes will be omitted.

~~~
foobar2k
The number of pull requests I get where the diffs are completely unreadable
because someone has this feature enabled is insane. On certain whitespace
dependent languages (I'm looking at you Python) simply supressing the
whitespace in the diff is not an option.

What are the arguments for having whitespace removal as a coding standard?

~~~
mixmastamyk
Trimming at the end of line has no effect on python.

~~~
Silhouette
But other whitespace does, so globally disabling whitespace in a diff isn't
very helpful.

------
mtp0101
I find it odd that Sublime is so widely loved. It seems like a way-station
between Notepad and Vim/Emacs. The extensions are nice, and the GUI is easy on
the eyes, but it seems that most of my peers outgrew their Sublime
Text/Notepad++/Textmate stage by the time they completed their first year of
undergrad. I would hate to be stuck in the slow world of Sublime Text limbo as
a result of being too lazy to learn and customize Vim/Emacs.

~~~
dnos
You find it odd that Sublime Text is so widely loved? Seriously? It combines
the greatness of some of the best editors out there into a single one that is
approachable and sexy and you can't see how it appeals to the masses?

Let's list out some of my favorite features of Sublime Text (please keep in
mind I switched FROM vim to Sublime):

1.) VIntage mode that allows for 99% of day-to-day vim stuff 2.) A plugin
system that uses Python and offers a full-featured API (vimscript anyone?
pfft) 3.) Full mouse/windows support (i.e. it's not ghetto mouse support
thrown over a terminal window from the '70s) 4.) Textmate-style themes that
even allows tweaking to the UI 5.) Native Linux, MacOS, and Windows versions

The only negative is that it isn't open-source, which I hate, but the
licensing is very reasonable (it's per person, not machine, so you can install
it on as many devices as you use)

I'd really like to see you give a real-world example of how it's slow compared
to vim/emacs, because maybe I'm missing something. I've been using Sublime
Text for over a year and have only had to break out vim a couple of times for
some crazy vim-style search/replacing or to quickly open some super-large text
files (I think better large-file handling is in the works for sublime
though...).

Oh, and one of Sublime Text's best feature? It doesn't come with the elitist
attitude that a lot of vim and emacs users seem to get... :)

~~~
Uchikoma
How is the buy-the-beta-then-there-is-a-new-version-immediately-you-need-to-
pay-for-again reasonable licensing?

~~~
chipotle_coyote
As someone who purchased Sublime Text 2 over a year ago, I'll have to pay a
$30 upgrade fee. Someone who purchases v2 _now_ (or any time after the
announcement of v3) will get the upgrade free. Anyone who purchased v2 in the
90-day period before v3 was announced will be able to upgrade for only $11.

This doesn't strike me as wildly unreasonable.

~~~
Uchikoma
To me this is unreasonable when there is no progress on a bought version.

------
alexshenoy
I actually like that the preferences are stored in JSON. This is one of the
features that pulled me in to Sublime Text.

~~~
stormbrew
I wish it was yaml. Even the slightly relaxed json (comments!) is still too
picky for my taste.

~~~
lobster_johnson
I think TOML [1] would be even more suitable.

[1] <https://github.com/mojombo/toml>

------
senko
If you use ST2 for working on Django projects, try
<https://github.com/dobarkod/DjangoNoseTestRunner> (installable also via
Package Control) for running only the test under cursor. It's probably saved
us hours of (cumulative) time already.

------
itsbits
Another awesome plugin in ST2 is WebInspector
<https://github.com/sokolovstas/SublimeWebInspector> for Web Devs

------
zenocon
The TrailingSpaces plugin isn't necessary. ST2 has an option in the default
preferences to trim whitespace at the end of the line - just enable it. Not to
come down too hard on the article or anything, but there are many other, far
better resources for setting up and learning how to be productive in ST2. This
book is good <https://leanpub.com/sublime-productivity> (I have no affiliation
with the book.)

~~~
Terretta
That's all fine and good until you're using JADE:

    
    
        h1
          | We build 
          span.colored-text scalable 
          | web sites & engineer 
          span.colored-text powerful 
          | platforms
    

If you delete trailing spaces, you'll have no spaces between any word at the
end of the line and the word in the next section.

Point being: trailing spaces can be significant.

~~~
zenocon
So throw a nbsp; in front of the text in your span.colored-text Jade?

------
codexon
I was looking at Sublime Text for Go, and apparently the autocomplete box
cannot be expanded so it is unable to display function arguments.

<https://github.com/DisposaBoy/GoSublime/issues/212>

Probably an issue for other languages as well.

------
taude
What's the easiest way to keep my Sublime configuration synchronized between
machines? I've found that I sometimes have some plugins on one machine, and
not another. It would be nice to be able to pull some file/files from GIT or
something to keep configuration synced.

~~~
chesh
I recommend this approach to sync config files over Dropbox to get exactly the
same editing environment from Win, Mac, and Linux:

1) move the /User folder under "Sublime Text 2/Packages" over to
Dropbox/ST2/User

2) in Win goto CMD and from the %APPDATA%\Sublime Text 2\Packages folder
enter: mklink /D "User" "path to\My Dropbox\ST2\User"

3) in Mac OSX/Linux goto the Packages folder (you can find the location under
>Preferences>Browse Preferences) and enter: ln -s pathto/Dropbox/Sublime\
Text\ 2/User ./User

The fantastic thing with this setup is that in any new machines, Package
Control will automatically take care of installing any missing plugins.

~~~
taude
Thanks for this. Going to give it a try. Also appreciate that you've got some
solution working across multiple OSes.

------
dechols
For you python Sublime users: [http://dechols.com/post/40402860395/sublime-
text-2-python-de...](http://dechols.com/post/40402860395/sublime-
text-2-python-development-environment-in)

------
sspiff
> The default website, icon, and theme are ugly to say the least

I find the default icon better looking than the one the author is using, so I
guess this is just a matter of taste. Same goes with the color scheme.

------
kiernan
I do most of my editing on remote machines (both at work and at home) and
haven't really been able to find a setup that works smoothly for this.

Is everyone else developing _everything_ on their local machines?

~~~
8ig8
You could try the SFTP package. With it, you can mirror a remote directory
locally and the package will automatically upload the change in the
background. It has some other useful features for working on remote files.

<http://wbond.net/sublime_packages/sftp>

------
Kluny
I tried switching to the Soda theme as directed, didn't like it. And I'm dumb,
and forgot to back up the original prefs file. Could someone remind me what
the default theme is called?

~~~
pedroo
Just delete the line. It should revert back to the default theme.

------
emc
Also for anyone that uses both Alfred (2.0) and sublime check out
<https://github.com/Humanoidism/SublimeIt>

------
websitescenes
Sublime 2 rules! Simple, great shortcuts and just plain nice to look at. They
even let you use it for free. I bought it shortly after trying it out.

------
Void_
More icon replacements: <http://dribbble.com/search?q=sublime>

------
rydgel
Am I the only one to find Python syntax highlighting pretty poor? Is there any
tip, color schemes or plugins to improve this?

------
nshankar
Get me block level (vit, cit ...) commands in ST2 and I will switch. They are
done very well in Vim.

~~~
kyrias
Vintage mode (which comes with ST) supports most common vim commands and
either way there's plugins for most things and you can write your own for
pretty much anything at all.

~~~
johncoltrane
This is still a very small subset. If you are a moderately advanced Vim user,
neither Vintage nor VintageEX are enough, I'm afraid.

~~~
kyrias
Anything that isn't built in you can add yourself...

~~~
johncoltrane
Versus having it built-in in my current editor?

------
panabee
what plugin do people use for highlighting brackets and parentheses? the
default underline mode is faint and not very helpful. i have heard of one or
two, but i'm curious to hear what people on HN use. thanks!

~~~
missing_cipher
I'm using BracketHighlighter.

~~~
panabee
cool, thanks. that's one i saw before, but some people complained about
performance degradation. have you seen any performance hit after installing
the plug-in?

~~~
missing_cipher
You know, a few months ago I think so, but I could never find the culprit.
I've had no issues recently, so maybe they updated it?

------
ChikkaChiChi
I can't believe this many people care about how the icon looks.

