0
votes

I have installed smartscan in emacs 24 but the default key binding took over M-n and M-p keys which I need when using emacs shell to go to previous next item in command history.

;; adds VIM like super star * kind of search to emacs with M-n, M-p keys (global-smartscan-mode t) ;; Turn on Smart Scan globally

How can I use configure smartscan to use a different key binding and leave M-n, M-p bindings as they were?

1

1 Answers

0
votes

You're looking for smartscan-map.

(with-eval-after-load "smartscan"
  (define-key smartscan-map (kbd "C-c s M-n") 'smartscan-symbol-go-forward)
  (define-key smartscan-map (kbd "C-c s M-p") 'smartscan-symbol-go-backward)
  (define-key smartscan-map (kbd "C-c s M-'") 'smartscan-symbol-replace))

Alternatively, you can only enable smartscan-mode in prog-mode (which is probably the only modes it's useful in). This is what I do. It doesn't seem to affect eshell or shell, but I only did a quick test as I don't normally use those.

(add-hook 'prog-mode-hook 'smartscan-mode)