Sublime Forum

Few questions: find behavior, running commands, file browser

#1

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.

0 Likes

#2

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) wbond.net/sublime_packages/package_control

0 Likes

#3

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ā€¦

0 Likes

#4

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

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.

0 Likes

#5

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ā€ā€¦

0 Likes

#6

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ā€¦

0 Likes

#7

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!

0 Likes