From 8ca3cef40d36e08e55cec572fe5636a438b98695 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Fri, 27 Nov 2015 19:09:27 +0000 Subject: [PATCH] Add highlight-symbol-mode --- modules/siren-global-keybindings.el | 4 ---- modules/siren-highlight-symbol.el | 16 ++++++++++++++++ modules/siren-programming.el | 2 ++ 3 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 modules/siren-highlight-symbol.el diff --git a/modules/siren-global-keybindings.el b/modules/siren-global-keybindings.el index 85a20b8..c940b49 100644 --- a/modules/siren-global-keybindings.el +++ b/modules/siren-global-keybindings.el @@ -16,10 +16,6 @@ ;; Duplicate line (via siren-helpers.el) (global-set-key (kbd "C-x C-d") 'duplicate-current-line-or-region) -;; Switch to next/previous buffer -(global-set-key (kbd "C-c C-n") 'switch-to-next-buffer) -(global-set-key (kbd "C-c C-p") 'switch-to-prev-buffer) - ;; Window switching (via siren-helpers.el). (global-set-key (kbd "C-x i") 'other-window-reverse) (global-set-key (kbd "C-x C-o") 'other-window) diff --git a/modules/siren-highlight-symbol.el b/modules/siren-highlight-symbol.el new file mode 100644 index 0000000..1d08771 --- /dev/null +++ b/modules/siren-highlight-symbol.el @@ -0,0 +1,16 @@ +;; +;; highlight-symbol +;; + +(siren-require-packages '(highlight-symbol)) + +(require 'highlight-symbol) + +(setq highlight-symbol-highlight-single-occurrence 'nil) +(setq highlight-symbol-idle-delay 0.5) + +(global-set-key (kbd "C-c C-p") 'highlight-symbol-prev) +(global-set-key (kbd "C-c C-n") 'highlight-symbol-next) + + +(provide 'siren-highlight-symbol) diff --git a/modules/siren-programming.el b/modules/siren-programming.el index e37942a..291c1d4 100644 --- a/modules/siren-programming.el +++ b/modules/siren-programming.el @@ -6,6 +6,7 @@ (require 'siren-flycheck) (require 'siren-smartparens) (require 'siren-highlight-indentation) +(require 'siren-highlight-symbol) (defun siren-prog-mode-defaults () "Default coding hook, useful with any programming language." @@ -14,6 +15,7 @@ (flyspell-prog-mode) (fci-mode) (smartparens-mode +1) + (highlight-symbol-mode) (setq whitespace-action (quote (auto-cleanup))) (visual-line-mode +1) (whitespace-mode +1))