summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Nguyen <james@jojojames.com>2024-12-01 14:41:59 -0500
committerJames Nguyen <james@jojojames.com>2024-12-01 14:42:25 -0500
commited8c652b1f49e3b01d787bf33ccb2345399572d4 (patch)
treeb9c021255dbb763a2d508ae98767413b5f166e19
parent6f7d059b7266bca83d50d4e71c3262c904955315 (diff)
VLF: Move common edit/navigation bingings to g keys
-rw-r--r--modes/vlf/evil-collection-vlf.el36
1 files changed, 22 insertions, 14 deletions
diff --git a/modes/vlf/evil-collection-vlf.el b/modes/vlf/evil-collection-vlf.el
index 39780a2..12ed0d0 100644
--- a/modes/vlf/evil-collection-vlf.el
+++ b/modes/vlf/evil-collection-vlf.el
@@ -35,6 +35,11 @@
(defconst evil-collection-vlf-maps '(vlf-mode-map))
+(defcustom evil-collection-vlf-want-g-bindings t
+ "Whether to bind single keys to g prefix."
+ :type 'boolean
+ :group 'evil-collection)
+
(defun evil-collection-vlf-decrease-batch-size ()
"Decrease vlf batch size by factor of 2."
(interactive)
@@ -55,26 +60,29 @@
(kbd "C-k") 'vlf-prev-batch
"]]" 'vlf-next-batch
"[[" 'vlf-prev-batch
-
"+" 'vlf-change-batch-size
"-" 'evil-collection-vlf-decrease-batch-size
"=" 'vlf-next-batch-from-point
-
;; refresh
"gr" 'vlf-revert
-
- "s" 'vlf-re-search-forward
- "S" 'vlf-re-search-backward
-
- "gg" 'vlf-beginning-of-file
- "G" 'vlf-end-of-file
- "J" 'vlf-jump-to-chunk
- "E" 'vlf-ediff-buffers
-
"g%" 'vlf-query-replace
- "go" 'vlf-occur
- "L" 'vlf-goto-line
- "F" 'vlf-toggle-follow))
+ "go" 'vlf-occur)
+
+ (if evil-collection-vlf-want-g-bindings
+ (evil-collection-define-key 'normal 'vlf-prefix-map
+ "g/" 'vlf-re-search-forward
+ "g?" 'vlf-re-search-backward
+ "gJ" 'vlf-jump-to-chunk
+ "gE" 'vlf-ediff-buffers
+ "g:" 'vlf-goto-line
+ "gF" 'vlf-toggle-follow)
+ (evil-collection-define-key 'normal 'vlf-prefix-map
+ "s" 'vlf-re-search-forward
+ "S" 'vlf-re-search-backward
+ "J" 'vlf-jump-to-chunk
+ "E" 'vlf-ediff-buffers
+ "L" 'vlf-goto-line
+ "F" 'vlf-toggle-follow)))
(provide 'evil-collection-vlf)
;;; evil-collection-vlf.el ends here