Home Download Buy Blog Forum Support

Few questions: find behavior, running commands, file browser

Few questions: find behavior, running commands, file browser

Postby JarrettBillingsley on Wed Jun 27, 2012 6:38 am

Hi, I've used ConTEXT as my code editor for several years now, but due to some crappy political stuff its development has all but halted and I'm getting a bit tired of its bugs. I'm trying out ST2 and so far I've been pretty impressed; getting things configured the way I want has been a little daunting, but there are some features that have motivated me to stick with it (like multi-selections, oh my god).

I've got three things that I'm rather used to from ConTEXT and I can't seem to figure out if there are any equivalents in ST2.

First is one annoying aspect of the find behavior. I can't stand "wraparound" find, so I turned that off, except now I have the problem that the find feature only searches from the cursor down. In ConTEXT, the default is to start searching at the top of the file (though searching from the cursor is an option as it's occasionally useful). I can't find any equivalent in ST2. Is it possible to get it to start searching at the top instead of at the cursor?

Second is that although ST2 provides a way of building code from within the editor, I can't find anything that lets me run the resulting program and capture its output. Sure, I could alt-tab out to the console and run it manually, but it's so nice to be able to do it all in the editor; it saves a lot of keystrokes. Capturing the output to a buffer can be really helpful with debugging as well. Is there a plugin to do this, maybe?

Last isn't much of a dealbreaker and may be something that I'd work on as a personal project, but one convenient feature in ConTEXT (and I've seen it in other editors like Kate as well) is a built-in filesystem browser that sits in the sidebar. Unless there's some awesome feature that obviates the need for something like this!

Thanks for any help, and sorry if it's bad etiquette to put multiple questions in one topic like this.
JarrettBillingsley
 
Posts: 11
Joined: Wed Jun 27, 2012 6:06 am

Re: Few questions: find behavior, running commands, file browser

Postby asmodai on Wed Jun 27, 2012 8:22 am

ST2 features a pluggable build system. Package Control(1) has a few packages listed for various build environments, so it depends just exactly what you are looking for (which language, et cetera).

(1) http://wbond.net/sublime_packages/package_control
asmodai
 
Posts: 73
Joined: Mon Mar 01, 2010 10:42 am

Re: Few questions: find behavior, running commands, file browser

Postby JarrettBillingsley on Wed Jun 27, 2012 8:40 am

Oh, yes, I've been using the Package Control plugin. The build system isn't really a problem (I'm using D which has a build system built-in to ST2, how nice!), it's just the matter of actually running the program after building it. I know ST2 seems to be pretty popular with Ruby users, so they're probably not used to there being separate "build" and "execute" steps, but..
JarrettBillingsley
 
Posts: 11
Joined: Wed Jun 27, 2012 6:06 am

Re: Few questions: find behavior, running commands, file browser

Postby asmodai on Wed Jun 27, 2012 8:48 am

Ah, sorry, misread what you wrote. :oops:

Mmm, not sure if there's anything out there yet that does that. The problem is that all these features will slowly move a code editor to an IDE. Anyway, I think you should be able to easily write a package that hooks in a new menu command that runs the resulting program and captures its output. It's not overly different from a build system in that manner.
asmodai
 
Posts: 73
Joined: Mon Mar 01, 2010 10:42 am

Re: Few questions: find behavior, running commands, file browser

Postby JarrettBillingsley on Wed Jun 27, 2012 8:52 am

Alright, I'll have a look -- the API doesn't look terribly hairy anyway. And F8 is unassigned, seems like a great spot for it right next to F7 to build!

Though I'm still wondering about the "find from top"..
JarrettBillingsley
 
Posts: 11
Joined: Wed Jun 27, 2012 6:06 am

Re: Few questions: find behavior, running commands, file browser

Postby JarrettBillingsley on Wed Jun 27, 2012 8:33 pm

Okay, I've found out that the sidebar is actually useful! It DOES display a tree of files, as long as they're part of the current project. That's good enough for me.

It doesn't seem like it'd be possible to write a plugin to make "Find" work the way I'd like, though, so I guess that'd have to be a feature request..
JarrettBillingsley
 
Posts: 11
Joined: Wed Jun 27, 2012 6:06 am

Re: Few questions: find behavior, running commands, file browser

Postby JarrettBillingsley on Wed Jun 27, 2012 10:31 pm

Okay, wow, so ST2 does actually support "run". It's kind of buried inside the documentation, but if you create a build system with a variant named "Run", it'll be bound to ctrl+shift+b and it does exactly what I want. Awesome!
JarrettBillingsley
 
Posts: 11
Joined: Wed Jun 27, 2012 6:06 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 16 guests