13 ms·
Mac Text Editors and Navigation
- pilif 15y agoanother thing the Jetbrains IDEs get right. They fail in their selection of shortcuts (Cmd-G which is "Search again" in every other Mac app) for it though, but that's easily remedied. I totally agree with the article by the way. Selecting the line is idiotic. While programming, you never ever want it to select the whole line - in fact, I don't think I have in fact ever selected a line at all.
- stephenr 15y agoHow does Mail make it into a comparison of text editors!?
- lazugod 15y agoWhy not? It's the only proper text editor that lets someone else see what you're writing with the click of a single button.
- nicpottier 15y agoAlthough you make an interesting point, I'm really having a hard time thinking of where a "Go to line.." command comes in handy in Mail though. E-mail is so often reformatted, munged and quoted that depending on line numbers being the same on the sender's side seems foolish.
- hboon 15y agoYour cursor is at line 200. You read through your email and want to make a change in a certain paragraph. That happens to be at line 180. So you "Go to..." 180.
- nicpottier 15y agoInteresting.. I've never used "Go to line" in that way, probably because my text editor never has line numbers showing. For me it is always to jump to the point of an exception or somesuch.. maybe I'll try it for a while. PS. I use Emacs for virtually everything so C-N, C-P and M-N, M-P get used for that kind of navigation.
- hboon 15y agoI use MacVim. When you want to edit or add some code, isn't it more common to want to do it at a particular spot rather than reacting to a exception/warning? That's how I do it anyway. The only reasons I can come up with off the top of my head to do otherwise is if someone is doing heavy TDD or banging code into a Smalltalk debugger instead of a browser. How do you do it? (Genuine question. I almost always code by myself and have never been around anyone while they are productively working with an editor.)
- nicpottier 15y agoI've actually never met a developer that navigates a file using line numbers. Maybe it is the norm but I haven't seen it having worked with a few dozen developers over the years. Getting quick at line up/line down (C-N, C-P) and page up/page down (M-P, M-V in Emacs) seems to be a more common way of navigation. (C-S for quick search in Emacs being the other) I use "Go-to-line" almost exclusively to jump to the line where a stack trace is telling me there's an error. (TDD or not, stack traces are a way of life)
- masklinn 15y ago> I've actually never met a developer that navigates a file using line numbers. Maybe it is the norm but I haven't seen it having worked with a few dozen developers over the years. > I use "Go-to-line" almost exclusively to jump to the line where a stack trace is telling me there's an error. yes that's pretty much it: use external tool to find some row (diff tells you this is where a chunk was changed, grep or ack tells you what you're looking for is there, ...), jump straight to row. Although usually I'll open the file directly at the right line in emacs (`e +line file`[0]), goto-line is only for the IDE. [0] where `e` is an alias for `emacsclient -n`
- tikhonj 15y agoEmacs can send emails, you know ;)
- erez 15y agoZawinski's Law of Software Envelopment: Every program attempts to expand until it can read mail. Those programs which cannot so expand are replaced by ones which can.
- Jacked 15y agoLooks like Sublime Text 2 meets his requirements. Goto Line is simply Ctrl-G, and up pops a simple input line, similar to hitting ":" in vim. As an added bonus, the input line disappears if you press Ctrl-G again, hit <esc>, or press enter without entering anything. So, fast and easy to get into, fast and easy to get out of.
- divtxt 15y agoOn the Mac, I no longer think about this level of workflow optimization because there's a much bigger negative that make these irrelevant: the Mac's Alt-Tab behavior. The most basic web page development exercise - 1 browser window and 2 editor windows for html and css - is ruined because I can no longer MRU cycle the 3 windows. I would say this is one of the biggest usability mistakes on the Mac. Sadly, Unity & Gnome 3 have both copied this. Meanwhile, I don't fight the platform but use it the way it was meant to be - keyboard + mouse. But I'll be shifting back to Linux or Windows for all non Mac/iOS development. Update: thanks to comments pointing me to Witch. However, I still stand by my criticism of the built-in Mac desktop behavior.
- tutysara 15y agoYup this alt+tab switching behavior change is a real pain for me.I was under the impression that this is an issue only with Unity/Gnome3, now I got to know the actual place from where it all started. After seeing this change consistently across all the major UIs, I am starting to feel that this change in alt+tab behavior should have some strong reason for doing so and I am not aware of its actual purpose/use. I would be glad to know from someone on how this feature has simplified their work or improved their productivity.
- mhw 15y agoI'm finding it a bit painful on Unity now too, but I'm wondering whether the problem is actually with the terminal programs rather than with the alt-tab behaviour. Most of the time I actually do want to treat all the windows of a single application as a group. But terminal sessions seem different to me - two terminal windows are not related closely to each other just because they are managed by the same application. Perhaps I need to find the setting that stops terminal windows from being grouped together...
- divtxt 15y agoI'm guessing the justification is that switching apps is consistent with the fact that the OS X Dock shows apps, not windows. Probably Unity & Gnome 3 made the alt-tab change to match their move to the Dock model? Whatever the reason, they're wrong for us power users. And possibly for intermediate & beginners users as well.
- lazerwalker 15y agoIt's obviously nowhere near as full-featured as vim or emacs proper when it comes to navigation, but worth noting is that OS X does support a subset of the standard emacs key bindings for text navigation (Ctrl+a, Ctrl+e, etc). They even work in iOS with an external keyboard.
- gregschlom 15y agoAnother thing that drives me crazy on Mac text editors: selecting something and hitting Cmd-F won't use the selected text for the search. (at least on Xcode, Sublime Text, and Google Chrome). So I have to constantly do the sequence: swear out loud - press escape - Cmd-C - Cmd-F again - Cmd-V. That's just dumb.
- johncoltrane 15y agoMost Mac OS X apps (including the ones in your list) allow you to press Cmd-E - Cmd-F to search for the currently highlighted word. Even better: once you have pressed Cmd-E you can hit Cmd-G to cycle through the results. With all due respect, what is just dumb is not reading the manual of the powertools you use every day and blaming them for your lazyness.
- gregschlom 15y agoThanks for the tip. >With all due respect, what is just dumb is not reading the manual of the powertools you use every day and blaming them for your lazyness. I thought the point of Mac was that you didn't have to read the manual ;) But yes, in this case, mea culpa.
- johncoltrane 15y agoYou are welcome. You don't have to read the manual to perform the most common tasks. But if you want to perform more advanced/specific tasks, reading the manual is necessary.
- jamesrcole 15y agoBut I think they had a valid point. Cmd-F searching for the highlighted text involves one key-press. What you describe requires two key-presses. The former is quicker and easier, and I think that makes it preferable. Pretty much everything to do with computers, from Operating System features, to program and UI features, are ultimately about making it quicker and easier to perform tasks. Wanting more convenience is not laziness. The goal of computer systems should be to provide more convenience.
- Stwerner 15y agoI've been noticing a lot of talk about BBEdit lately and am having a hard time finding what features might set it apart from apps like Textmate or VIM. Are there any features that aren't in other editors that I'm just missing? Two of my coworkers use it and I haven't been able to witness anything in particular, but with a line in the article like "I'm a big BBEdit fan" there has to be something I am missing, right?
- adolph 15y agoAs a long time BBEdit user, a lot of it has to do with the vast spread of features that cover just about everyone's needs. As a vim pre-novice, I think that part of BBEdit's appeal is that the features you may not use often enough to remember a command for are just a little mouse-hunting away. Having used Textmate a couple of time and the somewhat similar e.exe for Windows a lot, the appeal of BBEdit is that features are integrated into the application instead of loosely coupled in bundles that may or may not work well.
- wwkeyboard 15y agoAnother far under-appreciated feature of Textmate(and emacs, probably vi as well) is incremental search. Ctrl-s and start typing what you are looking for, if you want to find the next item hit Ctrl-s again. I use this whenever I'm traveling more than 5-6 lines in either direction.
- ibisum 15y agoI've stayed on vim for the fact that I can use ctags/cscope on pretty much any grand tree of docs and be able to navigate through it all with extreme ease. cscope is not just for C/C++ projects, btw, you can set it up for any text filetype with ease. So for navigation front-end, I use cscope (find text), while within vim a full structure of detail is available to me with a simple keypress. This ability to navigate text is also one of the reasons, I believe, that Visual Studio is still so popular in spite of the grand cruft it brings with it, as a 'text editor'-derived product concept. edit: outside the edit/make/run/inspect loop that vim+cscope+gdb gives, Visual Studios huge offerings seem a bit 'crufty' to me. Call me an old, over the hill kind of guy, but I didn't mean to insult Visual Studio fanatics, fans, or users.