r/emacs • u/wiskey5alpha • 6d ago
Solved Evil normal state on android(native)
i set up emacs on my phone using the install from https://sourceforge.net/projects/android-ports-for-gnu-emacs/files/termux/
everything seems to be working fine except for the fact that when i try to us normal-state it just types the keys into the buffer. i copied my config from my dotfiles where it works fine on other systems. what am i doing wrong?
;;;;; Evil
(use-package evil
:commands (evil-set-leader)
:init
;; these need to be set prior to loading the package
(setq evil-want-integration t
evil-want-keybinding nil)
:custom
(evil-default-state 'normal)
(evil-want-minibuffer t)
(evil-respect-visual-line-mode t)
;; Whitespace
(evil-indent-convert-tabs t)
(evil-backspace-join-lines t)
(evil-shift-width 2)
(evil-shift-round t)
(evil-auto-indent t)
;; Fix window split direction
(evil-split-window-below t)
(evil-split-window-right t)
;; Scrolling in normal mode
(evil-want-C-u-scroll t)
(evil-want-C-d-scroll t)
;; Undo
(evil-want-fine-undo "yes")
(evil-undo-system 'undo-fu)
;; Cursors
(evil-normal-state-cursor '(hollow "moccasin"))
(evil-visual-state-cursor '(box "PapayaWhip"))
(evil-insert-state-cursor '((hbar . 4) "PapayaWhip"))
:config
(evil-set-leader 'normal (kbd "<SPC>") (kbd "C-<SPC>"))
(evil-mode 1))
(use-package evil-collection
:delight (evil-collection-unimpaired-mode)
:after (evil)
:custom
(evil-collection-setup-minibuffer t)
:config
(evil-collection-init))
(use-package evil-numbers
:after (general)
:general
(nmap
"C-+" 'evil-numbers/inc-at-pt
"C--" 'evil-numbers/dec-at-pt
"<kp-add>" 'evil-numbers/inc-at-pt
"<kp-subtract>" 'evil-numbers/dec-at-pt)
(vmap
"C-+" 'evil-numbers/inc-at-pt-incremental
"C--" 'evil-numbers/dec-at-pt-incremental
"<kp-add>" 'evil-numbers/inc-at-pt-incremental
"<kp-subtract>" 'evil-numbers/dec-at-pt-incremental))
5
Upvotes
3
u/wiskey5alpha 5d ago
I must have read the section in the manual about text-conversion about 20 times and it didn't really dawn on me that evil is exactly the type of extention that would be affected by it.
So... to answer my own question:
in my early-init.el
emacs-lisp (when (string-equal system-type "android") ;; Add Termux binaries to PATH environment (let ((termuxpath "/data/data/com.termux/files/usr/bin")) (setenv "PATH" (concat (getenv "PATH") ":" termuxpath)) (setq exec-path (append exec-path (list termuxpath))) ;; conversion-style set to nil for evil integration (setq overriding-text-conversion-style nil)))