Add a hydra to sort lines and strings
This commit is contained in:
parent
ff7d19dc1e
commit
863222af0d
1 changed files with 27 additions and 11 deletions
38
oni-core.el
38
oni-core.el
|
@ -4,8 +4,8 @@
|
||||||
|
|
||||||
;; Author: Tom Willemse <tom@ryuslash.org>
|
;; Author: Tom Willemse <tom@ryuslash.org>
|
||||||
;; Keywords: local
|
;; Keywords: local
|
||||||
;; Version: 2020.1218.000639
|
;; Version: 2021.0131.215934
|
||||||
;; Package-Requires: (oni-data-dir oni-embrace expand-region multiple-cursors gcmh diminish ws-butler which-key)
|
;; 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
|
;; 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
|
;; it under the terms of the GNU General Public License as published by
|
||||||
|
@ -29,10 +29,11 @@
|
||||||
|
|
||||||
(require 'diminish)
|
(require 'diminish)
|
||||||
(require 'gcmh)
|
(require 'gcmh)
|
||||||
|
(require 'hydra)
|
||||||
(require 'oni-data-dir)
|
(require 'oni-data-dir)
|
||||||
(require 'recentf)
|
(require 'recentf)
|
||||||
(require 'ws-butler)
|
|
||||||
(require 'which-key)
|
(require 'which-key)
|
||||||
|
(require 'ws-butler)
|
||||||
|
|
||||||
(defconst oni-core--auto-save-directory (oni-data-dir-locate "auto-save-files/")
|
(defconst oni-core--auto-save-directory (oni-data-dir-locate "auto-save-files/")
|
||||||
"Directory where auto-saves go.")
|
"Directory where auto-saves go.")
|
||||||
|
@ -85,6 +86,20 @@
|
||||||
(let ((inhibit-message t))
|
(let ((inhibit-message t))
|
||||||
(recentf-save-list)))
|
(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
|
(add-to-list 'auto-save-file-name-transforms
|
||||||
`(".*" ,oni-core--auto-save-directory t)
|
`(".*" ,oni-core--auto-save-directory t)
|
||||||
:append)
|
:append)
|
||||||
|
@ -136,16 +151,17 @@
|
||||||
(add-hook 'after-save-hook 'executable-make-buffer-file-executable-if-script-p)
|
(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 "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-c (") 'embrace-commander)
|
(global-set-key (kbd "C-S-f") 'windmove-right)
|
||||||
(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-n") 'windmove-down)
|
(global-set-key (kbd "C-S-n") 'windmove-down)
|
||||||
(global-set-key (kbd "C-S-p") 'windmove-up)
|
(global-set-key (kbd "C-S-p") 'windmove-up)
|
||||||
(global-set-key (kbd "C-S-f") 'windmove-right)
|
(global-set-key (kbd "C-c (") 'embrace-commander)
|
||||||
(global-set-key (kbd "C-S-b") 'windmove-left)
|
(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-<left>") 'winner-undo)
|
||||||
(global-set-key (kbd "C-<right>") 'winner-redo)
|
(global-set-key (kbd "C-<right>") 'winner-redo)
|
||||||
|
|
Loading…
Reference in a new issue