aboutsummaryrefslogtreecommitdiff
path: root/.config/emacs/lisp/evil-collection/modes/fzfa/evil-collection-fzfa.el
blob: ad54dbf4a47c8c8aea6181a7951cabc9d8de9480 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
;;; evil-collection-fzfa.el --- Evil bindings for fzfa -*- lexical-binding: t -*-

;; Copyright (C) 2026 James Nguyen

;; Author: James Nguyen <james@jojojames.com>
;; Maintainer: James Nguyen <james@jojojames.com>
;; URL: https://github.com/emacs-evil/evil-collection
;; Version: 0.0.1
;; Package-Requires: ((emacs "29.1"))
;; Keywords: evil, fzfa, tools

;; 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
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.

;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with this program.  If not, see <http://www.gnu.org/licenses/>.

;;; Commentary:
;; Evil bindings for `fzfa'.
;;
;; The fzfa commands are autoloaded so no (require 'fzfa nil t) is needed.

;;; Code:
(require 'evil-collection)

(defvar evil-collection-fzfa-jump-commands
  '(;; Buffer-local jumps.
    fzfa-swiper
    fzfa-imenu
    fzfa-imenu-all-but-current
    fzfa-mark
    fzfa-outline
    fzfa-evil-marks
    ;; Cross-buffer / file jumps.
    fzfa-swiper-all
    fzfa-imenu-all
    fzfa-global-mark
    fzfa-recent-file
    fzfa-buffer
    fzfa-bookmark
    fzfa-tramp
    fzfa-evil-jumps
    fzfa-find
    fzfa-fd
    fzfa-locate
    fzfa-grep
    fzfa-grep-current-file
    fzfa-ugrep
    fzfa-rg
    fzfa-rg-files
    fzfa-ag
    fzfa-ag-files
    fzfa-git-grep
    fzfa-git-ls-files
    fzfa-git-modified-locally
    fzfa-git-added-files
    fzfa-git-staged-for-commit
    fzfa-git-modified-in-head
    fzfa-git-log-grep
    fzfa-hg-files
    fzfa-hg-modified-locally
    fzfa-hg-added-files
    fzfa-hg-modified-in-head
    fzfa-project-find-file
    fzfa-project-find-dir
    fzfa-project-buffer
    fzfa-project-recentf
    fzfa-project-switch-project
    fzfa-compile-error
    fzfa-flymake
    fzfa-flymake-project
    fzfa-org-heading
    fzfa-org-heading-all
    fzfa-org-agenda
    fzfa-org-todo
    fzfa-org-tags-view
    fzfa-info
    fzfa-info-emacs
    fzfa-info-elisp
    fzfa-info-org
    fzfa-info-cl
    fzfa-info-eieio
    fzfa-info-magit
    fzfa-info-at-point
    fzfa-hungry-swiper
    fzfa-hungry-find
    fzfa-find-any
    fzfa-find-some
    fzfa-evil-any)
  "List of `fzfa' commands that should be treated as evil jumps.")

(defun evil-collection-fzfa-set-bindings ()
  "Set the bindings."
  (dolist (cmd evil-collection-fzfa-jump-commands)
    (evil-declare-not-repeat cmd)
    (evil-set-command-property cmd :jump t)))

;;;###autoload
(defun evil-collection-fzfa-setup ()
  "Set up `evil' bindings for `fzfa'."
  (evil-collection-fzfa-set-bindings))

(provide 'evil-collection-fzfa)
;;; evil-collection-fzfa.el ends here