Refactor smartparens default rules
Move them to config/default, but move single-lang-specific ones to their respective modules.
This commit is contained in:
parent
1d7782aea3
commit
8a4f15b01c
5 changed files with 25 additions and 18 deletions
|
@ -44,10 +44,6 @@
|
|||
(sp-local-pair 'ruby-mode "{" "}"
|
||||
:pre-handlers '(:rem sp-ruby-prehandler)
|
||||
:post-handlers '(:rem sp-ruby-posthandler))
|
||||
;; sp's default rules for these modes are obnoxious, so disable them
|
||||
(provide 'smartparens-elixir)
|
||||
(provide 'smartparens-latex)
|
||||
(provide 'smartparens-lua)
|
||||
|
||||
;; Expand {|} => { | }
|
||||
;; Expand {|} => {
|
||||
|
@ -63,6 +59,18 @@
|
|||
(sp-local-pair '(emacs-lisp-mode org-mode markdown-mode gfm-mode)
|
||||
"[" nil :post-handlers '(:rem ("| " "SPC")))
|
||||
|
||||
;; Reasonable default pairs for comments
|
||||
(sp-local-pair (append sp--html-modes '(markdown-mode gfm-mode))
|
||||
"<!--" "-->" :actions '(insert) :post-handlers '(("| " "SPC")))
|
||||
|
||||
(sp-local-pair
|
||||
'(js2-mode typescript-mode rjsx-mode rust-mode
|
||||
c-mode c++-mode objc-mode java-mode php-mode
|
||||
css-mode scss-mode less-css-mode stylus-mode)
|
||||
"/*" "*/"
|
||||
:actions '(insert)
|
||||
:post-handlers '(("| " "SPC") ("|\n*/[i][d-2]" "RET") ("\n* ||\n*/[i][d-2]" "*")))
|
||||
|
||||
;; Highjacks backspace to:
|
||||
;; a) balance spaces inside brackets/parentheses ( | ) -> (|)
|
||||
;; b) delete space-indented `tab-width' steps at a time
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue