Skip to content

Instantly share code, notes, and snippets.

@Pitometsu
Last active January 17, 2017 03:22
Show Gist options
  • Save Pitometsu/317122b03762fcbf41d5 to your computer and use it in GitHub Desktop.
Save Pitometsu/317122b03762fcbf41d5 to your computer and use it in GitHub Desktop.
helm config
> grep helm .emacs.d/init.el
'(helm-M-x-fuzzy-match t)
'(helm-adaptive-history-length 128)
'(helm-ag-command-option "--all-text")
'(helm-ag-insert-at-point (quote symbol))
'(helm-always-two-windows nil)
'(helm-apropos-fuzzy-match t)
'(helm-buffer-max-length nil)
'(helm-buffers-favorite-modes
'(helm-buffers-fuzzy-matching t)
'(helm-candidate-number-limit 128)
'(helm-candidate-separator "
")
'(helm-default-external-file-browser "open")
'(helm-ff-auto-update-initial-value nil)
'(helm-ff-lynx-style-map nil)
'(helm-for-files-preferred-list
(helm-c-source-ffap-line helm-c-source-ffap-guesser helm-c-source-buffers-list helm-c-source-recentf helm-c-source-bookmarks helm-c-source-file-cache helm-c-source-files-in-current-dir helm-c-source-locate helm-c-source-buffer-not-found)))
'(helm-home-url "http://www.google.com")
'(helm-lisp-fuzzy-completion t)
'(helm-locate-command "locate %s -r %s")
'(helm-mode t)
'(helm-mp-matching-method (quote multi3))
'(helm-quick-update t)
'(helm-reuse-last-window-split-state nil)
'(helm-split-window-default-side (quote below))
'(helm-split-window-in-side-p nil)
'(helm-time-zone-home-location "Kiev")
'(helm-top-command "env COLUMNS=%s top -s1 -o cpu -R -F -l1 ")
("^\\*helm.*\\*$" :regexp t)
'(rvm-interactive-completion-function (quote helm--completing-read-default))
'(rvm-interactive-find-file-function (quote helm-find-files))
;; init-helm.el
(global-set-key (kbd "M-o") 'helm-occur)
(global-set-key (kbd "C-M-o") 'helm-multi-occur)
(global-set-key (kbd "s-O") 'helm-multi-occur)
(global-set-key (kbd "s-o") 'helm-occur)
;; like sublimetext's Ctrl-P file@symbol
(defun helm-goto-symbol ()
"multi-occur in all buffers backed by files."
(interactive)
(helm-multi-occur
(delq nil
(mapcar (lambda (b)
(when (buffer-file-name b) (buffer-name b)))
(buffer-list)))))
;; keybindings for Helm
(global-set-key (kbd "M-x") 'helm-M-x)
(global-set-key (kbd "C-x C-r") 'helm-recentf)
(global-set-key (kbd "C-x C-f") 'helm-find-files)
(global-set-key (kbd "s-p") 'helm-goto-symbol)
(global-set-key (kbd "C-x p") 'helm-goto-symbol)
(global-set-key (kbd "C-x b") 'helm-buffers-list)
(global-set-key (kbd "C-x s-F") 'helm-do-grep)
(global-set-key (kbd "s-F") 'helm-do-grep)
;; hooks
;; enable helm pcomplete
(defun helm-eshell-pcomplete-hook ()
(define-key eshell-mode-map [remap eshell-pcomplete] 'helm-esh-pcomplete))
(defun helm-eshell-history-hook ()
(define-key eshell-mode-map (kbd "M-p") 'helm-eshell-history))
(defun helm-dired-moccur-hook ()
(local-set-key (kbd "O") 'helm-c-moccur-dired-do-moccur-by-moccur))
(add-hook 'eshell-mode-hook 'helm-eshell-pcomplete-hook)
(add-hook 'eshell-mode-hook 'helm-eshell-history-hook)
(add-hook 'dired-mode-hook 'helm-dired-moccur-hook)
(eval-after-load 'helm-mode
'(progn
(ido-mode 0)
(define-key helm-map (kbd "C-g") 'helm-keyboard-quit)
;; Rebind TAB and C-z
(define-key helm-map (kbd "<tab>") 'helm-execute-persistent-action)
(define-key helm-map (kbd "C-i") 'helm-execute-persistent-action)
(define-key helm-map (kbd "C-z") 'helm-select-action)))
;; kill ring summary
(global-set-key (kbd "s-C-M-V") 'helm-show-kill-ring)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment