Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cofi/evil-numbers
Increment and decrement numbers in Emacs
https://github.com/cofi/evil-numbers
Last synced: 2 months ago
JSON representation
Increment and decrement numbers in Emacs
- Host: GitHub
- URL: https://github.com/cofi/evil-numbers
- Owner: cofi
- License: gpl-3.0
- Created: 2011-09-02T04:05:29.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2024-04-16T01:41:36.000Z (9 months ago)
- Last Synced: 2024-08-02T01:26:20.941Z (6 months ago)
- Language: Emacs Lisp
- Homepage:
- Size: 200 KB
- Stars: 118
- Watchers: 9
- Forks: 23
- Open Issues: 11
-
Metadata Files:
- Readme: README.org
- License: COPYING
Awesome Lists containing this project
README
* Evil Numbers
- Increment / Decrement binary, octal, decimal and hex literals- works like C-a/C-x in vim, i.e. searches for number up to eol and then
increments or decrements and keep zero padding up (unlike in vim)- When a region is active, as in evil's visual mode, all the
numbers within that region will be incremented/decremented (unlike
in vim)** Detected Literals
- binary, e.g. =0b0101=, =0B0101=
- octal, e.g. =0o755=, =0O700=
- hexadecimal, e.g. =0xDEADBEEF=, =0XCAFE=** Install
Put in =load-path=, =(require 'evil-numbers)= and bind, for example:#+BEGIN_SRC emacs-lisp
(global-set-key (kbd "C-c +") 'evil-numbers/inc-at-pt)
(global-set-key (kbd "C-c -") 'evil-numbers/dec-at-pt)
#+END_SRCor only in evil's normal state:
#+BEGIN_SRC emacs-lisp
(define-key evil-normal-state-map (kbd "C-c +") 'evil-numbers/inc-at-pt)
(define-key evil-normal-state-map (kbd "C-c -") 'evil-numbers/dec-at-pt)
#+END_SRCFor window system users the keypad =+= and =-= present an alternative that can be
directly bound without shadowing the regular =+= and =-=:#+BEGIN_SRC emacs-lisp
(define-key evil-normal-state-map (kbd "") 'evil-numbers/inc-at-pt)
(define-key evil-normal-state-map (kbd "") 'evil-numbers/dec-at-pt)
#+END_SRC** Usage
Position cursor on literal and play with your numbers!** Known Bugs
See http://github.com/cofi/evil-numbers/issues** Contributors
- Matthew Fidler
- Michael Markert