Skip to content

Instantly share code, notes, and snippets.

@izahn
Created May 20, 2016 19:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save izahn/00b7b930db646e15bae3d3741f603af5 to your computer and use it in GitHub Desktop.
Save izahn/00b7b930db646e15bae3d3741f603af5 to your computer and use it in GitHub Desktop.
Helm config
;;; Completion hints for files and buffers buffers
(require 'helm-config)
(helm-mode 1)
;;rebind tab to do persistent action
(define-key helm-map (kbd "<tab>") 'helm-execute-persistent-action)
;; make TAB works in terminal
(define-key helm-map (kbd "C-i") 'helm-execute-persistent-action)
;list actions using C-z
(define-key helm-map (kbd "C-z") 'helm-select-action)
;; helm options
(setq helm-mode-fuzzy-match t
helm-buffers-fuzzy-matching t
helm-recentf-fuzzy-match t
helm-M-x-fuzzy-match t
helm-full-frame t
helm-ff-guess-ffap-urls nil
helm-ff-guess-ffap-filenames nil
helm-highlight-matches-around-point-max-lines 0)
;; helm global-map
(global-set-key (kbd "M-x") 'undefined)
(global-set-key (kbd "M-x") 'helm-M-x)
(global-set-key (kbd "C-x b") 'helm-buffers-list)
(global-set-key (kbd "M-y") 'helm-show-kill-ring)
(global-set-key (kbd "C-c f") 'helm-recentf)
(global-set-key (kbd "C-x C-f") 'helm-find-files)
(global-set-key (kbd "C-c <SPC>") 'helm-all-mark-rings)
(global-set-key (kbd "C-x r b") 'helm-filtered-bookmarks)
(global-set-key (kbd "C-h r") 'helm-info-emacs)
(global-set-key (kbd "C-:") 'helm-eval-expression-with-eldoc)
(global-set-key (kbd "C-,") 'helm-calcul-expression)
(global-set-key (kbd "C-h i") 'helm-info-at-point)
(global-set-key (kbd "C-x C-d") 'helm-browse-project)
(global-set-key (kbd "<f1>") 'helm-resume)
(global-set-key (kbd "C-h C-f") 'helm-apropos)
(global-set-key (kbd "<f5> s") 'helm-find)
(global-set-key (kbd "<f2>") 'helm-execute-kmacro)
(global-set-key (kbd "C-c g") 'helm-gid)
(global-set-key (kbd "C-c i") 'helm-imenu-in-all-buffers)
(define-key global-map [remap jump-to-register] 'helm-register)
(define-key global-map [remap list-buffers] 'helm-buffers-list)
(define-key global-map [remap dabbrev-expand] 'helm-dabbrev)
(define-key global-map [remap find-tag] 'helm-etags-select)
(define-key global-map [remap xref-find-definitions] 'helm-etags-select)
;; Perhaps see
;; https://github.com/hatschipuh/helm-better-defaults
;; for other helm customizations you might want.
;; ;; No dot dirs in helm file navigation
(require 'cl-lib)
(with-eval-after-load 'helm-files
(advice-add 'helm-ff-filter-candidate-one-by-one
:before-while 'no-dots-display-file-p))
(defvar no-dots-whitelist nil
"List of helm buffers in which to show dots.")
(defun no-dots-in-white-listed-helm-buffer-p ()
(member helm-buffer no-dots-whitelist))
(defun no-dots-display-file-p (file)
;; in a whitelisted buffer display the file regardless of its name
(or (no-dots-in-white-listed-helm-buffer-p)
;; not in a whitelisted buffer display all files
;; which does not end with /. /..
(not (string-match "\\(?:/\\|\\`\\)\\.\\{1,2\\}\\'" file))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment