top | item 5519979

Setting up Sublime Text 2

178 points| maccman | 13 years ago |blog.alexmaccaw.com | reply

134 comments

order
[+] looki|13 years ago|reply
"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.
[+] ianstormtaylor|13 years ago|reply
The default is pretty horrid I think. The sidebar's blue draws way too much attention. Folders and files aren't differentiated nearly enough. The tabs also draw too much attention to themselves. Honestly it looks like the most barebones Mac app that there is, which is exactly what it is. The icon isn't much better. Looks very generic and 99 Design-y, doesn't express what Sublime is about at all. I personally prefer this one: http://dribbble.com/shots/311515-A-Sublime-Text-2-Icon-that-...
[+] tiglionabbit|13 years ago|reply
Looking at the default icon a bit more closely, the gradient kind of messes with my eyes and makes the S look fuzzy. If you compare it to other common icons, you'll notice none of them transition quite so harshly that the gradient produces more contrast than the other shapes in the picture. The new icon provided simplifies it a lot, and makes the S more readable, but at the expense of throwing away any hint about what the app is for. I think it'd be best to just tweak the original icon's colors so it looks more clear, while keeping the keyboard key look to it.
[+] snotrockets|13 years ago|reply
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.

[+] lelandbatey|13 years ago|reply
What I'm about to say comes down more to philosophical differences than differences of opinion about Sublime Text 2.

I do not have extensive experience with Emacs. However, I've often heard it described as an infinitely extensible system, or as you put it "you can practically live in Emacs."

I find that a bit odd, because it's like building an OS inside an OS. I already have an infinitely extensible system, namely my actual OS (*nix). I want a tool that nicely fits within that system, not supplants it. And then I want that tool to be the best possible tool at what it is (in this case, a code editor). If I need other operations/actions, then I will use other tools.

[+] SeanDav|13 years ago|reply
I suspect there is far more of a flavour of elitism in ones use of a text editor than any true benefit in real world productivity.

I tried ST2 to see what all the fuss was about. I still use it occasionally (mainly for its layout view on the right hand side), but Notepad++ is my main editor as ST2 has a particular problem that you can't toggle the reloading of a changed file.

I use Vim for huge files.

In any case, when I am programming I spend more time thinking than typing and unless I am doing heavy re-factoring of code, more powerful text editors are just a non issue for me.

[+] hueyp|13 years ago|reply
What do you use to replace command-T in ST2 in Emacs? I recently picked up Emacs because I'm doing a clojure project (I can't get ST2 to work with nrepl) but I am having a hard time without the command-T fuzzy search.

I have ido and find-file-in-project installed but neither of them seem to include directories in the fuzzy search. So if I search 'custcore' it won't match 'customer/core.clj'. If I instead search 'core' it is too broad of a term. I really need very little out of an editor, but this is one of those things.

[+] angrycoder|13 years ago|reply
> [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

Of course you aren't, as long as it is one of the two editors you approve of.

[+] swah|13 years ago|reply
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.
[+] andrethegiant|13 years ago|reply
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|13 years ago|reply
You just (minimally) changed my world. Thank you sir.
[+] spacesuit|13 years ago|reply
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.

[+] ricardobeat|13 years ago|reply
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.
[+] mtp0101|13 years ago|reply
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.
[+] Silhouette|13 years ago|reply
I find it odd that Emacs is so widely loved. It seems like a way-station between Notepad and a proper text editor that fits in with all the other software on my system, using familiar keyboard and mouse commands so I can get things done instead of having to look up arcane rituals worthy of Git to do any moderately powerful editing task and learning a failed programming language to do any sort of scripting or customisation instead of using a modern one I already know. I would hate to be stuck in the slow world of Emacs limbo because it took so damn long to customise everything instead of just setting it up in a few minutes and then getting on with real work.

Disclaimer: Yes, this post is a sarcastic parody of the parent. Mostly...

[+] dnos|13 years ago|reply
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... :)

[+] aeze|13 years ago|reply
Interesting that you pin it down to laziness. In my opinion it has more to do with the fact that the learning curve of Vim/Emacs outweighs their usefulness.

I can understand their use being much more of a necessity in previous years, but I think their time of unparalleled performance and productivity are over. Having used Vim for a few years (having studied it for many hours) and then switching to Sublime Text - I don't see any productivity decrease.

That being said, if you are happy using Emacs - by all means continue to do so!

[+] recursive|13 years ago|reply
It shouldn't be that surprising. I tried vim for a while, but I prefer sublime text. It's true that vim is more powerful, but for me that power seems to mostly theoretical. It doesn't seem to make me significantly faster in the real world. On the other hand, the basic text navigation keys in sublime text are the same as they are elsewhere in my os, so I don't have to switch in and out of "text editing mode" frequently. In any case, congratulations on advanced text editing learning curve.
[+] FuzzyDunlop|13 years ago|reply
I used Sublime for a while, then switched to Emacs for a while. I ended up switching back because, while I really liked Emacs, I didn't like being stuck in a terminal and I couldn't do effective pair programming.

The best bit about Emacs is the configuration, and I could give or take the awkward keybindings. Maybe if LightTable supported configuration with ClojureScript and offered a comprehensive API for it there'd be a more modern equivalent.

[+] CJefferson|13 years ago|reply
Some users, like myself, used and customised vim before moving to sublime text.I'm not saying you, or anyone else, shouldn't use vim, but some of us feel more productive in ST than vim.T alking about "the slow world of sublime text limbo" seems unnecessarily insulting.
[+] adamors|13 years ago|reply
I found ST2 a great tool for learning Vim actually. It has a Vim mode and although it's not a complete Vim emulation it gets most of the movement/editing right with key bindings.

I've learned a lot and I'm actually at a point where I feel the need to move on to Vim (due to the limitations of ST2's mimicry of Vim)

[+] alexshenoy|13 years ago|reply
I actually like that the preferences are stored in JSON. This is one of the features that pulled me in to Sublime Text.
[+] stormbrew|13 years ago|reply
I wish it was yaml. Even the slightly relaxed json (comments!) is still too picky for my taste.
[+] FuzzyDunlop|13 years ago|reply
I'd love it if they were stored in dotfiles (something I like about Textmate 2), but at least all your config gets stored in a nice User package.
[+] account_taken|13 years ago|reply
I just wish Sublime didn't have a mine of its own. It has a bad habit of rewriting my config with my comments removed.
[+] itsbits|13 years ago|reply
i agree..its easier to edit
[+] zenocon|13 years ago|reply
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|13 years ago|reply
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.

[+] taude|13 years ago|reply
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.
[+] sspiff|13 years ago|reply
> 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|13 years ago|reply
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|13 years ago|reply
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

[+] balac|13 years ago|reply
When I use remote machines I mount them with samba / ssh so I can use an IDE / Sublime
[+] Poyeyo|13 years ago|reply
Yes, most of us use git.
[+] Kluny|13 years ago|reply
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?
[+] websitescenes|13 years ago|reply
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.