2015-06-15 09:05:52 +02:00
|
|
|
;;; core-helm.el
|
|
|
|
|
|
|
|
(use-package helm
|
|
|
|
:init
|
2016-02-20 15:32:45 -05:00
|
|
|
(defvar helm-global-prompt ":: ")
|
2015-10-23 04:42:34 -04:00
|
|
|
(setq-default
|
|
|
|
helm-quick-update t
|
|
|
|
helm-reuse-last-window-split-state t
|
|
|
|
|
2015-12-23 02:41:36 -05:00
|
|
|
helm-mode-fuzzy-match nil
|
|
|
|
helm-buffers-fuzzy-matching nil
|
2015-11-20 21:48:19 -05:00
|
|
|
helm-apropos-fuzzy-match nil
|
2015-12-23 02:41:36 -05:00
|
|
|
helm-M-x-fuzzy-match nil
|
|
|
|
helm-recentf-fuzzy-match nil
|
2016-03-03 01:38:13 -05:00
|
|
|
helm-projectile-fuzzy-match nil
|
2015-10-23 04:42:34 -04:00
|
|
|
|
2015-11-20 21:48:19 -05:00
|
|
|
helm-display-header-line nil
|
2015-10-23 04:42:34 -04:00
|
|
|
helm-ff-auto-update-initial-value nil
|
2015-11-20 21:48:19 -05:00
|
|
|
helm-ff-skip-boring-files t
|
2015-10-23 04:42:34 -04:00
|
|
|
helm-find-files-doc-header nil
|
2015-11-20 21:48:19 -05:00
|
|
|
helm-move-to-line-cycle-in-source t
|
2015-10-23 04:42:34 -04:00
|
|
|
|
2015-11-25 17:22:58 -05:00
|
|
|
;; Don't override evil-ex's completion
|
|
|
|
helm-mode-handle-completion-in-region nil
|
|
|
|
|
2016-03-03 15:04:14 -05:00
|
|
|
helm-candidate-number-limit 40
|
2015-11-19 05:55:21 -05:00
|
|
|
helm-bookmark-show-location t)
|
2015-11-20 21:48:19 -05:00
|
|
|
|
2015-06-15 09:05:52 +02:00
|
|
|
:config
|
2015-11-17 02:00:36 -05:00
|
|
|
(require 'helm-files)
|
2015-06-15 09:05:52 +02:00
|
|
|
|
2015-11-20 21:48:19 -05:00
|
|
|
(mapc (lambda (r) (add-to-list 'helm-boring-file-regexp-list r))
|
2016-03-03 15:04:14 -05:00
|
|
|
(list "\\.projects$" "\\.DS_Store$" "\\.cask"))
|
2015-10-18 02:27:59 -04:00
|
|
|
|
2016-03-04 22:34:57 -05:00
|
|
|
(map! (:map (helm-generic-files-map helm-projectile-find-file-map)
|
2016-03-03 01:38:13 -05:00
|
|
|
"ESC" 'helm-keyboard-quit)
|
|
|
|
(:map (helm-map helm-generic-files-map helm-find-files-map helm-swoop-map helm-projectile-find-file-map)
|
2015-11-30 05:31:20 -05:00
|
|
|
"C-w" 'backward-kill-word
|
2015-12-06 22:57:03 -05:00
|
|
|
"C-r" 'evil-paste-from-register ; Evil registers in helm! Glorious!
|
2015-12-23 02:41:36 -05:00
|
|
|
"/" nil
|
|
|
|
"<left>" 'backward-char
|
|
|
|
"<right>" 'forward-char
|
2015-11-30 05:31:20 -05:00
|
|
|
"<escape>" 'helm-keyboard-quit
|
2016-03-03 01:38:13 -05:00
|
|
|
[escape] 'helm-keyboard-quit
|
|
|
|
"<tab>" 'helm-execute-persistent-action)
|
2015-11-30 05:31:20 -05:00
|
|
|
(:map helm-find-files-map
|
|
|
|
"C-w" 'helm-find-files-up-one-level
|
2016-03-03 01:38:13 -05:00
|
|
|
"TAB" 'helm-execute-persistent-action)
|
2015-11-30 05:31:20 -05:00
|
|
|
(:map helm-ag-map
|
|
|
|
"<backtab>" 'helm-ag-edit)
|
|
|
|
(:map helm-ag-edit-map
|
|
|
|
"<escape>" 'helm-ag--edit-abort
|
|
|
|
:n "zx" 'helm-ag--edit-abort)
|
|
|
|
(:map helm-map
|
|
|
|
"C-S-n" 'helm-next-source
|
|
|
|
"C-S-p" 'helm-previous-source
|
|
|
|
"C-u" 'helm-delete-minibuffer-contents))
|
2015-06-15 09:05:52 +02:00
|
|
|
|
2015-11-20 21:48:19 -05:00
|
|
|
;;; Helm hacks
|
2015-12-12 16:08:21 -05:00
|
|
|
(defvar narf-helm-header-fg (face-attribute 'helm-source-header :foreground) "docstring")
|
2015-11-21 16:22:40 -05:00
|
|
|
(defun narf*helm-hide-source-header-maybe ()
|
|
|
|
(if (<= (length helm-sources) 1)
|
2015-12-12 16:08:21 -05:00
|
|
|
(set-face-attribute 'helm-source-header nil :height 0.1 :foreground "#111111")
|
|
|
|
(set-face-attribute 'helm-source-header nil :height 1.0 :foreground narf-helm-header-fg)))
|
2015-11-20 21:48:19 -05:00
|
|
|
|
2015-12-23 02:41:36 -05:00
|
|
|
(defun narf*helm-hide-header (source &optional force)
|
|
|
|
(setq header-line-format nil)
|
|
|
|
(setq mode-line-format nil))
|
2015-11-20 21:48:19 -05:00
|
|
|
|
|
|
|
(defun narf*helm-replace-prompt (plist)
|
|
|
|
(if (keywordp (car plist))
|
|
|
|
(setq plist (plist-put plist :prompt helm-global-prompt))
|
|
|
|
(setcar (nthcdr 2 plist) helm-global-prompt))
|
|
|
|
plist)
|
|
|
|
|
2016-03-03 01:38:13 -05:00
|
|
|
(defvar narf-helm-force-project-buffers nil)
|
|
|
|
(defun helm*buffer-list (&rest _) (narf/get-buffer-names narf-helm-force-project-buffers))
|
|
|
|
(advice-add 'helm-buffer-list :override 'helm*buffer-list)
|
|
|
|
|
2015-11-21 16:22:40 -05:00
|
|
|
;; Shrink source headers if there is only one source
|
2015-12-12 16:08:21 -05:00
|
|
|
(add-hook 'helm-after-initialize-hook 'narf*helm-hide-source-header-maybe)
|
2015-11-20 21:48:19 -05:00
|
|
|
;; A simpler prompt: see `helm-global-prompt'
|
|
|
|
(advice-add 'helm :filter-args 'narf*helm-replace-prompt)
|
2015-07-23 01:34:36 +02:00
|
|
|
;; Hide mode-line in helm windows
|
2015-12-23 02:41:36 -05:00
|
|
|
(advice-add 'helm-display-mode-line :override 'narf*helm-hide-header)
|
2015-11-20 21:48:19 -05:00
|
|
|
|
2015-11-25 17:22:58 -05:00
|
|
|
(helm-mode 1))
|
2015-06-15 09:05:52 +02:00
|
|
|
|
2015-10-18 02:27:59 -04:00
|
|
|
(use-package projectile
|
|
|
|
:config
|
|
|
|
(add-hook! kill-emacs 'narf|projectile-invalidate-cache-maybe)
|
|
|
|
|
|
|
|
(setq-default projectile-enable-caching t)
|
2015-12-23 02:41:36 -05:00
|
|
|
(setq projectile-require-project-root nil
|
2015-10-18 02:27:59 -04:00
|
|
|
projectile-cache-file (concat narf-temp-dir "projectile.cache")
|
|
|
|
projectile-known-projects-file (concat narf-temp-dir "projectile.projects")
|
|
|
|
projectile-indexing-method 'alien
|
|
|
|
projectile-project-root-files narf-project-root-files)
|
|
|
|
|
|
|
|
(add-to-list 'projectile-globally-ignored-files "ido.last")
|
2016-03-03 15:04:14 -05:00
|
|
|
(add-to-list 'projectile-globally-ignored-directories ".cask")
|
2015-10-18 02:27:59 -04:00
|
|
|
(add-to-list 'projectile-globally-ignored-directories "assets")
|
2016-01-22 19:28:30 -05:00
|
|
|
(add-to-list 'projectile-globally-ignored-directories ".export")
|
|
|
|
(add-to-list 'projectile-globally-ignored-directories ".attach")
|
2015-10-18 02:27:59 -04:00
|
|
|
(add-to-list 'projectile-other-file-alist '("scss" "css"))
|
|
|
|
(add-to-list 'projectile-other-file-alist '("css" "scss"))
|
|
|
|
|
|
|
|
(projectile-global-mode +1)
|
|
|
|
|
|
|
|
(require 'helm-projectile))
|
|
|
|
|
2015-06-24 15:39:13 +02:00
|
|
|
(use-package helm-ag
|
|
|
|
:commands (helm-ag
|
|
|
|
helm-ag-mode
|
|
|
|
helm-do-ag
|
|
|
|
helm-do-ag-this-file
|
|
|
|
helm-do-ag-project-root
|
|
|
|
helm-do-ag-buffers
|
|
|
|
helm-ag-project-root
|
|
|
|
helm-ag-pop-stack
|
|
|
|
helm-ag-buffers
|
2015-11-19 05:55:21 -05:00
|
|
|
helm-ag-clear-stack))
|
2015-06-24 15:39:13 +02:00
|
|
|
|
2015-06-15 09:05:52 +02:00
|
|
|
(use-package helm-org
|
|
|
|
:commands (helm-org-in-buffer-headings
|
|
|
|
helm-org-agenda-files-headings
|
|
|
|
helm-org-capture-templates))
|
|
|
|
|
|
|
|
(use-package helm-css-scss ; https://github.com/ShingoFukuyama/helm-css-scss
|
|
|
|
:commands (helm-css-scss
|
|
|
|
helm-css-scss-multi
|
2015-07-23 01:34:36 +02:00
|
|
|
helm-css-scss-insert-close-comment)
|
|
|
|
:config
|
|
|
|
(setq helm-css-scss-split-direction 'split-window-vertically
|
|
|
|
helm-css-scss-split-with-multiple-windows t))
|
2015-06-15 09:05:52 +02:00
|
|
|
|
|
|
|
(use-package helm-swoop ; https://github.com/ShingoFukuyama/helm-swoop
|
|
|
|
:defines (helm-swoop-last-prefix-number)
|
|
|
|
:commands (helm-swoop helm-multi-swoop helm-multi-swoop-all)
|
|
|
|
:config
|
|
|
|
(setq helm-swoop-use-line-number-face t
|
2015-11-17 02:00:36 -05:00
|
|
|
helm-swoop-candidate-number-limit 200
|
|
|
|
helm-swoop-speed-or-color t
|
|
|
|
helm-swoop-pre-input-function (lambda () "")))
|
2015-06-15 09:05:52 +02:00
|
|
|
|
2016-02-11 02:08:08 -05:00
|
|
|
(use-package helm-describe-modes :defer t)
|
2015-07-23 01:34:36 +02:00
|
|
|
(use-package helm-semantic :commands helm-semantic-or-imenu)
|
|
|
|
(use-package helm-elisp :commands helm-apropos)
|
|
|
|
(use-package helm-command :commands helm-M-x)
|
2015-12-23 02:41:36 -05:00
|
|
|
(use-package helm-descbinds :commands helm-descbinds
|
|
|
|
:config
|
|
|
|
(setq helm-descbinds-window-style 'split-window)
|
|
|
|
(defun narf/helm-descbinds-leader ()
|
|
|
|
(interactive)
|
|
|
|
(narf-helm-descbinds "^,\\ "))
|
|
|
|
(defun narf/helm-descbinds-localleader ()
|
|
|
|
(interactive)
|
|
|
|
(narf-helm-descbinds "^\\\\\\ "))
|
|
|
|
|
|
|
|
(defun narf-helm-descbinds (&optional input buffer)
|
|
|
|
(let ((enable-recursive-minibuffers t))
|
|
|
|
(helm :sources (helm-descbinds-sources (or buffer (current-buffer)))
|
|
|
|
:buffer "*helm-descbinds*"
|
|
|
|
:resume 'noresume
|
|
|
|
:allow-nest t
|
|
|
|
:input input))))
|
2015-06-15 09:05:52 +02:00
|
|
|
|
|
|
|
(provide 'core-helm)
|
|
|
|
;;; core-helm.el ends here
|