Hacker News new | past | comments | ask | show | jobs | submit login
Sublime Text 2 Beta released with Auto-complete and Improved UI (sublimetext.com)
299 points by sathishmanohar on Jan 12, 2012 | hide | past | favorite | 151 comments

Anyone using this editor should install this plugin first:


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.

CodeIntel never fails to make ST2 crash for me. :(

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.

I feel SublimeClang is a must have for C/C++/ObjC developers

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:

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.

Maybe next year.

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.

I suppose it was a misunderstanding. I took this

>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.

What about parameters to functions?

  def spam(eggs):
Should autocompletion go find all callers of spam() and see what they are passing in in order to determine what should be available at that point?

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.

Seems to me that the ducked-typed nature of Python makes it pretty much impossible to determine this information in a text editor.

    class A(object): def read(): return 'A'

    class B(object): def read(): return 'B'

    def doit(i):
        if i==1: obj = A()
        else: obj = B()
        return obj.read()
When you put your cursor over the .read() in obj.read(), where does it point to?

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.

Doesn't solve the problem.

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.

how about just a popup box that lets you choose where you would like to go?

I see this type of situation as something that shouldn't happen very frequently.

Also, you could take this one step further and have it split screen the methods in multiple files if you like.

That just reminds me of Steve Yegge's rants.

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.

Is there any way to do the same in Vim?

  :w !sudo tee %

And here's the little mode-specific map I use:

cmap w!! w !sudo tee % >/dev/null

That's one annoyance out of the way. Is there a decent way to work with remote files yet?

This is always the killer for me.

On OS X, I highly recommend Dripbox. It automatically SCP's files that change on your local filesystem to a remote location.


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.

Been using this package for some time now and can say that it's been great. It's super-fast, and is integral to my work flow.

OK, this isn't "decent". But: On a Mac, with a good connection to the remote machine, I've found the combination of

- ExpanDrive, which uses MacFUSE to mount remote volumes over SSH, but with lots of metadata caching smarts to make it fast and reliable

- My hacky remote textmate script, which gives you a "mate" command on the remote machine via ssh tunneling (https://github.com/jaylevitt/textmate_remote)

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.

TextMate 2 has `rmate` which lets you edit a remote file from a terminal session: http://blog.macromates.com/2011/mate-and-rmate/

I just use Transmit to mount remote file systems. Works like a charm.

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.

This is the default behavior of document based apps on OS X starting with Lion. For instance: TextEdit behaves this way.

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.

Yeah, It's new to me on Windows.

My favorite feature: a dedication from the developer to fix bugs even on Linuxes they aren't personally running (Arch Linux in this case).


Nice debugging! Definitely worth a read.

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:


What would it take to get it to be as smart as, say, Intellisense?

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.

Cmon Jetbrains, you can do it!!! Please?

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.

Indeed. When getting really funky with ruby's metaprogramming, completion isn't going to help you.

BTW the SublimeCodeIntel project is really interesting in this regard.


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.

Let me point out that the Emacs minimap is way cooler than that of SublimeText. Check out the semantic overlays.

I'm not sure what "Animated sub-line scrolling" is but "smooth scrolling" returned a lot of hits:





Yes, trying to do fancy things in Elisp can be a bit kludgy.

You can add indent guides to Emacs. Look for the first result in google.

> you can't just implement in Emacs' scripting language.

you can't implement minimap in CLI. It's a GUI concept.

Now now, let's not be hasty. Here's a text-mode app with thumbnails across the bottom of the screen:


Yeah but that looks like caca now, doesn't it?

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.

Edit: installing Soda theme[1] solved it!

[1]: https://github.com/buymeasoda/soda-theme/

This guy has to be on caffeine, modafinil, and love for his product. Incredible velocity here.

Is it... really just one guy doing the core dev work? (nonwithstanding plugins and so forth)

Yeah, it's one guy called Jon. He's been really responsive when I've talked to him.

That is amazing! I'm impressed....

All it's missing now is a better icon; preferably not another blue one. Normally end up with this one (blue I know). http://www.designkode.com/blog/sublime-text-icon

This is such a great editor. Each update adds things I really appreciate. (How did I ever live without indent guides?)

I've been working in XCode so much lately that I've gotten really used to this style of autocomplete, so this update is very welcome.

Yes—indent guides are pretty sweet.

Sublime Text 2 is amazing. I bought it and used it for a bit. Even with vintage mode, I missed vim too much and switched back.

I do wonder if the arrival of Sublime Text 2 was the impetus for TextMate 2 development after so many years.

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.

Is this controlled by the color scheme itself? I'm running Solarized Dark, and the sidebar does have the same scheme as the editing window.

Yes, this is part of the Color Scheme that you used.

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.

Still no block cursor. :(

I've found/modified a little plug-in to simulate it, but it's not ideal.

I love Sublime, and I'm sure it seems trivial to most folks, but as a developer with poor eyesight, this is the one feature I want the most.

At least fonts can be larger now.

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?

Just curious, why are you using Windows for iPhone development ? I mean there is any advantage versus using directly your Mac ?


If you use vim be sure to check out the Ex mode package: https://github.com/SublimeText/VintageEx

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?

For those wondering, auto-complete is quite fast.

I've always avoided IDEs that offered this because they seemed to be terribly slow -- pleasantly surprised so far.

does it support any kind of CTags?

> 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?

"close_windows_when_empty": true,

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.

try something like WebDrive, NetDrive, ExpanDrive or Dokan SSH http://dokan-dev.net/en/

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.

Macfusion is sometimes finicky, but works for me most of the time. And it's free (unlike Expandrive).

See elsewhere my post about ExpanDrive and SSH tunnels..

Copy the files to your computer, make the changes, and copy them back?

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?

I think you can theme the UI as well as the syntax theme. Here's an example: https://github.com/buymeasoda/soda-theme

Nice! I didn't know it was possible to theme the sidebar either. Soda Dark seems pretty good, thanks.

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.

Good software is worth paying for.

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.

I can certainly agree with that.

Was hoping for some sidebar love in the new theme (file and folder icons, renaming files in place), but the changes seem good so far.


I don't want to put the looks over functionality but when we are talking for a GUI application we need a good icon.

There are some good replacements floating around the web. The one I think best matches the aesthetic of Sublime Text 2 is here: http://dribbble.com/shots/337996-Sublime-Text-2-Icon

I'm confused, doesn't it already have auto-complete? Mine's been doing that for a while now. What's new about this?

Are you using the dev version? If so, then yes you've had that for a while now. It just made it into the beta now ...

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.

Anyone know how to get the Soda Theme working again?

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).

Love the auto-complete! Keep up the great work.

Still doesn't feel like a Mac app...

What I really miss in all these fast small editors is the quick-jump features that actually analyze the code and let me do things like

1) Jump the the function/method definition (even if it's in a different file) when I press Ctrl and click on the function name. Eclipse does this.

2) Quick find of the function/method definition across the whole project. Eclipse does this as well (Ctrl + R).

I don't use Eclipse that much, because it's ridiculously slow, but it has cool features.

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.

Take a look: https://github.com/Kronuz/SublimeCodeIntel

    Supports all the languages Komodo Editor supports for
    Code Intelligence (CIX, CodeIntel2):
    PHP, Python, RHTML, JavaScript, Smarty, Mason, Node.js,
    XBL, Tcl, HTML, HTML5, TemplateToolkit, XUL, Django, 
    Perl, Ruby, Python3.
Where's C? Where's C++? Where's Java? That's disappointing.

For the first two you want to look at https://github.com/quarnster/SublimeClang

which, as the 'clang' bit suggests, works pretty well. libclang and Sublime both having a Python API is extremely cool.

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

You can get this sort of navigation with ctags ( http://ctags.sourceforge.net/ ) and a plugin like this one: https://github.com/SublimeText/CTags

I also use cscope: https://github.com/ameyp/CscopeSublime

"ridiculously slow"? Well, it is slower than a small text editor, but after using Visual Studio for about a year, Eclipse seems blazingly fast to me.

> Jump the the function/method definition

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?

Or just don't offer click navigation on functions defined in eval(). Acceptable trade off.

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.

That's such an edge case. I've never seen anybody defining functions in evals, especially as concatenated strings.

I've done it.

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.

Maybe you should take a look at the Rails sourcecode.

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.


Try getting your editor to find that definition of method "accept_language" or "cache_control". :-)

You can do this in emacs with etags and etags-select.el. ctags works with vim.

AFAIK Komodo IDE (7.0 at least) has this feature and it is definitely faster than Eclipse, but it is infinitely more expensive.

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.

For Ruby, I highly recommend RubyMine.

Number 2) is included in Sublime Text (same shortcut, too). And it's fuzzy!

No, that only lets you jump to files, not to functions/methods.

I use SublimeRope and I'm quite happy with it (It's for python only though.): https://github.com/JulianEberius/SublimeRope

ST2 allow you to do it within the same file, but not outside of the file.

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. :)

Only at HN will you find people gushing about a $50 text editor.

It's totally pathetic yet oddly endearing at the same time.

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.

People also pay hundreds of dollars for text editors, if you include Microsoft Word among those.

Edit: and Microsoft IDEs

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact