Skip to content

Commit

Permalink
Add smartparens insertion hooks for javascript-related major modes
Browse files Browse the repository at this point in the history
  • Loading branch information
jeko2000 committed Jul 29, 2021
1 parent 6089c19 commit b1742c8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions settings/config.org
Original file line number Diff line number Diff line change
Expand Up @@ -1137,9 +1137,11 @@ point reaches the beginning or end of the buffer, stop there."
(sp-pair "(" ")" :wrap "s-(")
(sp-pair "[" "]" :wrap "s-[")
(sp-pair "{" "}" :wrap "s-{")
(sp-local-pair 'prog-mode "{" nil :post-handlers '(("||\n[i]" "RET")))
(sp-local-pair 'typescript-mode "[" nil :post-handlers '(("||\n[i]" "RET")))
(sp-local-pair 'typescript-mode "(" nil :post-handlers '(("||\n[i]" "RET")))
(sp-with-modes
'(java-mode json-mode typescript-mode)
(sp-local-pair "{" nil :post-handlers '(:add ("||\n[i]" "RET")))
(sp-local-pair "[" nil :post-handlers '(:add ("||\n[i]" "RET")))
(sp-local-pair "(" nil :post-handlers '(:add ("||\n[i]" "RET"))))
(add-hook 'smartparens-mode-hook #'show-smartparens-mode)
(add-hook 'prog-mode-hook #'turn-on-smartparens-strict-mode)
;; The following is necessary per https://github.com/Fuco1/smartparens/issues/963
Expand Down

0 comments on commit b1742c8

Please sign in to comment.