Commits

Anonymous committed 2475950

+ Updated smartparens.el configuration

Comments (0)

Files changed (2)

files/smartparens.el

 
 ;;; add new pairs
 (sp-add-pair "*" "*")
+(sp-add-pair "$" "$")
 
 ;;; global
 (sp-add-ban-insert-pair-in-string "'")
 
+;; you can also use the `sp-with-tag' macro. It will automatically add
+;; the tag to each function. Use this only with functions where the
+;; first argument is the opening pair! Here, we want to disable ' pair
+;; in a bunch of text modes
+(sp-with-tag "'"
+             (sp-add-local-ban-insert-pair 'markdown-mode)
+             (sp-add-local-ban-insert-pair 'tex-mode)
+             (sp-add-local-ban-insert-pair 'latex-mode)
+             (sp-add-local-ban-insert-pair 'text-mode)
+             (sp-add-local-ban-insert-pair 'log-edit-mode))
+
+;; now, we could've also done just this:
+;; (sp-add-local-ban-insert-pair "'"
+;;                               '(markdown-mode
+;;                                 tex-mode
+;;                                 latex-mode
+;;                                 text-mode
+;;                                 log-edit-mode))
+;; but I wanted to show you how to use the sp-with-tag macro :)
+
 ;;; emacs-lisp-mode
 (sp-add-local-ban-insert-pair "'" 'emacs-lisp-mode)
+(sp-add-local-ban-insert-pair "'" 'inferior-emacs-lisp-mode)
 (sp-add-local-ban-insert-pair-in-code "`" 'emacs-lisp-mode)
+(sp-add-local-ban-insert-pair-in-code "`" 'inferior-emacs-lisp-mode)
 
-;; you can also use the (sp-with) macro. It will automatically add the
+;;; markdown-mode
+;; you can also use the `sp-with' macro. It will automatically add the
 ;; mode to the end of each call. How cool is that!
 (sp-with 'markdown-mode
-         (sp-add-local-pair '("`" . "`"))
-         (sp-add-local-ban-insert-pair "'")
+         (sp-add-local-pair "`" "`")
          ;; this also disables '*' in all other modes
          (sp-add-local-allow-insert-pair "*"))
+
+;;; tex-mode latex-mode
+(sp-with '(tex-mode latex-mode) ;; yes, this works with lists too!
+         (sp-add-local-allow-insert-pair "$"))
  '(ls-lisp-dirs-first t)
  '(menu-bar-mode nil)
  '(show-paren-mode t)
+ '(sp-ignore-modes-list (quote (calc-mode dired-mode ibuffer-mode minibuffer-inactive-mode sr-mode)))
  '(sr-attributes-display-mask (quote (nil nil nil nil t t t)))
  '(sr-listing-switches "-alh")
  '(sr-popviewer-enabled nil)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.