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

Commit a73cae9

Browse files
authored
Merge pull request #2 from vv111y/add-more-keybindings
add evil keybindings
2 parents 5da8cab + 9425ecd commit a73cae9

File tree

1 file changed

+22
-26
lines changed

1 file changed

+22
-26
lines changed

packages.el

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -40,37 +40,33 @@
4040
(use-package jupyter
4141
:defer t
4242
:init
43-
;; (progn
43+
(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-
;; (spacemacs|add-company-backends :backends company-capf :modes jupyter-repl-mode))
48+
"ajs" 'jupyter-server-list-kernels
49+
)
50+
(spacemacs/set-leader-keys-for-major-mode 'jupyter-repl-mode
51+
"i" 'jupyter-inspect-at-point
52+
"l" 'jupyter-load-file
53+
"s" 'jupyter-repl-scratch-buffer
54+
"I" 'jupyter-repl-interrupt-kernel
55+
"R" 'jupyter-repl-restart-kernel))
4956
:config
5057
(progn
51-
(evilified-state-evilify-map 'jupyter-repl-mode-map
52-
:mode jupyter-repl-mode)
58+
(when (eq dotspacemacs-editing-style 'vim)
59+
(evil-define-key '(insert normal) jupyter-repl-mode-map
60+
(kbd "C-j") 'jupyter-repl-history-next
61+
(kbd "C-k") 'jupyter-repl-history-previous
62+
(kbd "C-l") 'jupyter-repl-clear-cells
63+
(kbd "M-j") 'jupyter-repl-forward-cell
64+
(kbd "M-k") 'jupyter-repl-backward-cell
65+
(kbd "C-s") 'jupyter-repl-scratch-buffer
66+
(kbd "C-R") 'jupyter-repl-history-next-matching
67+
(kbd "C-r") 'jupyter-repl-history-previous-matching))
68+
))
5369

54-
(spacemacs/declare-prefix-for-mode 'jupyter-repl-mode
55-
"mf" "file")
56-
(spacemacs/declare-prefix-for-mode 'jupyter-repl-mode
57-
"me" "eval")
58-
(spacemacs/declare-prefix-for-mode 'jupyter-repl-mode
59-
"mh" "history")
60-
;; TODO not working
61-
(spacemacs/set-leader-keys-for-major-mode 'jupyter-repl-mode
62-
;; "," 'jupyter-eval-line-or-region ;; probably these functions should be called from source code
63-
;; "ee" 'jupyter-eval-line-or-region
64-
"ed" 'jupyter-eval-defun
65-
"eb" 'jupyter-eval-buffer
66-
"fl" 'jupyter-load-file
67-
"fs" 'jupyter-repl-scratch-buffer
68-
"fb" 'jupyter-repl-pop-to-buffer
69-
"kr" 'jupyter-repl-restart-kernel
70-
"hn" 'jupyter-repl-history-next
71-
"hN" 'jupyter-repl-history-previous
72-
"i" 'jupyter-inspect-at-point
73-
"sb" 'jupyter-repl-pop-to-buffer)))
7470
(message "jupyter was not found in your path, jupyter is not loaded")))
7571

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

0 commit comments

Comments
 (0)