1
0
Fork 0

Add a hydra to sort lines and strings

This commit is contained in:
Tom Willemse 2021-01-31 21:59:47 -08:00
parent ff7d19dc1e
commit 863222af0d

View file

@ -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-c (") 'embrace-commander)
(global-set-key (kbd "C-x M-f") 'ffap)
(global-set-key (kbd "C-x C-b") 'ibuffer-jump)
(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-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-S-f") 'windmove-right)
(global-set-key (kbd "C-S-b") 'windmove-left)
(global-set-key (kbd "C-c (") 'embrace-commander)
(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-<left>") 'winner-undo)
(global-set-key (kbd "C-<right>") 'winner-redo)