It's fantastic and gives you a simple in-editor way to add/remove other plugins, direct from their github repos, without needing to leave or restart the editor. It also automatically keeps them all up to date.
Once it's installed, you can just use the command palette (ctrl+shift+p) to install any of these plugins: http://wbond.net/sublime_packages/community, plus any others that you add via their github repo.
I'd also recommend immediately installing SublimeCodeIntel and SublimeLinter. These plus autocomplete have made ST2 the best editor I've used in 10+ years. And the latest beta is even faster than before.
Totally agree, Sublime really comes together when using some plugins and with this plugin it really makes the process of installing / trying or using / updating and removing very simple.
It makes me sad that the best tools available for writing code in so many otherwise exciting languages are still resorting to text-based autocompletion. And blogging about it as though it's something to be proud of.
This is certainly a pretty editor. But at its heart, it's still a text editor. And what I do for a living is edit code.
Code has a lot more information about it than text. I can imagine looking at a line such as:
item.hide()
in this editor, knowing that my codebase has half a dozen classes that expose a .hide member. I hesitate even to ctrl+click on it in this editor, because I know it'll either do nothing or take me to the wrong definition.
In a perfect world (and in IDEs for statically typed languages since 1998), the editor would know exactly which .hide we were talking about. And it could gracefully send me there with a single click or keystroke.
I'm still waiting for something equivalent to appear for the Ruby/Python/Javascript portion of my world. But years keep ticking by and the best we get is text editors that try to guess by looking at text.
For C and C++, the sublime text plugin 'sublime clang' ( https://github.com/quarnster/SublimeClang ) , does exactly this, as well as check code for errors as you type. I only started using it a couple of days ago, and I already can't imagine being without it.
At least from my experience working in Python, if you don't know which instance `item` is, it's a problem with your code— not the editor. Automatically taking you to that class's method is another story, but I don't think you should depend on your IDE to figure out your logic for you.
Ah, but the issue isn't you knowing which 'item' you're dealing with. It's that the IDE doesn't know, and therefore can't jump you there instantly if you ask it to.
Instead, you have to open the file in question and go find the method using one of the fiddly text-based methods that the article mentions.
So no, we're in agreement that the entire codebase belongs in your head. It's just nice to have your IDE also have the entire codebase in its head, in the actual configuration it is, rather than just knowing about a bunch of text files containing words that have no meaning to it.
>knowing that my codebase has half a dozen classes that expose a .hide member. I hesitate even to ctrl+click on it in this editor, because I know it'll either do nothing or take me to the wrong definition.
to mean you were relying on your IDE to tell you which .hide() method you were calling.
As others have pointed out elsewhere, I think giving that functionality to ST2 would push it too far into the realm of IDE.
Why not? IntelliJ can do exactly that for Java code -- right-click on a variable and choose "dataflow to here". Even in large projects, it's practically instantaneous. Of course, in Java you don't need that much information for autocompletion since you can just look at the static types.
The same kind of global dataflow analysis would have to be approximate in a dynamic language, but I'd still expect it to be better than nothing.
You're not thinking big enough. Imagine a rewinding debugger that records a complete execution of your program. Then whenever your cursor moves, the debugger could step to a point when that line of code was executing and give you autocomplete suggestions based on the state of the program at that time.
The same function can get called a 1000 times and take different paths each time. Which method is your hypothetical rewinding debugger going to show? (Leaving aside the big gaping hole of how your program is executing while you are typing it out).
The problem of deciding which method actually gets called by static analysis in a text editor (and it would have to be static analysis) is literally impossible for dynamic languages - pretty much by definition.
You are far too pessimistic; a few very simple heuristics would work great in most cases. It doesn't have to be perfect. Something imperfect would be miles better than nothing, which is what we have now for dynamic languages.
My favorite feature (already added in an earlier development release, but now finally in the beta track): On OSX, if you are editing a file you don't have write access to and you want to save it, Sublime now asks for authentication than then saves the file.
This is very convenient and not having this was the reason for still having TextMate around.
I use it every day, editing files locally in Sublime Text 2, and then cmd-tabbing to Terminal to run tests. It's fast enough that I never even think about the delay.
Try this out: http://wbond.net/sublime_packages/sftp
I haven't used it, but I'll probably end up taking a look at it soon. Please report back if you end up using it.
to work well with TextMate. I've been meaning to try it on ST2 but haven't yet; as long as ST2 doesn't do the horrible thing TextMate used to do and continuously rescan the project directory in a blocking thread, you'll be cool.
Favourite Option: When you close the editor, it just shuts down, saving all your buffers and restoring them when you reload. That means you can close the app, reboot your computer, whatever, and the edits you've been making aren't lost, and you aren't bugged for filenames.
Definitely a 'why don't all apps work like this?' feature.
Yeah, if you've been extensively using Lion for document editing, this may not seem like a big deal anymore, but in Sublime it works just as well on Windows too.
Just so you know, these features have been available for weeks now in the dev builds. They get updated almost every day sometimes, the developer is an absolute machine.
The great thing about ST2's autocompletion is that it is totally extensible, allowing you to hack your own completion routines.
I wrote an indexer for Objective-J code last year, that scans a set of folders (which can include the Cappuccino frameworks if you like) and creates a completion index of all the class names, methods, functions, etc. It was trivial to make an ST2 plugin that completes using that data.
The abilitity to write your own autocompletion plugins for the freaky/obscure kinds of files you use really rocks. Even without heavy-duty semantic analysis of the code, you can get 90% of the way there and it is really useful.
The main problem right now is that the UI is still too narrow. Voting this issue up could help get that fixed:
Well, that would really take a lot of work, to make it good.
There's some commented-out logic in the 'official' Cappuccino plugin for ST, that takes into account the scope and then works backwards to try to figure out what type of object you are messaging.
But I think the reason that's commented out is that it is easy to get some parts working, but to do it right you need to analyze the whole code base, with a real parser, be able to follow the map of import/include statements back to know what code elements are actually available in the current scope, etc etc. And that's a lot of work.
Still, there's a lot of value in doing a good job with a simpler kind of completion -- and it is way easier, as long as the editor is extensible to the extent that ST is.
The reason that I ask is that I feel I am getting stuck with C# simply due to the comfort of Intellisense. I have to find some way of replicating that experience with other languages...
I know other languages of course, but it just feels like a hassle to code without Intellisense these days :p
I totally agree with you; I think it is barbaric to code without smart autocompletion.
I think to eventually get there, though, we need open-source solutions to get as good as JetBrains, Microsoft, and Apple. Otherwise you get Apple's great (for Obj-C only) CodeSense, but you have to use their horrible, auto-corrupting, fucking disgrace of an IDE. Or to get RubyMine's absolutely unparalleled Ruby code introspection and completion, you have to use their gut-wrenchingly horrible Java monstrosity.
When the indexing and completion are decoupled from the editing environment, that's the magic sauce that will make the open source solutions fork and flourish, and good completion will finally be like toilet paper and hot water.
That's why I am really happy with editors ilk ST2 which provide good infrastructure to make things like SublimeCodeIntel possible.
I'm 37, I program a lot, and my finger joints are wearing out. Typing every single fucking character of code is insane.
I feel the same about using VS2010 without Resharper. It's barbaric and code quality suffers because cleaning requires manual work. This is why VS2010 Express is not an option.
I hope Jetbrains makes their own kick-ass C# coder-style environment. I don't care if it's Java and IntelliJ as the shell.
There are loads of things VS2010 does that I simply don't need, I just need Speed, Solutions, Projects, Building, Running, Debugging, Version Control and the things Resharper already does.
If you have dynamically typed languages in mind, give it a try without completion, you might be surprised - different paradigm depreciates completion quite a bit.
I really wish Emacs had smooth scrolling, indent guides and that Minimap. Those are some killer features that you can't just implement in Emacs' scripting language.
edit: minimap exists! (Obviously only in GUI Emacs)
Animated sub-line scrolling probably requires hacking the Emacs source. Indent guides might be possible just in elisp, but I don't know how good they would look.
I don't know if it's something wrong with my eyes, but with the new theme I get confused all the time searching for the active tab. Old theme had more contrast.
Split-screen support is still very clunky. I don't understand why you need to define a new "group". Layout-wise it makes sense as preset layouts, but other than that the group doesn't help at all.
The best split-screen implementation is E-Text Editor. In E, you can drag the tab to create a new split, then "Cmd T" in ANY tab will bring you to the previously opened file in the split. Basically I don't have to remember where the file is opened, as long as I know its name, I can just jump by typing the name. That is how quick jump should be. Also, you can arrange the windows by dragging-and-dropping to another split. I stop using E after version 1 because I made the switch Mac and I have to use Textmate, which does not support split-screen at all (what a shame!). And I miss E dearly.
Currently Sublime Text quick jump is still bad, because it still requires a context switch (switch to the group that has the file opened, then Cmd T), or worse, complete loss of current context (Cmd T would open the file in current group, thus you lose the view of the current file you're working on).
So as long as split-view doesn't get implemented properly, Sublime Text is still just another editor.
Is this just me but no-one seem to talk about it. How can I get the Sidebar to have a similar color scheme with my main theme? I like the default Monokai but the Sidebar is light. The Soda theme & Color Scheme was nice but the new UI improvement in the IDE is so good to sacrifice it for Soda.
To change the sidebar color, you can go into the default Theme directory, find the new global theme file and update it manually. It's all JSON, so just search the file for "sidebar" and you should find the RGB string to play with.
Using the vintage mode without the block cursor is annoying. It's really hard to see when you are in command mode and when in insert.
I'm using this block cursor plugin https://github.com/netpro2k/SublimeBlockCursor but it has some bugs where the cursor remains as a block until you write something.
This is actually what I'm using, though I've modified it some to work outside of vintage mode, which also seems to have eliminated most of the problem (I may have done more to it as well, I can't really remember now). The only time the "block" disappears now is when the cursor is at the end of the file, because there's no white space after it to highlight (which is logical).
A small bug with the auto-complete update when you edit a new C++ file (I've checked this only on Mac):
When you start writing #in... Sublime will suggest you #include ... pressing Enter will actually double the pound sign. You end up with something like ##include ....
I've noticed the same pattern for int m... the suggested completion was main(). Pressing Enter ends up repeating the return type of the main function, something like:
int int main(int argc, char *argv[]) ...
Maybe this a Mac only bug or it has something to do with the way the C++ syntax is parsed by the Auto-complete algorithm.
I've recently started using Sublime Text 2 for iPhone development on Windows. Okay I admit, I've been doing it for a while. Rather strange setup perhaps, but with Synergy it's a fairly seamless workflow between my Macbook Pro and Windows desktop. I keep telling myself I'll get around to purchasing a license and this finally did it for me. I wouldn't say it's purely on guilt, more of a slowly growing relationship. Auto complete is an enormous help, why wouldn't I return the favor?
Vintage mode is a killer feature for people (like me) who are wired for Vim's modal editing. The fact that it works reasonably well (somes bugs here and there but it's an alpha so understandable) is what made me even consider Sublime in the first place.
Now, after having been using Vim for about 8 years now, after a few weeks of trying Sublime, I'm pretty much ready to pony up for SublimeText 2 whenever the final version is released.
Using 'vip' to select the current paragraph didn't work for me on osx (instead it went into insert mode with the 'i'), so I gave up on my very brief trial. Did I give up too soon? Or is that oversight typical of other quirks I'll run into?
Could be a bug - I looked at the Vintage source when it was in alpha - they had implemented text objects for many delimiters but I also found some bugs with , for example 'ci{'.
Yeah, Vintage mode is really nice... but I just found this Ex package today as I didn't realize it existed. Without :s I was pretty lost in Sublime, but not now!
Wow, this is seriously nice. Never heard of it before. Just today I've been trying out Netbeans as I'm a vim addict but my colleagues keep telling me how wonderful their IDEs are - Netbeans was much too heavyweight for my liking, but this looks like just the right balance between features and simplicity/speed.
Loving the mini-map and package manager particularly. The vim emulation seems to cover most of the key ones I use too. Nice work!
Vim keybindings didn't work well for me. In command mode tried vip to select the current function definition and it instead went into insert mode with the i. To me that means it's probably got lots of other quirks. Do you just not use those types of visual mode operations? Or did it rather successfully handle this for you?
> If you’re feeling adventurous, you may want to enable the auto_complete_commit_on_tab file setting: This will make tab accept the current completion, and enter operate as normal.
I've had this on for about a week now, and although it was initially very disorienting, it's very easy to get used to it. I'd certainly recommend it, since it allows you to add a new line even if a suggestion is there.
Has the ability to navigate via UNC been added? Or more importantly, has search/replace with regular expressions improved?
I did a search/replace of [a-z] to 0 in a 50 meg text file before as a comparison between Sublime Text 2, UltraEdit, and gVim. UltraEdit was slower than I would have liked, gVim was < 10 seconds, and Sublime crashed. That's a deal breaker.
New release looks great. One problem I have with ST2 is dragging tabs from one window to another window. The actual dragging of the tab works but if it's the last tab in the window and I remove it and put in another window, I'm left with a window with no tabs in it. Can this "empty" window automatically close please?
How do people deal with remote files? I love Sublime, but always end up reverting back to VIM as it is so slow when accessing files over a network connection.
I've tried the SFTP plug-in, but find it really clumsy. Ideally I'd just love to be able to add a remote folder over SFTP the same way you do local ones.
they create a mapped drive to a location of your choosing and you edit files as if they were local.
i stopped worrying about the remote editing functionality in editors since. before that i used winscp, which detects changes and re-uploads automatically, but it's not as convenient.
I love the new look of the tabs, really nice improvement. Great to see autocomplete is built in now, I was using this one before: http://news.ycombinator.com/item?id=3064171
The new autocomplete even has lorem ipsum in it :)
I love Sublime, but I'm not really a fan of the new theme. It tends to be lighter in areas where the previous version was dark, especially in the tab-bar when using a theme like SpaceCadet.
Anyone know if it's possible to change the default tab background color for themes that don't support it?
Doesn't the new auto complete and the plug-in SublimeCodeIntel do the same thing? One of my concerns is that say you are using a plug-in for a feature that is later implemented into Sublime, now you haven't read the what's new so you have no idea. What happens then?
Not the same.
The editor itself supports almost all file types with basic auto-completion.
SublimeCodeIntel supports a few scripting languages with more intelligence.
SublimeClang doing same smart job for C/C++/ObjC.
It's just based on your work pattern to decide which one to use.
For me, all 3 of them are all very useful everyday.
I've paid for Sublime Text and think it's awesome. I primarily do Scala development and would like to use ST for it but the one thing I miss are highlighting errors in the source. Does anyone know a way to do this? I searched the ST forums to no avail.
While this plugin doesn't have Scala by default, it does include a Java linter/checker. So you could theoretically fork and expand it to do Scala as well.
Does anyone know how to display edge lines? I usually pass files through Code Sniffer before committing, so generally i try to keep lines 120 characters or less, seeing where that 120th character is; is really helpful.
I love the git package, superb. Managed to write a few custom commands to tweak things to suit my requirements, haven't tried that with any other editor / IDE :)
I'm torn between using a nice proprietary editor like this, or a fine open source one like Scribes, or even going further into the command line world like Vim.
I hope the developer is able to live comfortably while working full time on his own endeavors, rather than relegate them to a hobby, and himself into wage slavery.
Previously the auto-complete required you to press tab. Now it shows a list of possible completions as you type, from which you can select the correct one.
primarily as a web dev, the only two things preventing me from switching from NP++ is the poor and non-customizable matching bracket styling. and the buggy html matching tag highlighting (and styling as well)
once those get addressed more fully, i'm ready to cough up the cash.
It needs to be installed under Packages not Packages/User. Look at the github source for Soda Theme for further explanation... (I just read that this morning).
As soon as they have the code required to analyze your code, they aren't small, and as soon as they run that code they aren't fast. OTOH if that's the functionality you want, use eclipse, intellij (or a variant like RubyMine), and buy a beefy computer with an SSD. Eclipse isn't slow on my machine.
EDIT: Now that I look at your two requirements, that's not at all hard for a language like C or java. I recall having this in 1993 on the OS/2 version of SlickEdit. vim or emacs will handle this no problem. If you want a GUI, Visual SlickEdit will do it, and for a whole bunch of languages on every OS.
I think you are looking for the CodeIntel plugin. It takes a few minutes to index large projects, but after that, it's really fast and Alt + Click will take you to the definition of things. I switched completely from TextMate.
Is SublimeCodeIntel working well again/yet? I tried it a few months ago on Mac and it caused major slowdowns all throughout ST2 - even just typing text was slow when it's installed. I've heard other such reports on the forums, and a co-developer had the same problem last week.
I use it daily and have no issues on my machine with slowdowns or any trouble. SublimeCodeIntel + SublimeLinter + autocomplete are what made me switch to ST2 a couple months ago. Haven't touched TextMate or emacs since.
I had the same problem, until I took the recommendation of using the nightly version a couple weeks ago. Now it works great.
http://www.sublimetext.com/dev
for scripting languages, define a function as concatenated string in eval(), how could you find the function definition, without actually run the script for once?
Even if you run the script once, what if there is a delete_file() function you accidently called?
So do we need to implement a sandboxed VM in order to find definition, theoretical perfectly speaking?
sure, theoretically speaking you can't figure out everything until runtime, however even with 'scripting language' code you can still get quite far with basic static analysis.
Use case involves a class wrapping python's xml-rpc stuff to talk to Drupal.
Drupal's xml-rpc interface is not the most pleasant thing to work with, as you have to pass in a session id and auth token on every request, and then all the "actual" parameters go in as an array.
My wrapper class would query the remote interface for available methods, and then dynamically generate, via eval, a function object that used a closure to store the sess/auth tokens, and that took a variable number of arguments to pass as the 3rd array argument to the function. The eval'd function object was then bound as a method to the connection object.
It also did a bit more magic, such as on error logging the arguments to a file. ALl in all it made writing web-service clients a lot more pleasant.
Rails only does that to optimize certain function calls. eval() is used as a method to compile/inline certain functions. Most code in Rails does not use eval.
I haven't tried Komodo since a year, but when I last tried it, it definitely feet like "Not my kind".
None of the normal (you come to expect) keybindings work. It was slow/sluggish.
At the time when I checked out (I have no reason to believe why it would be much different today) Wing seemed infinitely more awesome. - The ability to split screens, the amount of time the UI actions take. The F1 and F2 that provide more screen real estate felt far more interesting than Komodo, which almost felt the opposite. Komodo didn't have the deep Python integration like wing does. The goto definition etc are far more better in Wing.
Actually, with SublimeCodeIntel, you can jump to any definition anywhere in your project.
Moreover, at least in Python (perhaps others?), you can jump to definitions in any included lib that aren't even part of your project's source code--e.g., import something from django & it'll jump you right to Django's source for any imported method, class, etc.
No doubt Sublime has all kinds of nice features, but to me the best thing is the aesthetics. It's simply a pleasure to work in this editor. Sometimes I just like to have it sit there on the second monitor, while I do something entirely different on the first one. :)
Actually, what's endearing (or outright cool) is that he has been able to create an editor good enough that people are willing to pay $50 for it. With lots of free alternatives and big players it isn't the easiest niche to break into. The fact that he's been able to do this primarily on his own makes it more impressive.
I agree; it's cool. TextMate never impressed me too much, but I bought it one day when the author casually mentioned on MacSB that his order numbers were simply sequential (so order number X meant that X licenses had been sold). I was curious.
My order number was something around 5000. So Odgaard had grossed $.25MM already. (At some point a couple years later I bought it again, and the order number was like 48000. It's no wonder he disappeared for years on end.)
ST2 seems to be on that same trajectory.
(And the grandparent comment is idiotic, of course; a truly good text editor repeatedly makes the news here just as a uniquely novel hammer would undoubtedly be a prominent theme on carpenternews.com.)
I spend about as much time using my text editor as I do my mattress, and no one looks funny at someone paying hundreds of dollars for one of those. The text editor took far longer to put together, too.
http://wbond.net/sublime_packages/package_control
It's fantastic and gives you a simple in-editor way to add/remove other plugins, direct from their github repos, without needing to leave or restart the editor. It also automatically keeps them all up to date.
Once it's installed, you can just use the command palette (ctrl+shift+p) to install any of these plugins: http://wbond.net/sublime_packages/community, plus any others that you add via their github repo.