[[https://github.com/mrbig033/cool-moves/blob/master/README_pt.org][Leia Em Português]]
Table of Contents :toc:
[[#what-it-does][What It Does]]
[[#rationale][Rationale]]
[[#installation][Installation]]
[[#commands][Commands]]
[[#settings][Settings]]
[[#differences-from-drag-stuff][Differences from drag-stuff]]
What It Does This is a package to move text around on Emacs. It uses basic functions to move words, lines, paragraphs, sentences and sexps forward and backward.
[[https://gfycat.com/ClassicUnevenEquestrian][See it in action]].
This is my first attempt at publishing code, so criticism is more than welcome!
(use-package cool-moves
:load-path "~/.emacs.d/lisp/cool-moves"
:config
(general-define-key
:keymaps 'override
"
** Without use-package Remember to replace =~/.emacs.d/lisp/cool-moves=. The rest is straightforward.
(add-to-list 'load-path "~/.emacs.d/lisp/cool-moves") (load "cool-moves")
(general-define-key
:keymaps 'override
"
Commands Each of these commands move something either forward or backwards, and are named in predictable manner. This package have no default keybindings, but I'll make some suggestions below.
cool-moves/character-backward
cool-moves/character-forward
cool-moves/line-backward
cool-moves/line-forward
cool-moves/paragraph-forward
cool-moves/paragraph-backward
cool-moves/sentence-backward
cool-moves/sentence-forward
cool-moves/sexp-backward
cool-moves/sexp-forward
cool-moves/word-backwards
cool-moves/word-forward
Settings Besides the keybindings there are no settings to be made. ** Suggested Keybindings I use [[https://github.com/noctuid/general.el][general.el]] for my keybindings, so:
(general-define-key
:keymaps 'override
"C-S-j" 'cool-moves/line-forward
"C-M-n" 'cool-moves/word-forward
"C-S-k" 'cool-moves/line-backward
"C-M-p" 'cool-moves/word-backwards
"
If you don't use General and don't know how to create keybindings, [[https://www.masteringemacs.org/article/mastering-key-bindings-emacs][this article]] might be helpful. ** Suggested Hydra You can use a [[https://github.com/abo-abo/hydra][Hydra]] to make the commands easily accessible.
_l_: line ↓ _w_: word →
_L_: line ↑ _W_: word ←
_p_: par ↓ _c_: char →
_P_: par ↑ _C_: char ←
_s_: sentence → _x_: sexp →
_S_: sentence ← _X_: sexp ←
"
("
("l" cool-moves/line-forward) ("L" cool-moves/line-backward)
("p" cool-moves/paragraph-forward) ("P" cool-moves/paragraph-backward)
("w" cool-moves/word-forward) ("W" cool-moves/word-backwards)
("c" cool-moves/character-forward) ("C" cool-moves/character-backward)
("s" cool-moves/sentence-forward) ("S" cool-moves/sentence-backward)
("x" cool-moves/sexp-forward) ("X" cool-moves/sexp-backward))