Emacs personal configuration
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

99 行
3.9KB

  1. (require 'helm-config)
  2. (require 'helm-grep)
  3. ;; The default "C-x c" is quite close to "C-x C-c", which quits Emacs.
  4. ;; Changed to "C-c h". Note: We must set "C-c h" globally, because we
  5. ;; cannot change `helm-command-prefix-key' once `helm-config' is loaded.
  6. (global-set-key (kbd "C-c h") 'helm-command-prefix)
  7. (global-unset-key (kbd "C-x c"))
  8. (define-key helm-map (kbd "<tab>") 'helm-execute-persistent-action) ; rebihnd tab to do persistent action
  9. (define-key helm-map (kbd "C-i") 'helm-execute-persistent-action) ; make TAB works in terminal
  10. (define-key helm-map (kbd "C-z") 'helm-select-action) ; list actions using C-z
  11. (define-key helm-grep-mode-map (kbd "<return>") 'helm-grep-mode-jump-other-window)
  12. (define-key helm-grep-mode-map (kbd "n") 'helm-grep-mode-jump-other-window-forward)
  13. (define-key helm-grep-mode-map (kbd "p") 'helm-grep-mode-jump-other-window-backward)
  14. (when (executable-find "curl")
  15. (setq helm-google-suggest-use-curl-p t))
  16. (setq
  17. helm-scroll-amount 4 ; scroll 4 lines other window using M-<next>/M-<prior>
  18. helm-ff-search-library-in-sexp t ; search for library in `require' and `declare-function' sexp.
  19. helm-split-window-in-side-p t ;; open helm buffer inside current window, not occupy whole other window
  20. helm-candidate-number-limit 500 ; limit the number of displayed canidates
  21. helm-ff-file-name-history-use-recentf t
  22. helm-move-to-line-cycle-in-source t ; move to end or beginning of source when reaching top or bottom of source.
  23. helm-buffers-fuzzy-matching t ; fuzzy matching buffer names when non-nil
  24. ; useful in helm-mini that lists buffers
  25. )
  26. (add-to-list 'helm-sources-using-default-as-input 'helm-source-man-pages)
  27. (global-set-key (kbd "M-x") 'helm-M-x)
  28. (global-set-key (kbd "M-y") 'helm-show-kill-ring)
  29. (global-set-key (kbd "C-x b") 'helm-mini)
  30. (global-set-key (kbd "C-x C-f") 'helm-find-files)
  31. (global-set-key (kbd "C-h SPC") 'helm-all-mark-rings)
  32. (global-set-key (kbd "C-c h o") 'helm-occur)
  33. (global-set-key (kbd "C-c h C-c w") 'helm-wikipedia-suggest)
  34. (global-set-key (kbd "C-c h x") 'helm-register)
  35. ;; (global-set-key (kbd "C-x r j") 'jump-to-register)
  36. (define-key 'help-command (kbd "C-f") 'helm-apropos)
  37. (define-key 'help-command (kbd "r") 'helm-info-emacs)
  38. (define-key 'help-command (kbd "C-l") 'helm-locate-library)
  39. ;; use helm to list eshell history
  40. (add-hook 'eshell-mode-hook
  41. #'(lambda ()
  42. (define-key eshell-mode-map (kbd "M-l") 'helm-eshell-history)))
  43. ;;; Save current position to mark ring
  44. (add-hook 'helm-goto-line-before-hook 'helm-save-current-pos-to-mark-ring)
  45. ;; show minibuffer history with Helm
  46. (define-key minibuffer-local-map (kbd "M-p") 'helm-minibuffer-history)
  47. (define-key minibuffer-local-map (kbd "M-n") 'helm-minibuffer-history)
  48. (define-key global-map [remap find-tag] 'helm-etags-select)
  49. (define-key global-map [remap list-buffers] 'helm-buffers-list)
  50. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  51. ;; PACKAGE: helm-swoop ;;
  52. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  53. (require-package 'helm-swoop)
  54. ;; Locate the helm-swoop folder to your path
  55. (require 'helm-swoop)
  56. ;; Change the keybinds to whatever you like :)
  57. (global-set-key (kbd "C-c h o") 'helm-swoop)
  58. (global-set-key (kbd "C-c s") 'helm-multi-swoop-all)
  59. ;; When doing isearch, hand the word over to helm-swoop
  60. (define-key isearch-mode-map (kbd "M-i") 'helm-swoop-from-isearch)
  61. ;; From helm-swoop to helm-multi-swoop-all
  62. (define-key helm-swoop-map (kbd "M-i") 'helm-multi-swoop-all-from-helm-swoop)
  63. ;; Save buffer when helm-multi-swoop-edit complete
  64. (setq helm-multi-swoop-edit-save t)
  65. ;; If this value is t, split window inside the current window
  66. (setq helm-swoop-split-with-multiple-windows t)
  67. ;; Split direcion. 'split-window-vertically or 'split-window-horizontally
  68. (setq helm-swoop-split-direction 'split-window-vertically)
  69. ;; If nil, you can slightly boost invoke speed in exchange for text color
  70. (setq helm-swoop-speed-or-color t)
  71. (helm-mode 1)
  72. (provide 'setup-helm)