aboutsummaryrefslogtreecommitdiffstats
path: root/oni-core.el
diff options
context:
space:
mode:
authorGravatar Tom Willemse2021-01-31 21:59:47 -0800
committerGravatar Tom Willemse2021-01-31 21:59:47 -0800
commit863222af0d5800996bcdee50dd5210c789b3d865 (patch)
treef622bcdcefad3e99f3ef15bcf761ae7e6cbc3c5c /oni-core.el
parentff7d19dc1e90dd7908eaa315f0ed5e8fa5a362dc (diff)
downloademacs-config-863222af0d5800996bcdee50dd5210c789b3d865.tar.gz
emacs-config-863222af0d5800996bcdee50dd5210c789b3d865.zip
Add a hydra to sort lines and strings
Diffstat (limited to 'oni-core.el')
-rw-r--r--oni-core.el34
1 files changed, 25 insertions, 9 deletions
diff --git a/oni-core.el b/oni-core.el
index 56253a9..1660dfa 100644
--- a/oni-core.el
+++ b/oni-core.el
@@ -4,8 +4,8 @@
;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local
-;; Version: 2020.1218.000639
-;; Package-Requires: (oni-data-dir oni-embrace expand-region multiple-cursors gcmh diminish ws-butler which-key)
+;; Version: 2021.0131.215934
+;; Package-Requires: (oni-data-dir oni-embrace oni-hydra expand-region multiple-cursors gcmh diminish ws-butler which-key)
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@@ -29,10 +29,11 @@
(require 'diminish)
(require 'gcmh)
+(require 'hydra)
(require 'oni-data-dir)
(require 'recentf)
-(require 'ws-butler)
(require 'which-key)
+(require 'ws-butler)
(defconst oni-core--auto-save-directory (oni-data-dir-locate "auto-save-files/")
"Directory where auto-saves go.")
@@ -85,6 +86,20 @@
(let ((inhibit-message t))
(recentf-save-list)))
+(defhydra oni-sort-and-align-hydra (:color teal :hint nil)
+ "
+ ^Sort^
+^^--------------
+_l_: Lines
+_s_: String list"
+ ("l" sort-lines)
+ ("s" (sort-regexp-fields
+ nil
+ (rx "\"" (one-or-more (not "\"")) "\"")
+ (rx (one-or-more (not "\"")))
+ (region-beginning)
+ (region-end))))
+
(add-to-list 'auto-save-file-name-transforms
`(".*" ,oni-core--auto-save-directory t)
:append)
@@ -136,16 +151,17 @@
(add-hook 'after-save-hook 'executable-make-buffer-file-executable-if-script-p)
(global-set-key (kbd "C-M-SPC") 'er/expand-region)
-(global-set-key (kbd "M-+") 'mc/mark-next-like-this)
+(global-set-key (kbd "C-S-b") 'windmove-left)
+(global-set-key (kbd "C-S-f") 'windmove-right)
+(global-set-key (kbd "C-S-n") 'windmove-down)
+(global-set-key (kbd "C-S-p") 'windmove-up)
(global-set-key (kbd "C-c (") 'embrace-commander)
-(global-set-key (kbd "C-x M-f") 'ffap)
+(global-set-key (kbd "C-c s") #'oni-sort-and-align-hydra/body)
(global-set-key (kbd "C-x C-b") 'ibuffer-jump)
+(global-set-key (kbd "C-x M-f") 'ffap)
+(global-set-key (kbd "M-+") 'mc/mark-next-like-this)
(global-set-key [remap move-beginning-of-line] #'oni-core-move-beginning-of-dwim)
(global-set-key [remap move-end-of-line] #'oni-core-move-end-of-dwim)
-(global-set-key (kbd "C-S-n") 'windmove-down)
-(global-set-key (kbd "C-S-p") 'windmove-up)
-(global-set-key (kbd "C-S-f") 'windmove-right)
-(global-set-key (kbd "C-S-b") 'windmove-left)
(global-set-key (kbd "C-<left>") 'winner-undo)
(global-set-key (kbd "C-<right>") 'winner-redo)