diff --git a/evil-collection.el b/evil-collection.el index 152b958..14b51be 100644 --- a/evil-collection.el +++ b/evil-collection.el @@ -75,7 +75,8 @@ transmission vlf woman - xref) + xref + (ztree ztree-diff)) "The list of modes which will be evilified by `evil-collection-init'. Elements are either target mode symbols or lists which `car' is the mode symbol and `cdr' the packages to register. diff --git a/evil-ztree.el b/evil-ztree.el new file mode 100644 index 0000000..c7aed9e --- /dev/null +++ b/evil-ztree.el @@ -0,0 +1,63 @@ +;;; evil-ztree.el --- Evil bindings for ztree -*- lexical-binding: t -*- + +;; Copyright (C) 2017 Pierre Neidhardt + +;; Author: Pierre Neidhardt +;; Maintainer: James Nguyen , Pierre Neidhardt +;; URL: https://github.com/jojojames/evil-collection +;; Version: 0.0.1 +;; Package-Requires: ((emacs "25.1")) +;; Keywords: emacs, compile, evil +;; HomePage: https://github.com/jojojames/evil-collection + +;; 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 . + +;;; Commentary: + +;;; Code: + +(require 'evil) +(require 'ztree) + +(evil-set-initial-state 'ztree-mode 'motion) + +(evil-define-key 'motion ztree-mode-map + (kbd "") 'ztree-jump-side + (kbd "") 'ztree-perform-action + (kbd "SPC") 'ztree-perform-soft-action + + "x" 'ztree-toggle-expand-subtree + + ;; update + "gr" 'ztree-refresh-buffer + + ;; quit + "q" 'quit-window + "ZQ" 'quit-window + "ZZ" 'quit-window) + +(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 + + ;; update + "gr" 'ztree-diff-partial-rescan + "gR" 'ztree-diff-full-rescan) + +(provide 'init-evil-ztree) +;;; evil-ztree.el ends here