0

I am currently trying to set up my config so that I can use evil-mode while also using the space key as a local leader for some command while mapping my keys with general.el package.

;; hide tool bar
(tool-bar-mode -1)

(setq-default tab-width 4)

;; add melpa
(require 'package)
(add-to-list 'package-archives
             '("melpa" . "https://melpa.org/packages/") t)

(use-package evil
         :ensure t
         :config
         (progn
           (evil-mode 1)
           ;(use-package evil-leader
           ;     :ensure t
           ;     :config
           ;     (global-evil-leader-mode))
           (require 'evil-leader)
           (setq evil-default-cursor t)))

;; for providing wrappers for defining keybindings
(use-package general
         :ensure t)


;; for telling me which key does what
(use-package which-key
         :ensure t
         :config
         (progn
           (setq which-key-idle-delay 0.5)
           (which-key-mode +1)))

(general-define-key
 :state 'normal
 :prefix "SPC"
 "w/" 'split-window-right)

But when I run the config I get the following error

error: Key sequence SPC w / starts with non-prefix key SPC

I have tried unbinding the space key but even when I do so my keybinding doesn't work and the space key just works as it normally does in normal mode. What am I missing here, is it some kind of conflict between general and evil-leader or am I just missing something?

bumped to the homepage by Community 15 hours ago

This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.

0

I managed to get the wanted behaviour by using the following

(general-evil-define-key 'normal 'global
 :prefix "SPC"
 "w/" 'split-window-right)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.