;;; この前にmigemoの設定が必要 (require 'helm-migemo) ;;; この修正が必要 (eval-after-load "helm-migemo" '(defun helm-compile-source--candidates-in-buffer (source) (helm-aif (assoc 'candidates-in-buffer source) (append source `((candidates . ,(or (cdr it) (lambda () ;; Do not use `source' because other plugins ;; (such as helm-migemo) may change it (helm-candidates-in-buffer (helm-get-current-source))))) (volatile) (match identity))) source))) (require 'helm-swoop) ;;; isearchからの連携を考えるとC-r/C-sにも割り当て推奨 (define-key helm-swoop-map (kbd "C-r") 'helm-previous-line) (define-key helm-swoop-map (kbd "C-s") 'helm-next-line) ;;; 検索結果をcycleしない、お好みで (setq helm-swoop-move-to-line-cycle nil) (cl-defun helm-swoop-nomigemo (&key $query ($multiline current-prefix-arg)) "シンボル検索用Migemo無効版helm-swoop" (interactive) (let ((helm-swoop-pre-input-function (lambda () (format "\\_<%s\\_> " (thing-at-point 'symbol))))) (helm-swoop :$source (delete '(migemo) (copy-sequence (helm-c-source-swoop))) :$query $query :$multiline $multiline))) ;;; C-M-:に割り当て (global-set-key (kbd "C-M-:") 'helm-swoop-nomigemo) ;;; [2014-11-25 Tue] (when (featurep 'helm-anything) (defadvice helm-resume (around helm-swoop-resume activate) "helm-anything-resumeで復元できないのでその場合に限定して無効化" ad-do-it)) ;;; ace-isearch (global-ace-isearch-mode 1) ;;; [2015-03-23 Mon]C-u C-s / C-u C-u C-s (defun isearch-forward-or-helm-swoop (use-helm-swoop) (interactive "p") (let (current-prefix-arg (helm-swoop-pre-input-function 'ignore)) (call-interactively (case use-helm-swoop (1 'isearch-forward) (4 'helm-swoop) (16 'helm-swoop-nomigemo))))) (global-set-key (kbd "C-s") 'isearch-forward-or-helm-swoop)