2017-11-07 11:04:12 +01:00
|
|
|
;;; evil-ztree.el --- Evil bindings for ztree -*- lexical-binding: t -*-
|
2017-11-06 17:53:44 +01:00
|
|
|
|
|
|
|
;; Copyright (C) 2017 Pierre Neidhardt
|
|
|
|
|
|
|
|
;; Author: Pierre Neidhardt <ambrevar@gmail.com>
|
|
|
|
;; Maintainer: James Nguyen <james@jojojames.com>, Pierre Neidhardt <ambrevar@gmail.com>
|
|
|
|
;; 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, ztree, tools
|
2017-11-06 17:53:44 +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 10:53:13 +01:00
|
|
|
;; Evil bindings for ztree.
|
2017-11-06 17:53:44 +01:00
|
|
|
|
|
|
|
;;; Code:
|
|
|
|
(require 'evil)
|
|
|
|
(require 'ztree)
|
|
|
|
|
2017-11-07 10:53:13 +01:00
|
|
|
(defun evil-ztree-setup ()
|
|
|
|
(evil-set-initial-state 'ztree-mode 'motion)
|
2017-11-06 17:53:44 +01:00
|
|
|
|
2017-11-07 10:53:13 +01:00
|
|
|
(evil-define-key 'motion ztree-mode-map
|
|
|
|
(kbd "<tab>") 'ztree-jump-side
|
|
|
|
(kbd "<return>") 'ztree-perform-action
|
|
|
|
(kbd "SPC") 'ztree-perform-soft-action
|
2017-11-06 17:53:44 +01:00
|
|
|
|
2017-11-07 10:53:13 +01:00
|
|
|
"x" 'ztree-toggle-expand-subtree
|
2017-11-06 17:53:44 +01:00
|
|
|
|
2017-11-07 10:53:13 +01:00
|
|
|
;; update
|
|
|
|
"gr" 'ztree-refresh-buffer
|
2017-11-06 17:53:44 +01:00
|
|
|
|
2017-11-07 10:53:13 +01:00
|
|
|
;; quit
|
|
|
|
"q" 'quit-window
|
|
|
|
"ZQ" 'quit-window
|
|
|
|
"ZZ" 'quit-window)
|
2017-11-06 17:53:44 +01:00
|
|
|
|
2017-11-07 10:53:13 +01:00
|
|
|
(evil-define-minor-mode-key 'motion 'ztreediff-mode
|
|
|
|
"C" 'ztree-diff-copy
|
|
|
|
"D" 'ztree-diff-delete-file
|
|
|
|
"zH" 'ztree-diff-toggle-show-filtered-files
|
|
|
|
"d" 'ztree-diff-simple-diff-files
|
|
|
|
"zh" 'ztree-diff-toggle-show-equal-files
|
|
|
|
"gf" 'ztree-diff-view-file
|
2017-11-06 17:53:44 +01:00
|
|
|
|
2017-11-07 10:53:13 +01:00
|
|
|
;; update
|
|
|
|
"gr" 'ztree-diff-partial-rescan
|
|
|
|
"gR" 'ztree-diff-full-rescan))
|
2017-11-06 17:53:44 +01:00
|
|
|
|
2017-11-07 10:53:13 +01:00
|
|
|
(provide 'evil-ztree)
|
2017-11-06 17:53:44 +01:00
|
|
|
;;; evil-ztree.el ends here
|