mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2025-12-06 09:07:21 +01:00
chore: improve electric-pair-mode in Emacs
This commit is contained in:
parent
ab4c219ab1
commit
fac5468ced
3 changed files with 157 additions and 147 deletions
|
|
@ -7859,102 +7859,104 @@ I also define some keybinds to some combinations directly. Those are used mostly
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
|
|
||||||
;; Make ESC quit prompts
|
;; Make ESC quit prompts
|
||||||
(global-set-key (kbd "<escape>") 'keyboard-escape-quit)
|
(global-set-key (kbd "<escape>") 'keyboard-escape-quit)
|
||||||
|
|
||||||
;; Set up general keybindings
|
;; Set up general keybindings
|
||||||
(use-package general
|
(use-package general
|
||||||
:config
|
:config
|
||||||
(general-create-definer swarsel/leader-keys
|
(general-create-definer swarsel/leader-keys
|
||||||
:keymaps '(normal insert visual emacs)
|
:keymaps '(normal insert visual emacs)
|
||||||
:prefix "SPC"
|
:prefix "SPC"
|
||||||
:global-prefix "C-SPC")
|
:global-prefix "C-SPC")
|
||||||
|
|
||||||
(swarsel/leader-keys
|
(swarsel/leader-keys
|
||||||
"e" '(:ignore e :which-key "evil")
|
"e" '(:ignore e :which-key "evil")
|
||||||
"eo" '(evil-jump-backward :which-key "cursor jump backwards")
|
"eo" '(evil-jump-backward :which-key "cursor jump backwards")
|
||||||
"eO" '(evil-jump-forward :which-key "cursor jump forwards")
|
"eO" '(evil-jump-forward :which-key "cursor jump forwards")
|
||||||
"t" '(:ignore t :which-key "toggles")
|
"t" '(:ignore t :which-key "toggles")
|
||||||
"ts" '(hydra-text-scale/body :which-key "scale text")
|
"ts" '(hydra-text-scale/body :which-key "scale text")
|
||||||
"te" '(swarsel/toggle-evil-state :which-key "emacs/evil")
|
"te" '(swarsel/toggle-evil-state :which-key "emacs/evil")
|
||||||
"tl" '(display-line-numbers-mode :which-key "line numbers")
|
"tl" '(display-line-numbers-mode :which-key "line numbers")
|
||||||
"tp" '(evil-cleverparens-mode :wk "cleverparens")
|
"tp" '(evil-cleverparens-mode :wk "cleverparens")
|
||||||
"to" '(olivetti-mode :wk "olivetti")
|
"to" '(olivetti-mode :wk "olivetti")
|
||||||
"td" '(darkroom-tentative-mode :wk "darkroom")
|
"td" '(darkroom-tentative-mode :wk "darkroom")
|
||||||
"tw" '((lambda () (interactive) (toggle-truncate-lines)) :which-key "line wrapping")
|
"tw" '((lambda () (interactive) (toggle-truncate-lines)) :which-key "line wrapping")
|
||||||
"m" '(:ignore m :which-key "modes/programs")
|
"m" '(:ignore m :which-key "modes/programs")
|
||||||
"mm" '((lambda () (interactive) (mu4e)) :which-key "mu4e")
|
"mm" '((lambda () (interactive) (mu4e)) :which-key "mu4e")
|
||||||
"mg" '((lambda () (interactive) (magit-list-repositories)) :which-key "magit-list-repos")
|
"mg" '((lambda () (interactive) (magit-list-repositories)) :which-key "magit-list-repos")
|
||||||
"mc" '((lambda () (interactive) (swarsel/open-calendar)) :which-key "calendar")
|
"mc" '((lambda () (interactive) (swarsel/open-calendar)) :which-key "calendar")
|
||||||
"mp" '(popper-toggle :which-key "popper")
|
"mp" '(popper-toggle :which-key "popper")
|
||||||
"md" '(dirvish :which-key "dirvish")
|
"md" '(dirvish :which-key "dirvish")
|
||||||
"o" '(:ignore o :which-key "org")
|
"o" '(:ignore o :which-key "org")
|
||||||
"op" '((lambda () (interactive) (org-present)) :which-key "org-present")
|
"op" '((lambda () (interactive) (org-present)) :which-key "org-present")
|
||||||
"ob" '((lambda () (interactive) (org-babel-mark-block)) :which-key "Mark whole src-block")
|
"ob" '((lambda () (interactive) (org-babel-mark-block)) :which-key "Mark whole src-block")
|
||||||
"ol" '((lambda () (interactive) (org-insert-link)) :which-key "insert link")
|
"ol" '((lambda () (interactive) (org-insert-link)) :which-key "insert link")
|
||||||
"os" '((lambda () (interactive) (org-store-link)) :which-key "store link")
|
"os" '((lambda () (interactive) (org-store-link)) :which-key "store link")
|
||||||
"od" '((lambda () (interactive) (org-babel-demarcate-block)) :which-key "demarcate (split) src-block")
|
"od" '((lambda () (interactive) (org-babel-demarcate-block)) :which-key "demarcate (split) src-block")
|
||||||
;; "c" '(:ignore c :which-key "capture")
|
;; "c" '(:ignore c :which-key "capture")
|
||||||
;; "cj" '((lambda () (interactive) (org-capture nil "jj")) :which-key "journal")
|
;; "cj" '((lambda () (interactive) (org-capture nil "jj")) :which-key "journal")
|
||||||
;; "cs" '(markdown-download-screenshot :which-key "screenshot")
|
;; "cs" '(markdown-download-screenshot :which-key "screenshot")
|
||||||
"l" '(:ignore l :which-key "links")
|
"l" '(:ignore l :which-key "links")
|
||||||
"lc" '((lambda () (interactive) (progn (find-file swarsel-swarsel-org-filepath) (org-overview) )) :which-key "SwarselSystems.org")
|
"lc" '((lambda () (interactive) (progn (find-file swarsel-swarsel-org-filepath) (org-overview) )) :which-key "SwarselSystems.org")
|
||||||
"le" '((lambda () (interactive) (progn (find-file swarsel-swarsel-org-filepath) (goto-char (org-find-exact-headline-in-buffer "Emacs") ) (org-overview) (org-cycle) )) :which-key "Emacs.org")
|
"le" '((lambda () (interactive) (progn (find-file swarsel-swarsel-org-filepath) (goto-char (org-find-exact-headline-in-buffer "Emacs") ) (org-overview) (org-cycle) )) :which-key "Emacs.org")
|
||||||
"ln" '((lambda () (interactive) (progn (find-file swarsel-swarsel-org-filepath) (goto-char (org-find-exact-headline-in-buffer "System") ) (org-overview) (org-cycle))) :which-key "Nixos.org")
|
"ln" '((lambda () (interactive) (progn (find-file swarsel-swarsel-org-filepath) (goto-char (org-find-exact-headline-in-buffer "System") ) (org-overview) (org-cycle))) :which-key "Nixos.org")
|
||||||
"ls" '((lambda () (interactive) (find-file "/smb:Swarsel@192.168.1.3:")) :which-key "Server")
|
"ls" '((lambda () (interactive) (find-file "/smb:Swarsel@192.168.1.3:")) :which-key "Server")
|
||||||
"lo" '(dired swarsel-obsidian-vault-directory :which-key "obsidian")
|
"lo" '(dired swarsel-obsidian-vault-directory :which-key "obsidian")
|
||||||
;; "la" '((lambda () (interactive) (find-file swarsel-org-anki-filepath)) :which-key "anki")
|
;; "la" '((lambda () (interactive) (find-file swarsel-org-anki-filepath)) :which-key "anki")
|
||||||
;; "ln" '((lambda () (interactive) (find-file swarsel-nix-org-filepath)) :which-key "Nix.org")
|
;; "ln" '((lambda () (interactive) (find-file swarsel-nix-org-filepath)) :which-key "Nix.org")
|
||||||
"lp" '((lambda () (interactive) (projectile-switch-project)) :which-key "switch project")
|
"lp" '((lambda () (interactive) (projectile-switch-project)) :which-key "switch project")
|
||||||
"lg" '((lambda () (interactive) (magit-list-repositories)) :which-key "list git repos")
|
"lg" '((lambda () (interactive) (magit-list-repositories)) :which-key "list git repos")
|
||||||
;; "a" '(:ignore a :which-key "anki")
|
;; "a" '(:ignore a :which-key "anki")
|
||||||
;; "ap" '(anki-editor-push-tree :which-key "push new cards")
|
;; "ap" '(anki-editor-push-tree :which-key "push new cards")
|
||||||
;; "an" '((lambda () (interactive) (org-capture nil "a")) :which-key "new card")
|
;; "an" '((lambda () (interactive) (org-capture nil "a")) :which-key "new card")
|
||||||
;; "as" '(swarsel-anki-set-deck-and-notetype :which-key "change deck and notetype")
|
;; "as" '(swarsel-anki-set-deck-and-notetype :which-key "change deck and notetype")
|
||||||
"h" '(:ignore h :which-key "help")
|
"h" '(:ignore h :which-key "help")
|
||||||
"hy" '(yas-describe-tables :which-key "yas tables")
|
"hy" '(yas-describe-tables :which-key "yas tables")
|
||||||
"hb" '(embark-bindings :which-key "current key bindings")
|
"hb" '(embark-bindings :which-key "current key bindings")
|
||||||
"h" '(:ignore t :which-key "describe")
|
"h" '(:ignore t :which-key "describe")
|
||||||
"he" 'view-echo-area-messages
|
"he" 'view-echo-area-messages
|
||||||
"hf" 'describe-function
|
"hf" 'describe-function
|
||||||
"hF" 'describe-face
|
"hF" 'describe-face
|
||||||
"hl" '(view-lossage :which-key "show command keypresses")
|
"hl" '(view-lossage :which-key "show command keypresses")
|
||||||
"hL" 'find-library
|
"hL" 'find-library
|
||||||
"hm" 'describe-mode
|
"hm" 'describe-mode
|
||||||
"ho" 'describe-symbol
|
"ho" 'describe-symbol
|
||||||
"hk" 'describe-key
|
"hk" 'describe-key
|
||||||
"hK" 'describe-keymap
|
"hK" 'describe-keymap
|
||||||
"hp" 'describe-package
|
"hp" 'describe-package
|
||||||
"hv" 'describe-variable
|
"hv" 'describe-variable
|
||||||
"hd" 'devdocs-lookup
|
"hd" 'devdocs-lookup
|
||||||
"w" '(:ignore t :which-key "window")
|
"w" '(:ignore t :which-key "window")
|
||||||
"wl" 'windmove-right
|
"wl" 'windmove-right
|
||||||
"wh" 'windmove-left
|
"wh" 'windmove-left
|
||||||
"wk" 'windmove-up
|
"wk" 'windmove-up
|
||||||
"wj" 'windmove-down
|
"wj" 'windmove-down
|
||||||
"wr" 'winner-redo
|
"wr" 'winner-redo
|
||||||
"wd" 'delete-window
|
"wd" 'delete-window
|
||||||
"w=" 'balance-windows-area
|
"w=" 'balance-windows-area
|
||||||
"wD" 'kill-buffer-and-window
|
"wD" 'kill-buffer-and-window
|
||||||
"wu" 'winner-undo
|
"wu" 'winner-undo
|
||||||
"wr" 'winner-redo
|
"wr" 'winner-redo
|
||||||
"w/" 'evil-window-vsplit
|
"w/" 'evil-window-vsplit
|
||||||
"w-" 'evil-window-split
|
"w-" 'evil-window-split
|
||||||
"wm" '(delete-other-windows :wk "maximize")
|
"wm" '(delete-other-windows :wk "maximize")
|
||||||
))
|
"<right>" 'up-list
|
||||||
|
"<left>" 'down-list
|
||||||
|
))
|
||||||
|
|
||||||
;; General often used hotkeys
|
;; General often used hotkeys
|
||||||
(general-define-key
|
(general-define-key
|
||||||
"C-M-a" (lambda () (interactive) (org-capture nil "a")) ; make new anki card
|
"C-M-a" (lambda () (interactive) (org-capture nil "a")) ; make new anki card
|
||||||
;; "C-M-d" 'swarsel-obsidian-daily ; open daily obsidian file and create if not exist
|
;; "C-M-d" 'swarsel-obsidian-daily ; open daily obsidian file and create if not exist
|
||||||
;; "C-M-S" 'swarsel-anki-set-deck-and-notetype ; switch deck and notetype for new anki cards
|
;; "C-M-S" 'swarsel-anki-set-deck-and-notetype ; switch deck and notetype for new anki cards
|
||||||
;; "C-M-s" 'markdown-download-screenshot ; wrapper for org-download-screenshot
|
;; "C-M-s" 'markdown-download-screenshot ; wrapper for org-download-screenshot
|
||||||
"C-c d" 'crux-duplicate-current-line-or-region
|
"C-c d" 'crux-duplicate-current-line-or-region
|
||||||
"C-c D" 'crux-duplicate-and-comment-current-line-or-region
|
"C-c D" 'crux-duplicate-and-comment-current-line-or-region
|
||||||
"<DUMMY-m>" 'swarsel/last-buffer
|
"<DUMMY-m>" 'swarsel/last-buffer
|
||||||
"M-\\" 'indent-region
|
"M-\\" 'indent-region
|
||||||
"C-<f9>" 'my-python-shell-run
|
"C-<f9>" 'my-python-shell-run
|
||||||
)
|
)
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
*** Directory setup / File structure
|
*** Directory setup / File structure
|
||||||
|
|
@ -9558,27 +9560,29 @@ I am not completely sure on electric-pair-mode yet, sometimes it is very helpful
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
|
|
||||||
(use-package rainbow-delimiters
|
(use-package rainbow-delimiters
|
||||||
:hook (prog-mode . rainbow-delimiters-mode))
|
:hook (prog-mode . rainbow-delimiters-mode))
|
||||||
|
|
||||||
(use-package highlight-parentheses
|
(use-package highlight-parentheses
|
||||||
:config
|
:config
|
||||||
(setq highlight-parentheses-colors '("black" "white" "black" "black" "black" "black" "black"))
|
(setq highlight-parentheses-colors '("black" "white" "black" "black" "black" "black" "black"))
|
||||||
(setq highlight-parentheses-background-colors '("magenta" "blue" "cyan" "green" "yellow" "orange" "red"))
|
(setq highlight-parentheses-background-colors '("magenta" "blue" "cyan" "green" "yellow" "orange" "red"))
|
||||||
(global-highlight-parentheses-mode t))
|
(global-highlight-parentheses-mode t))
|
||||||
|
|
||||||
(electric-pair-mode 1)
|
(electric-pair-mode 1)
|
||||||
(setq electric-pair-preserve-balance nil)
|
(setq electric-pair-preserve-balance t)
|
||||||
;; don't try to be overly smart
|
(setq electric-pair-skip-self nil)
|
||||||
(setq electric-pair-delete-adjacent-pairs nil)
|
(setq electric-pair-delete-adjacent-pairs t)
|
||||||
;; don't skip newline when auto-pairing parenthesis
|
;; don't skip newline when auto-pairing parenthesis
|
||||||
(setq electric-pair-skip-whitespace-chars '(9 32))
|
(setq electric-pair-skip-whitespace-chars '(9 32))
|
||||||
|
|
||||||
;; in org-mode buffers, do not pair < and > in order not to interfere with org-tempo
|
;; in org-mode buffers, do not pair < and > in order not to interfere with org-tempo
|
||||||
(add-hook 'org-mode-hook (lambda ()
|
(add-hook 'org-mode-hook (lambda ()
|
||||||
(setq-local electric-pair-inhibit-predicate
|
(setq-local electric-pair-inhibit-predicate
|
||||||
`(lambda (c)
|
`(lambda (c)
|
||||||
(if (char-equal c ?<) t (,electric-pair-inhibit-predicate c))))))
|
(if (char-equal c ?<) t (,electric-pair-inhibit-predicate c))))))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
|
|
||||||
46
index.html
46
index.html
|
|
@ -3,7 +3,7 @@
|
||||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||||||
<head>
|
<head>
|
||||||
<!-- 2024-06-28 Fr 00:09 -->
|
<!-- 2024-06-28 Fr 22:14 -->
|
||||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<title>SwarselSystems: NixOS + Emacs Configuration</title>
|
<title>SwarselSystems: NixOS + Emacs Configuration</title>
|
||||||
|
|
@ -369,7 +369,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
<b>This file has 40441 words spanning 10468 lines and was last revised on 2024-06-28 00:09:44 +0200.</b>
|
<b>This file has 40447 words spanning 10472 lines and was last revised on 2024-06-28 22:13:57 +0200.</b>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
@ -419,7 +419,7 @@ This section defines my Emacs configuration. For a while, I considered to use ry
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
My emacs is built using the emacs-overlay nix flake, which builds a bleeding edge emacs on wayland (pgtk) with utilities like treesitter support. By executing the below source block, the current build setting can be updated at any time, and you can see my most up-to-date build options (last updated: 2024-06-28 00:09:44 +0200)
|
My emacs is built using the emacs-overlay nix flake, which builds a bleeding edge emacs on wayland (pgtk) with utilities like treesitter support. By executing the below source block, the current build setting can be updated at any time, and you can see my most up-to-date build options (last updated: 2024-06-28 22:13:57 +0200)
|
||||||
</p></li>
|
</p></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
@ -9687,6 +9687,8 @@ I also define some keybinds to some combinations directly. Those are used mostly
|
||||||
"w/" 'evil-window-vsplit
|
"w/" 'evil-window-vsplit
|
||||||
"w-" 'evil-window-split
|
"w-" 'evil-window-split
|
||||||
"wm" '(delete-other-windows :wk "maximize")
|
"wm" '(delete-other-windows :wk "maximize")
|
||||||
|
"<right>" 'up-list
|
||||||
|
"<left>" 'down-list
|
||||||
))
|
))
|
||||||
|
|
||||||
;; General often used hotkeys
|
;; General often used hotkeys
|
||||||
|
|
@ -11521,27 +11523,29 @@ I am not completely sure on electric-pair-mode yet, sometimes it is very helpful
|
||||||
|
|
||||||
<div class="org-src-container">
|
<div class="org-src-container">
|
||||||
<pre class="src src-emacs-lisp">
|
<pre class="src src-emacs-lisp">
|
||||||
(use-package rainbow-delimiters
|
(use-package rainbow-delimiters
|
||||||
:hook (prog-mode . rainbow-delimiters-mode))
|
:hook (prog-mode . rainbow-delimiters-mode))
|
||||||
|
|
||||||
(use-package highlight-parentheses
|
(use-package highlight-parentheses
|
||||||
:config
|
:config
|
||||||
(setq highlight-parentheses-colors '("black" "white" "black" "black" "black" "black" "black"))
|
(setq highlight-parentheses-colors '("black" "white" "black" "black" "black" "black" "black"))
|
||||||
(setq highlight-parentheses-background-colors '("magenta" "blue" "cyan" "green" "yellow" "orange" "red"))
|
(setq highlight-parentheses-background-colors '("magenta" "blue" "cyan" "green" "yellow" "orange" "red"))
|
||||||
(global-highlight-parentheses-mode t))
|
(global-highlight-parentheses-mode t))
|
||||||
|
|
||||||
(electric-pair-mode 1)
|
(electric-pair-mode 1)
|
||||||
(setq electric-pair-preserve-balance nil)
|
(setq electric-pair-preserve-balance t)
|
||||||
;; don't try to be overly smart
|
(setq electric-pair-skip-self nil)
|
||||||
(setq electric-pair-delete-adjacent-pairs nil)
|
(setq electric-pair-delete-adjacent-pairs t)
|
||||||
;; don't skip newline when auto-pairing parenthesis
|
;; don't skip newline when auto-pairing parenthesis
|
||||||
(setq electric-pair-skip-whitespace-chars '(9 32))
|
(setq electric-pair-skip-whitespace-chars '(9 32))
|
||||||
|
|
||||||
;; in org-mode buffers, do not pair < and > in order not to interfere with org-tempo
|
;; in org-mode buffers, do not pair < and > in order not to interfere with org-tempo
|
||||||
(add-hook 'org-mode-hook (lambda ()
|
(add-hook 'org-mode-hook (lambda ()
|
||||||
(setq-local electric-pair-inhibit-predicate
|
(setq-local electric-pair-inhibit-predicate
|
||||||
`(lambda (c)
|
`(lambda (c)
|
||||||
(if (char-equal c ?<) t (,electric-pair-inhibit-predicate c))))))
|
(if (char-equal c ?<) t (,electric-pair-inhibit-predicate c))))))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -12546,7 +12550,7 @@ This sets up the <code>dashboard</code>, which is really quite useless. But, it
|
||||||
</div>
|
</div>
|
||||||
<div id="postamble" class="status">
|
<div id="postamble" class="status">
|
||||||
<p class="author">Author: Leon Schwarzäugl</p>
|
<p class="author">Author: Leon Schwarzäugl</p>
|
||||||
<p class="date">Created: 2024-06-28 Fr 00:09</p>
|
<p class="date">Created: 2024-06-28 Fr 22:14</p>
|
||||||
<p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p>
|
<p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
||||||
|
|
@ -329,6 +329,8 @@ create a new one."
|
||||||
"w/" 'evil-window-vsplit
|
"w/" 'evil-window-vsplit
|
||||||
"w-" 'evil-window-split
|
"w-" 'evil-window-split
|
||||||
"wm" '(delete-other-windows :wk "maximize")
|
"wm" '(delete-other-windows :wk "maximize")
|
||||||
|
"<right>" 'up-list
|
||||||
|
"<left>" 'down-list
|
||||||
))
|
))
|
||||||
|
|
||||||
;; General often used hotkeys
|
;; General often used hotkeys
|
||||||
|
|
@ -1174,26 +1176,26 @@ create a new one."
|
||||||
:init (setq git-timemachine-show-minibuffer-details t))
|
:init (setq git-timemachine-show-minibuffer-details t))
|
||||||
|
|
||||||
(use-package rainbow-delimiters
|
(use-package rainbow-delimiters
|
||||||
:hook (prog-mode . rainbow-delimiters-mode))
|
:hook (prog-mode . rainbow-delimiters-mode))
|
||||||
|
|
||||||
(use-package highlight-parentheses
|
(use-package highlight-parentheses
|
||||||
:config
|
:config
|
||||||
(setq highlight-parentheses-colors '("black" "white" "black" "black" "black" "black" "black"))
|
(setq highlight-parentheses-colors '("black" "white" "black" "black" "black" "black" "black"))
|
||||||
(setq highlight-parentheses-background-colors '("magenta" "blue" "cyan" "green" "yellow" "orange" "red"))
|
(setq highlight-parentheses-background-colors '("magenta" "blue" "cyan" "green" "yellow" "orange" "red"))
|
||||||
(global-highlight-parentheses-mode t))
|
(global-highlight-parentheses-mode t))
|
||||||
|
|
||||||
(electric-pair-mode 1)
|
(electric-pair-mode 1)
|
||||||
(setq electric-pair-preserve-balance nil)
|
(setq electric-pair-preserve-balance t)
|
||||||
;; don't try to be overly smart
|
(setq electric-pair-skip-self nil)
|
||||||
(setq electric-pair-delete-adjacent-pairs nil)
|
(setq electric-pair-delete-adjacent-pairs t)
|
||||||
;; don't skip newline when auto-pairing parenthesis
|
;; don't skip newline when auto-pairing parenthesis
|
||||||
(setq electric-pair-skip-whitespace-chars '(9 32))
|
(setq electric-pair-skip-whitespace-chars '(9 32))
|
||||||
|
|
||||||
;; in org-mode buffers, do not pair < and > in order not to interfere with org-tempo
|
;; in org-mode buffers, do not pair < and > in order not to interfere with org-tempo
|
||||||
(add-hook 'org-mode-hook (lambda ()
|
(add-hook 'org-mode-hook (lambda ()
|
||||||
(setq-local electric-pair-inhibit-predicate
|
(setq-local electric-pair-inhibit-predicate
|
||||||
`(lambda (c)
|
`(lambda (c)
|
||||||
(if (char-equal c ?<) t (,electric-pair-inhibit-predicate c))))))
|
(if (char-equal c ?<) t (,electric-pair-inhibit-predicate c))))))
|
||||||
|
|
||||||
(use-package rainbow-mode
|
(use-package rainbow-mode
|
||||||
:config (rainbow-mode))
|
:config (rainbow-mode))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue