2017-12-07 02:41:09 +01:00
|
|
|
;;; evil-collection-comint.el --- Bindings for `comint-mode'. -*- lexical-binding: t -*-
|
2017-11-12 20:16:09 +01:00
|
|
|
|
|
|
|
;; Copyright (C) 2017 James Nguyen
|
|
|
|
|
|
|
|
;; Author: James Nguyen <james@jojojames.com>
|
|
|
|
;; Maintainer: James Nguyen <james@jojojames.com>
|
2018-08-27 10:41:51 +02:00
|
|
|
;; Pierre Neidhardt <mail@ambrevar.xyz>
|
2018-03-02 02:22:38 +01:00
|
|
|
;; URL: https://github.com/emacs-evil/evil-collection
|
2017-11-12 20:16:09 +01:00
|
|
|
;; Version: 0.0.1
|
|
|
|
;; Package-Requires: ((emacs "25.1"))
|
2017-11-16 09:47:09 +01:00
|
|
|
;; Keywords: evil, comint, processes
|
2017-11-12 20:16:09 +01:00
|
|
|
|
|
|
|
;; 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:
|
|
|
|
;;; Bindings for `comint-mode'.
|
|
|
|
|
|
|
|
;;; Code:
|
|
|
|
(require 'comint)
|
2018-06-20 03:14:50 +02:00
|
|
|
(require 'evil-collection)
|
2017-11-12 20:16:09 +01:00
|
|
|
|
2017-12-18 04:26:31 +01:00
|
|
|
(defconst evil-collection-comint-maps '(comint-mode-map))
|
|
|
|
|
2018-10-15 12:30:19 +02:00
|
|
|
;;;###autoload
|
2017-12-07 02:41:09 +01:00
|
|
|
(defun evil-collection-comint-setup ()
|
2017-11-17 03:53:35 +01:00
|
|
|
"Set up `evil' bindings for `comint'."
|
2017-11-12 20:16:09 +01:00
|
|
|
(when evil-want-C-d-scroll
|
2018-06-06 13:32:19 +02:00
|
|
|
(evil-collection-define-key 'normal 'comint-mode-map
|
2017-11-12 20:16:09 +01:00
|
|
|
(kbd "C-d") #'evil-scroll-down))
|
|
|
|
|
2018-06-06 13:32:19 +02:00
|
|
|
(evil-collection-define-key 'normal 'comint-mode-map
|
2019-02-04 20:21:55 +01:00
|
|
|
;; Match Eshell bindings:
|
|
|
|
(kbd "C-j") #'comint-next-prompt
|
|
|
|
(kbd "C-k") #'comint-previous-prompt
|
|
|
|
(kbd "gj") #'comint-next-prompt
|
|
|
|
(kbd "gk") #'comint-previous-prompt
|
2019-03-16 18:54:12 +01:00
|
|
|
(kbd "]]") #'comint-next-prompt
|
|
|
|
(kbd "[[") #'comint-previous-prompt
|
2019-02-04 20:21:55 +01:00
|
|
|
(kbd "C-p") #'comint-previous-input
|
|
|
|
(kbd "C-n") #'comint-next-input)
|
2017-11-12 20:16:09 +01:00
|
|
|
|
2018-06-06 13:32:19 +02:00
|
|
|
(evil-collection-define-key 'insert 'comint-mode-map
|
2017-11-12 20:16:09 +01:00
|
|
|
(kbd "<up>") #'comint-previous-input
|
|
|
|
(kbd "<down>") #'comint-next-input))
|
|
|
|
|
2017-12-07 02:41:09 +01:00
|
|
|
(provide 'evil-collection-comint)
|
|
|
|
;;; evil-collection-comint.el ends here
|