aki77 / atom-expand-region

expanding selection
https://atom.io/packages/expand-region
MIT License
89 stars 9 forks source link

Add documentation for customizing #7

Closed stevenhauser closed 8 years ago

stevenhauser commented 8 years ago

Hello. This is by far one of my favorite packages, so thanks for putting it together! I did have some issues figuring out how the customization works though, as the README doesn't explain it too thoroughly. What do you think about adding a bit more info and perhaps an example, like:


Customize selected regions

Follow the Atom guide on language-specific configuration to adjust how regions are selected per language. Edit ~/.atom/config.cson and use the default settings as a reference.

For example, if you want to select words with dashes first in CSS (instead of words without dashes), you could change your config.cson to something like:

'.source.css':
  'expand-region':
    commands: [
      # Note how `expand-region:select-word` is no longer here 
      # like it is in the defaults
      {
        command: 'expand-region:select-word-include-dash',
        recursive: false
      }
      # etc...
    ]

And now if you expanded while your cursor was—for example—between x and t in text-align, rather than selecting text first, you'd select the whole text-align property.

aki77 commented 8 years ago

I welcome the pull request because English is not good. :cry:

aki77 commented 8 years ago

Thanks! :smiley: