On the other hand, I have colleagues who can't program without having pen and paper around -- people use whatever tools they like based on how their mind works.
The context-sensitivity is handled by having a list of expansion/contraction functions to try in sequence, so your region grows outwards by different units. Or you can specify a specific expansion function (like, er/mark-outside-python-string) upfront.
As an example, the expand function list I have for a python buffer open is:
(er/mark-word
er/mark-symbol
er/mark-symbol-with-prefix
er/mark-next-accessor
er/mark-method-call
er/mark-inside-pairs
er/mark-outside-pairs
er/mark-comment
er/mark-inside-python-string
er/mark-outside-python-string
er/mark-python-statement
er/mark-python-block
er/mark-python-block-and-decorator
er/mark-outer-python-block)
[1] https://github.com/magnars/expand-region.el or from ELPASublime also has "Expand Selection to Scope", except it doesn't really work that well: First invocation it chooses the current symbol, on 2nd the current brace block except the braces, on 3rd the braces themselves, and so on.
And it also has "Expand Selection to Indentation", but I don't see use for it in cases where you want to manipulate blocks of code, since it nearly always doesn't select what you want.
What I'd like is a command, let's call it "Expand Selection to Statement or Block", that:
* On 1st invocation, selects the current line.
int foo(int bar) {
bar = mogrify(bar);
if (bar > 0) {
slartibartfast = 42;
[[baz = bar + 1;]] # <-- [[ selection ]]
print_report();
}
return bar;
}
* On 2nd invocation, expands to the current contiguous set of lines, bounded by either empty lines or language-specific block (usually braces, or in Ruby's case, "if/while/..." until "end"), but not including the boundary: int foo(int bar) {
bar = mogrify(bar);
if (bar > 0) {
slartibartfast = 42;
[[baz = bar + 1;
print_report();]]
}
return bar;
}
* On 3rd invocation, expands to the current contents of the block, excluding braces and excluding the lines containing the braces. int foo(int bar) {
bar = mogrify(bar);
if (bar > 0) {
[[slartibartfast = 42;
baz = bar + 1;
print_report();]]
}
return bar;
}
* On 4rd invocation, expands to the enveloping statement that uses the block: int foo(int bar) {
bar = mogrify(bar);
[[if (bar > 0) {
slartibartfast = 42;
baz = bar + 1;
print_report();
}]]
return bar;
}
* On 5th invocation, it would continue to step 2, ie., looking for more lines that are contiguous with the current selection: int foo(int bar) {
bar = mogrify(bar);
[[if (bar > 0) {
slartibartfast = 42;
baz = bar + 1;
print_report();
}
return bar;]]
}
* And so on. Eventually it will get to the entire function declaration.Combined with a "wrap selection in braces"-type command (that indented the selection, wrapped it in braces, and placed the caret at the beginning so you could start typing something like "if (...) {") you would have a fairly powerful block-manipulating shortcut.
It would probably be quite trivial to write such a plugin. I might try my hand at this. Not sure how much language sensitivity it would need, might be doable without anything at all.
Talking of contiguous lines. I like macros of the following form for quickly hopping around vertically in a file:
// .sublime-macro
[
{"command": "move", "args": {"by": "stops", "empty_line": true, "forward": false}}
]
// .sublime-macro
[
{"command": "move", "args": {"by": "stops", "empty_line": true, "forward": false, "extend": true}}
]
// .sublime-keymap
{ "keys": ["ctrl+up"], "command": "run_macro_file", "args": {"file": "Packages/User/HopUp.sublime-macro"} }
{ "keys": ["ctrl+shift+up"], "command": "run_macro_file", "args": {"file": "Packages/User/HopUpSelect.sublime-macro"} }, {"keys": ["alt+up"], "command": "move", "args": {"by": "stops", "empty_line": true, "forward": false}},
{"keys": ["alt+down"], "command": "move", "args": {"by": "stops", "empty_line": true, "forward": true}},
{"keys": ["shift+alt+up"], "command": "move", "args": {"by": "stops", "empty_line": true, "forward": false, "extend": true}},
{"keys": ["shift+alt+down"], "command": "move", "args": {"by": "stops", "empty_line": true, "forward": true, "extend": true}},
(Changed it to alt instead of ctrl because that's how I like it.)(IDEA is a Java/Swing app, and I'm very sensitive to apps that don't look or feel native on OS X. Yes, Sublime is crude in places, but at least looks and feels native. Being a Swing app it promotes certain GUI conventions that have not been relevant since the early 2000s. It's tabs and toolbar hell and looks like something out of a bad Windows nightmare. Sorry if that sounds snobby, but if I didn't like beautiful GUIs I would not be using a Mac.)
I don't know what others do, but I actually hide the toolbars in my IDEs (I use several JetBrains products: PyCharm and IntelliJ mostly, PHPStorm and RubyMine to a lesser extent.) PyCharm actually received a facelift recently that I hope finds its way to the other products as well.
All JetBrians products ship with several skins (ctrl+tilde brings up the menu) and I've never found any trouble getting them the way I want. I do find XCode (which is my go-to editor for C and C++ not being an ObjectiveC developer myself) to be a very good looking IDE but personally, I'd never sacrifice function. It's just too important. IMHO, of course.
Xcode is also native (although not very pretty), but it is a horrible IDE. I use Sublime for my ObjC coding, although I am forced to use Xcode for some things that ST cannot do, like adding files to a project, editing compilation flags or working with .xib and Core Data .momd files.
It's a compromise. IDEA is too ugly to use, Sublime lacks some features but is great in most areas.
Given that many of the features you're talking about actually do exist in IntelliJ, etc, doesn't that mean that yes, you are sacrificing function for form?
There are other factors at play such as speed; Sublime is lightning fast, IDEA is not. And afaik, IDEA does not support Sublime-style multiple carets.
vi{
v%For anyone else looking for exactly this, here's a great vim extension that gives you "indent" objects: http://www.vim.org/scripts/script.php?script_id=3037
Personally, I have never needed code folding (I prefer to have my own map of the code in my head, and anything that obscures that map just gets in the way), or Sublime Text's minimap, nor have I ever needed the symbol sidebar that is found in some IDEs (Eclipse, Netbeans). What I really want is more efficient editing.
For example, text editors like Sublime have zero language-sensitive refactoring support. I can't rename (variables, methods etc.) or extract methods, for example. Even some really simple operations like "select entire current nesting level" are unavailable. I remember using Eclipse 7 years ago and really liking the intelligence of the incremental compiler backend, even though I hated Java; it seems that with backends such as Clang, those tools can once again be applied outside big, annoying IDEs like Eclipse and Xcode.
Not sure if this particular approach is useful except to a small niche, but it looks pretty slick. Good luck with the effort!