From 56b4341e5dbef3d05bc3abc6684ce6fb974822ec Mon Sep 17 00:00:00 2001 From: Marc Pohling Date: Thu, 3 May 2018 21:13:45 +0200 Subject: [PATCH] added general for keymaps --- config.org | 67 +++++++++++++++++++++++++++++++++--------------------- 1 file changed, 41 insertions(+), 26 deletions(-) diff --git a/config.org b/config.org index 98100db..7c9cedb 100644 --- a/config.org +++ b/config.org @@ -235,6 +235,21 @@ Also auto refresh dired, but be quiet about it. [[http://whattheemacsd.com/sane- #+end_src +* Pandoc + Convert between formats, like from org to html. + Pandoc needs to be installed on the system + #+BEGIN_SRC shell +sudo apt install pandoc + #+END_SRC + + Pandoc-mode is a minor mode to interact with pandoc + #+BEGIN_SRC emacs-lisp +(use-package pandoc-mode + :ensure t + :init + (add-hook 'markdown-mode-hook 'pandoc-mode)) + #+END_SRC + * Org Mode ** Installation Although org mode ships with Emacs, the latest version can be installed externally. The configuration here follows the [[http://orgmode.org/elpa.html][Org mode ELPA Installation instructions.]] @@ -1427,34 +1442,34 @@ _v_ verify setup _f_ check _s_ select * Custom key mappings -** Escape stuff - Standard is C-g to exit. But with the coming introduction of evil, ESC should be the default key for escaping stuff. + I just use general.el to define keys and keymaps. - #+BEGIN_SRC emacs-lisp -(defun minibuffer-keyboard-quit () - "Abort recursive edit. -In Delete Selection mode, if the mark is active, just deactivate it; -then it takes a second \\[keyboard-quit] to abort the minibuffer." - (interactive) - (if (and delete-selection-mode transient-mark-mode mark-active) - (setq deactivate-mark t) - (when (get-buffer "*Completions*") (delete-windows-on "*Completions*")) - (abort-recursive-edit))) -(with-eval-after-load 'evil-maps - (define-key evil-normal-state-map [escape] 'keyboard-quit) - (define-key evil-visual-state-map [escape] 'keyboard-quit)) -;(with-eval-after-load 'swiper-map -; (define-key ivy-minibuffer-map [escape] 'keyboard-quit) -; (define-key swiper-map [escape] 'keyboard-quit) -;) -(define-key minibuffer-local-map [escape] 'minibuffer-keyboard-quit) -(define-key minibuffer-local-ns-map [escape] 'minibuffer-keyboard-quit) -(define-key minibuffer-local-completion-map [escape] 'minibuffer-keyboard-quit) -(define-key minibuffer-local-must-match-map [escape] 'minibuffer-keyboard-quit) -(define-key minibuffer-local-isearch-map [escape] 'minibuffer-keyboard-quit) -(global-set-key [escape] 'evil-exit-emacs-state) - #+END_SRC + #+BEGIN_SRC emacs-lisp +(use-package general + :ensure t +) + #+END_SRC + Now some keymaps. + If there is no map defined, it is considered the global key map. + #+BEGIN_SRC emacs-lisp +(general-define-key + :states '(normal visual insert emacs) + :prefix "SPC" + :non-normal-prefix "M-SPC" + "TAB" '(ivy-switch-buffer :which-key "prev buffer") + "SPC" '(counsel-M-x :which-key "M-x")) + #+END_SRC + + A map for org-mode + #+BEGIN_SRC emacs-lisp +(general-define-key + :states '(normal visual insert emacs) + :keymaps 'org-mode-map + :prefix "SPC" + :non-normal-prefix "M-SPC" + "t" '(counsel-org-tag :which-key "org-tag")) + #+END_SRC * Quality of Life ** Default Window Size #+BEGIN_SRC emacs-lisp