region-bindings-mode icon indicating copy to clipboard operation
region-bindings-mode copied to clipboard

A minor mode that enables custom bindings when mark is active.

This package contains region-bindings-mode.el

  • Info

    • Author: Fabián Ezequiel Gallina
    • Contact: fabian at anue dot biz
    • Project homepage: http://github.com/fgallina/region-bindings-mode.el
    • My Blog: http://www.from-the-cloud.com
    • Downloads page: http://github.com/fgallina/region-bindings-mode.el/downloads
  • Introduction

    Minor mode that enables the ability of having a custom keys for working with regions. This is a pretty good way to keep the global bindings clean.

  • Requirements

    This package was tested with GNU/Emacs 24 only, it should work with others versions too but I can't ensure anything. Besides from that nothing else is required.

  • Installation/Usage

    Add this to your .emacs:

    #+BEGIN_EXAMPLE (add-to-list 'load-path "/folder/containing/file") (require 'region-bindings-mode) (region-bindings-mode-enable) #+END_EXAMPLE

    Then add some nice bindings that will be enabled only when you happen to be working on a region, Here's an example setup integrating the excellent [[https://github.com/magnars/multiple-cursors.el][multiple-cursors]] package:

    #+BEGIN_EXAMPLE (define-key region-bindings-mode-map "a" 'mc/mark-all-like-this) (define-key region-bindings-mode-map "p" 'mc/mark-previous-like-this) (define-key region-bindings-mode-map "n" 'mc/mark-next-like-this) (define-key region-bindings-mode-map "m" 'mc/mark-more-like-this-extended) #+END_EXAMPLE

    In this use case, you would probably want these bindings to work within specific scenarios. For example, =multiple-cursors= doesn't make much sense in read-only buffers. You could prevent =region-bindings-mode= in these by setting =region-bindings-mode-disable-predicates= to:

    #+BEGIN_EXAMPLE ((lambda () buffer-read-only)) #+END_EXAMPLE

    You can also exclude specific modes via =region-bindings-mode-disabled-modes=, or specify a white-list of allowed modes via =region-bindings-mode-enabled-modes=.

  • Bug Reports

    If you find a bug please report it sending an email listed in the top of the file or just use the github tracker.

  • License

    region-bindings-mode.el is free software under the GPL v3, see LICENSE file for details.