Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (GNUEmacs
- ;; "identical token highlighting" commands
- (when (try-require 'highlight)
- (defface hlt-1 '((t (:background "#FFFFA0"))) nil)
- (defface hlt-2 '((t (:background "#A0FFA0"))) nil)
- (defface hlt-3 '((t (:background "#A0FFFF"))) nil)
- (defface hlt-4 '((t (:background "#FFA0FF"))) nil)
- (defface hlt-5 '((t (:background "#FFA0A0"))) nil)
- (defface hlt-6 '((t (:background "#FFFFA0"))) nil)
- (defface hlt-7 '((t (:background "#A0FFA0"))) nil)
- (defface hlt-8 '((t (:background "#A0FFFF"))) nil)
- (defface hlt-9 '((t (:background "#FFA0FF"))) nil)
- (defface hlt-10 '((t (:background "#FFA0A0"))) nil)
- (global-set-key (kbd "C-S-p") 'hlt-previous-highlight)
- (global-set-key (kbd "C-S-n") 'hlt-next-highlight)
- (defun hlt-highlight-current-word ()
- (interactive)
- (let ((var_name (current-word t)))
- (when var_name
- (save-excursion
- (hlt-highlight-regexp-region
- (point-min)
- (point-max)
- (regexp-quote var_name))))))
- ;; emulation of Vim's `*' search
- (global-set-key (kbd "C-*") 'hlt-highlight-current-word)
- ))
- ;; ;; bind the hi-lock commands to more finger-friendly sequences
- ;; (define-key hi-lock-map (kbd "C-z i") 'hi-lock-find-patterns)
- ;; (define-key hi-lock-map (kbd "C-z p") 'highlight-phrase)
- ;; (define-key hi-lock-map (kbd "C-z r") 'unhighlight-regexp)
- ;; (define-key hi-lock-map (kbd "C-z h") 'highlight-regexp)
- ;; (define-key hi-lock-map (kbd "C-z C-h") 'highlight-lines-matching-regexp)
- ;; (define-key hi-lock-map (kbd "C-z b") 'hi-lock-write-interactive-patterns)
- ;; ;; Highlight based on regexps
- ;; (global-set-key [M-f1] 'highlight-regexp)
- ;; (global-set-key [M-f2] 'highlight-lines-matching-regexp)
- ;; (global-set-key [M-f3] 'hi-lock-mode)
- ;; (global-set-key [M-f4] 'hi-lock-write-interactive-patterns)
- ;; ;; highlight current symbol
- ;; (when (try-require 'light-symbol)
- ;; (light-symbol-mode))
- ;; highlight current symbol
- (setq highlight-symbol-idle-delay 0.5)
- (when (try-require 'highlight-symbol)
- (highlight-symbol-mode))
Advertisement
Add Comment
Please, Sign In to add comment