Delimiter rant

All standard text views in Mac OS X are based on the UNIX text editors. Standard text views are used in every standard Mac OS X application but also 3rd party software like FireFox, Sublime Text or Coda. Here some items about unix text editors and their key commands:

  • return key inserts a linefeed. UNIX uses linefeed as line terminators.
  • ctrl + a is to the beginning of the line
  • ctrl + e is to the end of the line ctrl
  • ctrl + b moves the cursor back one position
  • ctrl + h deletes character before cursor (same a backspace)
  • ctrl + w deletes word before cursor
  • ctrl + u deletes line before cursos
  • ctrl + f moves the cursor forward one position
  • ctrl + k deletes line after cursor
  • ctrl + y paste (not the same contents as Mac OS X’s clipboard)

    just to name a few. ctrl + k and ctrl + y is also known as kill and yank, what you delete with ctrl + k can be pasted somewhere else with ctrl + y.

:smiley: And that is about as much about Emacs I care to know! The keys works in all dialogs as well, and Spotlight.

In the terminal, you configure .inputrc, so you make the terminal behave the same, at least if you set up the tty via the stty characters, the same, and then, then ypu have a pretty much comfortable environment.

I have it like that ^A ^W ^K and all that works as it should elsewhere. (though I have never tried ^Y, but ^N and ^P sure comes in handy!

You have some extra keys as well, as Esc is the meta character, so you can hit Esc B to move a word backwards, Esc F for a word forward. (Should work in every NSTextView).

I had some more about delimiters as well, sometimes, you really need a hardcoded linefeed in a shell script, then ‘$’ would be the correct sequence, if the rest of it is delimited by single ticks. A $ is a literal linefeed in the shell.

Edit

The Esc a s a meta-character only seem to work in BBEdit and the Terminal. And I forgot to mention that the whole NSText (CocoaText) is configurable so you can really define behaviour for the different keys, add behaviour, change, delete, etc. For all applications (the whole system), or just for one application.

I wish Apple had set up Fn as a meta-key for the CocoaText system! :slight_smile:

Edit++

And add some keys onto new hardware, I dare say there is enough space on my keyboard for at least one more control-key, and a full row of extra function keys as well. Maybe a full set of modifier keys on the outside of the keyboard. At the price of a MacBook, you’d exepect to not be crippled by a keyboard with too few keys.

But then the Laptop would look too much alike other PC laptops that Apple wants to avoid :wink: I agree but since MacBook (before you had iBook and PowerBook) the laptop from Apple is more an design than an state of the art (technically) laptop. I think anyone of you who have owned the Titanium PowerBook G4 knows where I’m talking about: The laptop with the worse screen design but great performance, only laptops like alienware were that good at the time. Since the use of intel processors, Apple has given away the lead in performance and is back into the Peloton.

Hello.

I think it would look so much better, with like 105 keys. -Not for any practical reason of course, -just as an expression of technical superiority. :slight_smile:

Any and all of which an app is free to override, of course…

Like I was saying :slight_smile:

This also pops up another discussion: Why would anyone override those keys unless it’s ported or multi platform? It’s very annoying and ignorant when developers decide to remap the short keys if there is no benefit in it at all. In some cases like virtual machines you want to simulate key mappings from another platform. Otherwise they’re poor developers who do not design their software for the end-user’s benefit. Or did they live under a stone during the desktop revolution :wink: ?

All Apple text editing works like unix text editors. Now this is an eye opener! I found out something else, that you can set the AppleScript Editor to show line endings. Learned a lot. Now, I have another thing to read up on. Mainly the man pages for unix text editors. I’ve used pico (now nano) before and could barely remember the control characters. But now that I’ll be using it in the Script Editor, it might be easier to remember.

Edited: found the control characters in man bash.

Thanks,

Hello.

Sombody has allways a better idea than Apple, when it comes to what a key should do, and not, to the annoyances of the users.

But a private person would override those keys for their personal usage, as you can wastly extend the functionality of the keyboard. Maybe even emulate BBEdit’s command - L. :slight_smile:

The problem as I see it with the keyboard definition, is the Esc key, as that isn’t well defined, sometimes, it works as confirm for data-entry, and other times it activates word-completion.

And control-F7 for switching between panes in the Open and save dialog is of course underrated. And it also has a nice dual functionality, as it activates the usage of keyboard for navigating/selecting buttons in dialogs

Because there are only a limited range of other options available before you descend into digital gymnastics, because they are not listed in the official reserved shortcuts list, because many are redundant, and because sometimes it makes a command more memorable in connection with a similar command. And sometimes people need reminding that they’re not on a PDP-10 anymore :slight_smile:

(Yes, I’ve hijacked control-E).

The blessed thing with Cocoa/NSText is that a user can hijack the key back! :slight_smile:

I just came back to this post, as I recently read about a GPU implemented regex-engine, they guaranteed to be around 10 times faster than grep, and 67 times faster than perl, that makes grep around 7 times faster than perl, for basic regexps. :wink: