Last active
November 2, 2018 17:00
-
-
Save jabberwocky0139/5d80c36897affabcfd115700e7744926 to your computer and use it in GitHub Desktop.
初心者〜初級者のためのEmacs-Helm事始め : 前編 ref: https://qiita.com/jabberwocky0139/items/86df1d3108e147c69e2c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'helm-config) | |
(helm-mode 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'helm) | |
(require 'helm-config) | |
;; The default "C-x c" is quite close to "C-x C-c", which quits Emacs. | |
;; Changed to "C-c h". Note: We must set "C-c h" globally, because we | |
;; cannot change `helm-command-prefix-key' once `helm-config' is loaded. | |
(global-set-key (kbd "C-c h") 'helm-command-prefix) | |
(global-unset-key (kbd "C-x c")) | |
(define-key helm-map (kbd "<tab>") 'helm-execute-persistent-action) ; rebind tab to run persistent action | |
(define-key helm-map (kbd "C-i") 'helm-execute-persistent-action) ; make TAB work in terminal | |
(define-key helm-map (kbd "C-z") 'helm-select-action) ; list actions using C-z | |
(when (executable-find "curl") | |
(setq helm-google-suggest-use-curl-p t)) | |
(setq helm-split-window-in-side-p t ; open helm buffer inside current window, not occupy whole other window | |
helm-move-to-line-cycle-in-source t ; move to end or beginning of source when reaching top or bottom of source. | |
helm-ff-search-library-in-sexp t ; search for library in `require' and `declare-function' sexp. | |
helm-scroll-amount 8 ; scroll 8 lines other window using M-<next>/M-<prior> | |
helm-ff-file-name-history-use-recentf t | |
helm-echo-input-in-header-line t) | |
(defun spacemacs//helm-hide-minibuffer-maybe () | |
"Hide minibuffer in Helm session if we use the header line as input field." | |
(when (with-helm-buffer helm-echo-input-in-header-line) | |
(let ((ov (make-overlay (point-min) (point-max) nil nil t))) | |
(overlay-put ov 'window (selected-window)) | |
(overlay-put ov 'face | |
(let ((bg-color (face-background 'default nil))) | |
`(:background ,bg-color :foreground ,bg-color))) | |
(setq-local cursor-type nil)))) | |
(add-hook 'helm-minibuffer-set-up-hook | |
'spacemacs//helm-hide-minibuffer-maybe) | |
(setq helm-autoresize-max-height 0) | |
(setq helm-autoresize-min-height 20) | |
(helm-autoresize-mode 1) | |
(helm-mode 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(global-set-key (kbd "C-x C-f") 'helm-find-files) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(setq helm-semantic-fuzzy-match t | |
helm-imenu-fuzzy-match t) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(add-to-list 'helm-sources-using-default-as-input 'helm-source-man-pages) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(setq helm-locate-fuzzy-match t) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(global-set-key (kbd "C-c h o") 'helm-occur) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(setq helm-apropos-fuzzy-match t) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(setq helm-lisp-fuzzy-completion t) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define-key helm-map (kbd "<tab>") 'helm-execute-persistent-action) ; rebind tab to do persistent action | |
(define-key helm-map (kbd "C-i") 'helm-execute-persistent-action) ; make TAB works in terminal | |
(define-key helm-map (kbd "C-z") 'helm-select-action) ; list actions using C-z |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(helm-autoresize-mode t) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun pl/helm-alive-p () | |
(if (boundp 'helm-alive-p) | |
(symbol-value 'helm-alive-p))) | |
(add-to-list 'golden-ratio-inhibit-functions 'pl/helm-alive-p) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(global-set-key (kbd "M-x") 'helm-M-x) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(setq helm-M-x-fuzzy-match t) ;; optional fuzzy matching for helm-M-x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(global-set-key (kbd "M-y") 'helm-show-kill-ring) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(global-set-key (kbd "C-x b") 'helm-mini) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(setq helm-buffers-fuzzy-matching t | |
helm-recentf-fuzzy-match t) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment