Skip to content

Commit

Permalink
VLF: Move common edit/navigation bingings to g keys
Browse files Browse the repository at this point in the history
  • Loading branch information
jojojames committed Dec 1, 2024
1 parent 6f7d059 commit ed8c652
Showing 1 changed file with 22 additions and 14 deletions.
36 changes: 22 additions & 14 deletions modes/vlf/evil-collection-vlf.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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

0 comments on commit ed8c652

Please sign in to comment.