Skip to content
This repository was archived by the owner on Jul 13, 2020. It is now read-only.

Commit f8249c1

Browse files
committed
add evil keybindings
Added evil keybindings consistent with spacemacs inferior mode REPLs Also added keybindings to spacemacs/application/jupyter: "aja" 'jupyter-repl-associate-buffer "ajs" 'jupyter-server-list-kernels
1 parent 5da8cab commit f8249c1

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

packages.el

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,14 @@
4242
:init
4343
;; (progn
4444
(spacemacs/set-leader-keys
45-
"ajj" 'jupyter-run-repl
45+
"aja" 'jupyter-repl-associate-buffer
46+
"ajc" 'jupyter-connect-repl
4647
"ajr" 'jupyter-run-repl
47-
"ajc" 'jupyter-connect-repl)
48+
"ajs" 'jupyter-server-list-kernels
49+
)
4850
;; (spacemacs|add-company-backends :backends company-capf :modes jupyter-repl-mode))
4951
:config
5052
(progn
51-
(evilified-state-evilify-map 'jupyter-repl-mode-map
52-
:mode jupyter-repl-mode)
53-
5453
(spacemacs/declare-prefix-for-mode 'jupyter-repl-mode
5554
"mf" "file")
5655
(spacemacs/declare-prefix-for-mode 'jupyter-repl-mode
@@ -70,7 +69,20 @@
7069
"hn" 'jupyter-repl-history-next
7170
"hN" 'jupyter-repl-history-previous
7271
"i" 'jupyter-inspect-at-point
73-
"sb" 'jupyter-repl-pop-to-buffer)))
72+
"sb" 'jupyter-repl-pop-to-buffer)
73+
74+
(when (eq dotspacemacs-editing-style 'vim)
75+
(evil-define-key '(insert normal) jupyter-repl-mode-map
76+
(kbd "C-j") 'jupyter-repl-history-next
77+
(kbd "C-k") 'jupyter-repl-history-previous
78+
(kbd "C-l") 'jupyter-repl-clear-cells
79+
(kbd "M-j") 'jupyter-repl-forward-cell
80+
(kbd "M-k") 'jupyter-repl-backward-cell
81+
(kbd "C-s") 'jupyter-repl-scratch-buffer
82+
(kbd "C-R") 'jupyter-repl-history-next-matching
83+
(kbd "C-r") 'jupyter-repl-history-previous-matching))
84+
))
85+
7486
(message "jupyter was not found in your path, jupyter is not loaded")))
7587

7688
(defun jupyter/post-init-company ()

0 commit comments

Comments
 (0)