2017-12-07 02:41:09 +01:00
|
|
|
;;; evil-collection-elfeed.el --- Evil bindings for elfeed -*- lexical-binding: t -*-
|
2017-11-06 17:52:14 +01:00
|
|
|
|
|
|
|
;; Copyright (C) 2017 Pierre Neidhardt
|
|
|
|
|
|
|
|
;; Author: Pierre Neidhardt <ambrevar@gmail.com>
|
2017-11-07 11:04:12 +01:00
|
|
|
;; Maintainer: James Nguyen <james@jojojames.com>
|
|
|
|
;; Pierre Neidhardt <ambrevar@gmail.com>
|
2017-11-06 17:52:14 +01:00
|
|
|
;; URL: https://github.com/jojojames/evil-collection
|
|
|
|
;; Version: 0.0.1
|
|
|
|
;; Package-Requires: ((emacs "25.1"))
|
2017-11-07 11:04:12 +01:00
|
|
|
;; Keywords: evil, elfeed, tools
|
2017-11-06 17:52:14 +01:00
|
|
|
|
|
|
|
;; This file 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, or (at your
|
|
|
|
;; option) any later version.
|
|
|
|
;;
|
|
|
|
;; This file 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.
|
|
|
|
;;
|
|
|
|
;; For a full copy of the GNU General Public License
|
|
|
|
;; see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
;;; Commentary:
|
2017-11-07 11:04:12 +01:00
|
|
|
;; Evil bindings for elfeed.
|
2017-11-06 17:52:14 +01:00
|
|
|
|
|
|
|
;;; Code:
|
2017-11-15 10:12:24 +01:00
|
|
|
(require 'elfeed nil t)
|
2017-11-07 11:04:12 +01:00
|
|
|
(require 'evil)
|
2017-11-06 17:52:14 +01:00
|
|
|
|
2017-12-07 02:41:09 +01:00
|
|
|
(defun evil-collection-elfeed-setup ()
|
2017-11-17 03:53:35 +01:00
|
|
|
"Set up `evil' bindings for `elfeed'."
|
2017-11-06 17:52:14 +01:00
|
|
|
|
2018-02-22 17:15:12 +01:00
|
|
|
(evil-collection-inhibit-insert-state elfeed-search-mode-map)
|
|
|
|
(evil-set-initial-state 'elfeed-search-mode 'normal)
|
|
|
|
(evil-define-key 'normal elfeed-search-mode-map
|
2017-12-02 10:13:10 +01:00
|
|
|
;; open
|
2017-11-06 17:52:14 +01:00
|
|
|
(kbd "<return>") 'elfeed-search-show-entry
|
2017-12-02 10:13:10 +01:00
|
|
|
(kbd "S-<return>") 'elfeed-search-browse-url
|
2017-12-03 14:45:22 +01:00
|
|
|
"go" 'elfeed-search-browse-url
|
2017-12-02 10:13:10 +01:00
|
|
|
|
2017-11-06 17:52:14 +01:00
|
|
|
"y" 'elfeed-search-yank
|
|
|
|
|
|
|
|
;; filter
|
|
|
|
"s" 'elfeed-search-live-filter
|
|
|
|
"S" 'elfeed-search-set-filter
|
|
|
|
|
2017-11-23 16:18:44 +01:00
|
|
|
;; refresh
|
2018-02-23 18:31:31 +01:00
|
|
|
"gR" 'elfeed-search-fetch ; TODO: Which update function is more useful?
|
2017-12-02 10:13:10 +01:00
|
|
|
"gr" 'elfeed-search-update--force
|
2017-11-06 17:52:14 +01:00
|
|
|
|
|
|
|
;; quit
|
|
|
|
"q" 'quit-window
|
|
|
|
"ZQ" 'quit-window
|
|
|
|
"ZZ" 'quit-window)
|
|
|
|
|
2018-02-22 17:15:12 +01:00
|
|
|
(evil-define-key '(normal visual) elfeed-search-mode-map
|
2017-11-06 17:52:14 +01:00
|
|
|
"+" 'elfeed-search-tag-all
|
|
|
|
"-" 'elfeed-search-untag-all
|
|
|
|
"U" 'elfeed-search-tag-all-unread
|
|
|
|
"u" 'elfeed-search-untag-all-unread)
|
|
|
|
|
2018-02-22 17:15:12 +01:00
|
|
|
(evil-collection-inhibit-insert-state elfeed-show-mode-map)
|
|
|
|
(evil-set-initial-state 'elfeed-show-mode 'normal)
|
|
|
|
(evil-define-key 'normal elfeed-show-mode-map
|
2017-12-02 10:13:10 +01:00
|
|
|
(kbd "S-<return>") 'elfeed-show-visit
|
2017-12-03 14:45:22 +01:00
|
|
|
"go" 'elfeed-show-visit
|
2017-11-06 17:52:14 +01:00
|
|
|
|
|
|
|
;; filter
|
|
|
|
"s" 'elfeed-show-new-live-search
|
|
|
|
|
|
|
|
"+" 'elfeed-show-tag
|
|
|
|
"-" 'elfeed-show-untag
|
|
|
|
|
|
|
|
"A" 'elfeed-show-add-enclosure-to-playlist
|
|
|
|
"P" 'elfeed-show-play-enclosure
|
|
|
|
"d" 'elfeed-show-save-enclosure
|
|
|
|
|
|
|
|
"]" 'elfeed-show-next
|
|
|
|
"[" 'elfeed-show-prev
|
2017-11-23 15:05:29 +01:00
|
|
|
"gj" 'elfeed-show-next
|
|
|
|
"gk" 'elfeed-show-prev
|
2017-11-06 17:52:14 +01:00
|
|
|
(kbd "C-j") 'elfeed-show-next
|
|
|
|
(kbd "C-k") 'elfeed-show-prev
|
|
|
|
|
2017-11-23 16:18:44 +01:00
|
|
|
;; refresh
|
2017-12-02 10:13:10 +01:00
|
|
|
"gr" 'elfeed-show-refresh
|
2017-11-06 17:52:14 +01:00
|
|
|
|
|
|
|
;; quit
|
|
|
|
"q" 'elfeed-kill-buffer
|
|
|
|
"ZQ" 'elfeed-kill-buffer
|
2018-02-23 18:31:31 +01:00
|
|
|
"ZZ" 'elfeed-kill-buffer)
|
|
|
|
|
|
|
|
(evil-define-key 'operator elfeed-show-mode-map
|
|
|
|
;; Like `eww'.
|
|
|
|
"u" '(menu-item
|
|
|
|
""
|
|
|
|
nil
|
|
|
|
:filter (lambda (&optional _)
|
|
|
|
(when (memq evil-this-operator
|
|
|
|
evil-collection-yank-operators)
|
2018-02-24 09:22:48 +01:00
|
|
|
(setq evil-inhibit-operator t)
|
2018-02-23 18:31:31 +01:00
|
|
|
#'elfeed-show-yank)))))
|
2017-11-06 17:52:14 +01:00
|
|
|
|
2017-12-07 02:41:09 +01:00
|
|
|
(provide 'evil-collection-elfeed)
|
|
|
|
;;; evil-collection-elfeed.el ends here
|