[feature] Add highlight-parentheses [#1173]

highlight-parentheses highlights the sexp scope the cursor is in and
3 upper sexp levels. We don't have to actually place the cursor on a
parenthesis just to see where it ends or begins. This package takes of this
issue regardless where we are in the sexp.
This commit is contained in:
Tu Do 2015-04-16 18:15:50 +07:00 committed by syl20bnr
parent 86dae6aba7
commit 8bf70ec3ba
2 changed files with 18 additions and 1 deletions

View File

@ -123,6 +123,10 @@ it reaches the top or bottom of the screen.")
(defvar dotspacemacs-smartparens-strict-mode nil
"If non-nil smartparens-strict-mode will be enabled in programming modes.")
(defvar dotspacemacs-highlight-delimiters 'scope
"Select a scope to highlight delimiters. Possible value is `scope', `all' or `none'.
Default is `scope'")
(defvar dotspacemacs-delete-orphan-packages t
"If non-nil spacemacs will delete any orphan packages, i.e. packages that are
declared in a layer which is not a member of

View File

@ -72,6 +72,7 @@
helm-themes
highlight-indentation
highlight-numbers
highlight-parentheses
hippie-exp
hl-anything
hungry-delete
@ -1697,6 +1698,17 @@ If ARG is non nil then `ag' and `pt' and ignored."
(add-hook 'prog-mode-hook 'highlight-numbers-mode)
(add-hook 'asm-mode-hook (lambda () (highlight-numbers-mode -1))))))
(defun spacemacs/init-highlight-parentheses ()
(use-package highlight-parentheses
:defer t
:init
(progn
(when (eq dotspacemacs-highlight-delimiters 'scope)
(add-hook 'prog-mode-hook #'highlight-parentheses-mode))
(evil-leader/set-key "tCp" 'highlight-parentheses-mode)
;; use green to clearly distinguish the sexp we are in
(setq hl-paren-colors '("Springgreen3" "IndianRed1" "IndianRed3" "IndianRed4")))))
(defun spacemacs/init-hippie-exp ()
(global-set-key (kbd "M-/") 'hippie-expand) ;; replace dabbrev-expand
(setq hippie-expand-try-functions-list
@ -2484,7 +2496,8 @@ It is a string holding:
:init
(progn
(evil-leader/set-key "tCd" 'rainbow-delimiters-mode)
(add-to-hooks 'rainbow-delimiters-mode '(prog-mode-hook)))))
(when (eq dotspacemacs-highlight-delimiters 'all)
(add-to-hooks 'rainbow-delimiters-mode '(prog-mode-hook))))))
(defun spacemacs/init-recentf ()
(use-package recentf