#+TITLE: mms's Emacs Config - Keyboard configuration #+AUTHOR: MichaƂ Sapka (https://michal.sapka.me) #+STARTUP: showall indent logdoneGeneral settings #+HUGO_BASE_DIR: ~/ghq/vcs.sapka.me/michal-sapka-me/ #+HUGO_WEIGHT: 10 #+HUGO_SECTION: emacs/config #+HUGO_CATEGORIES: emacs emacs-config #+HUGO_MENU :menu "emacs-config" #+HUGO_CUSTOM_FRONT_MATTER: :abstract "My emacs config - keyboard config" #+HUGO_CUSTOM_FRONT_MATTER: :menu-abstract "evil mode, basic key bindings and misc" #+EXPORT_FILE_NAME: keyboard * Which key WK adds a on-the-fly cheatsheet. #+begin_src emacs-lisp (use-package which-key :ensure t :config (which-key-mode)) #+end_src * Xah Lee Flykeys #+begin_src emacs-lisp ;; (use-package xah-fly-keys ;; :config ;; (xah-fly-keys-set-layout "qwerty") ;; (xah-fly-keys 1) ;; ;; (define-key xah-fly-command-map (kbd "SPC i o") 'consult-bookmark) ;; (define-key xah-fly-command-map (kbd "SPC i f") 'consult-find) ;; (define-key xah-fly-command-map (kbd "SPC i F") 'find-file) ;; (define-key xah-fly-command-map (kbd "SPC i g") 'consult-ripgrep) ;; ( ;; load-file "~/.emacs.d/ext/xah-fk-org.el") ;; ) #+end_src * Avy Avy is a quick jump-to-place package. I use it in a very basic way. #+begin_src emacs-lisp ;; (use-package avy ;; :ensure t) ;; :after xah-fly-keys ;; :config ;; (define-key xah-fly-command-map (kbd "-") 'avy-goto-char-timer) ;; ) #+end_src * VI keys #+begin_src emacs-lisp (use-package evil :ensure t :init (setq evil-want-keybinding nil) (setq evil-want-integration t) :config (evil-mode 1)) (use-package general :ensure t :config (general-evil-setup)) (elpaca-wait) #+end_src #+begin_src emacs-lisp (use-package fzf :config (setq fzf/args "-x --color bw --print-query --margin=1,0 --no-hscroll" fzf/executable "fzf" fzf/git-grep-args "-i --line-number %s" ;; command used for `fzf-grep-*` functions ;; example usage for ripgrep: ;; fzf/grep-command "rg --no-heading -nH" fzf/grep-command "grep -nrH" ;; If nil, the fzf buffer will appear at the top of the window fzf/position-bottom t fzf/window-height 15)) #+end_src #+begin_src emacs-lisp (use-package evil-collection :ensure t :after evil :config (evil-collection-init '(eww emms pass calendar dired ibuffer elfeed bookmark company flycheck notmuch eshell helpful comint magit forge view gnus outline))) #+end_src #+begin_src emacs-lisp (general-create-definer my-leader-def :keymaps 'override :prefix "SPC" :states '(normal motion emacs)) ;; Git (my-leader-def "g" 'magit) ;; Navigation (my-leader-def "io" 'consult-bookmark) (my-leader-def "ib" 'bookmark-set) (my-leader-def "if" 'fzf-git-files) (my-leader-def "ig" 'fzf-grep-dwim-with-narrowing) ;; (define-key xah-fly-command-map (kbd "SPC i o") 'consult-bookmark) ;; (define-key xah-fly-command-map (kbd "SPC i f") 'consult-find) ;; (define-key xah-fly-command-map (kbd "SPC i F") 'find-file) ;; (define-key xah-fly-command-map (kbd "SPC i g") 'consult-ripgrep) ;; Email (my-leader-def "mm" 'notmuch) #+end_src #+begin_src emacs-lisp (general-define-key :keymaps 'override "C-h" 'evil-window-left "C-l" 'evil-window-right "C-k" 'evil-window-up "C-j" 'evil-window-down "C-x h" 'previous-buffer "C-x l" 'next-buffer) (general-define-key :keymaps 'evil-window-map "x" 'kill-buffer-and-window "d" 'kill-current-buffer) #+end_src