14

Depending on your system, the word separator characters change the way you can select/delete a word (e.g. by double clicking on it or using a key combination with your keyboard).

The fact is that I hate the default behavior of OSX.

For example:

Take the following line of code:

obj.attr1.innerAttr

If my cursor is at the end of the line and I press alt+backspace, it will delete everything and not just innerAttr.

I only found some apps (like iTerm) which let you change the word selection separator characters.

Is there a way to change it for the whole system?

Giacomo1968
  • 53,069
  • 19
  • 162
  • 212
avetis.kazarian
  • 2,546
  • 2
  • 20
  • 20

3 Answers3

5

The only difference between the two English options (at least in for ASCII characters) seems to be whether period and colon are treated as part of words.

Part of words:

  • '.:_ in Standard
  • '_ in English (United States, Computer)

Not part of the start or end of words:

  • $+<=>^` in Standard
  • $+<=>^` in English (United States, Computer)
Lri
  • 40,894
  • 7
  • 119
  • 157
4

The answer by user ` is correct for pre-osx-10.9 (I think). However, in OS X 10.9 and later the System Preferences changed a bit. It now looks like this:

Language & Region

joxl
  • 163
  • 1
  • 1
  • 8
  • 2
    Apple keeps moving this around. This no longer works on 10.13. New solution `defaults write .GlobalPreferences AppleTextBreakLocale en_US_POSIX` via https://apple.stackexchange.com/a/124788/15378 – Daniel Jan 25 '19 at 21:16
3

To the best of my knowledge, selection word separation is done on a per-application basis, not a system-wide basis. iTerm allows you to configure the characters, but that's an extremely unusual option; most applications use the predetermined defaults in the Cocoa and Carbon libraries, which are hard-coded, not drawn from a centralized preference setting.

Dan Story
  • 149
  • 3
  • Well, that's just too bad... –  Mar 28 '10 at 13:02
  • 1
    More importantly, iTerm's preference only affects selecting text in iTerm. It doesn't affect how tty applications move the cursor or edit words. – Chris Page Aug 29 '11 at 12:08
  • 1
    Mac is the least usable of the 3 major operating systems for programming. I have used Windows, Linux, and MacOS extensively over the past 5 years and I just can't stand Mac. Apple constantly changes how their system works to the point where SO and third party tools are almost always outdated. – Shadoninja Mar 19 '20 at 14:36