summaryrefslogtreecommitdiff
path: root/emacs/init.el
diff options
context:
space:
mode:
Diffstat (limited to 'emacs/init.el')
-rw-r--r--emacs/init.el15
1 files changed, 10 insertions, 5 deletions
diff --git a/emacs/init.el b/emacs/init.el
index eaec53b..491c9a8 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -126,17 +126,16 @@ dedicated."
(with-selected-window cw
(switch-to-buffer ob)))))))
-(require 'range)
(defun my/c-x-n-to-m-n (&optional keymap)
"Rebind the keys starting with C-x [number] to M-[number] in the
given keymap or in the global keymap."
(unless keymap (setq keymap global-map))
- (range-map (lambda (n)
+ (mapc (lambda (n)
(let* ((from (concat "C-x " (format "%d" n)))
(to (concat "M-" (format "%d" n)))
(bind (keymap-lookup keymap from)))
(keymap-set keymap to bind)))
- '((0 . 9))))
+ '(0 1 2 3 4 5 6 7 8 9)))
(my/c-x-n-to-m-n)
(use-package server ; allow emacsclient
@@ -724,12 +723,18 @@ changes."
(interactive)
(start-process-shell-command "firefox" nil "firefox"))
+ (defun my/eshell (&optional arg)
+ (interactive "P")
+ (if (eq major-mode 'eshell-mode)
+ ;; switch back
+ (switch-to-prev-buffer)
+ (eshell arg)))
+
(exwm-randr-mode)
(exwm-systemtray-mode)
(push ?\C-\\ exwm-input-prefix-keys) ;;C-\ to switch input method
(push ?\C-u exwm-input-prefix-keys) ;; send C-u to all windows too
(push ?\M-L exwm-input-prefix-keys)
- (setq exwm-marked-buffer "*scratch*") ;; store the buffer we were at before a jump
(when (equal window-system 'x)
(exwm-enable))
:hook
@@ -756,7 +761,7 @@ changes."
([?\M-D] . my/dmenu)
([?\M-E] . my/browser)
- ([M-return] . eshell)
+ ([M-return] . my/eshell)
,@(mapcar (lambda (n)
(let* ((from (concat "C-x " (format "%d" n)))