1 ;; ;;; shell-command-output-mode.el --- A major mode for shell command output buffer -*- lexical-binding: t; -*-
3 ;; Copyright (C) 2017 Peng Li
5 ;; Author: Peng Li <seudut@gmail.com>
8 ;; This program is free software; you can redistribute it and/or modify
9 ;; it under the terms of the GNU General Public License as published by
10 ;; the Free Software Foundation, either version 3 of the License, or
11 ;; (at your option) any later version.
13 ;; This program is distributed in the hope that it will be useful,
14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;; GNU General Public License for more details.
18 ;; You should have received a copy of the GNU General Public License
19 ;; along with this program. If not, see <http://www.gnu.org/licenses/>.
27 ;; (defun haha/delet-window ()
31 (defvar shell-command-output-mode-map
32 (let ((map (make-sparse-keymap)))
33 (define-key map (kbd "q") (lambda () (interactive) (quit-window t)))
35 "Keymap used in shell-command-output-mode mode")
37 (defcustom shell-command-output-mode-hook nil
38 "Hook run when shell command output mode is enabled"
40 :group 'shell-command-outut)
43 (define-derived-mode shell-command-output-mode fundamental-mode "shell-command-output" ""
44 (use-local-map shell-command-output-mode-map)
45 (setq buffer-read-only t)
46 ;; enable evil motion state for this mode
47 (if (and (boundp evil-mode) (fboundp 'evil-motion-state))
48 (progn (add-to-list 'evil-motion-state-modes 'shell-command-output-mode)
52 (provide 'shell-command-output-mode)
53 ;;; shell-command-output-mode.el ends here