Helm: prompt hacks and refactor
This commit is contained in:
parent
7d8c577f7c
commit
29ce34cc55
1 changed files with 43 additions and 25 deletions
|
@ -14,12 +14,6 @@
|
||||||
|
|
||||||
(my--cleanup-buffers-add "^\\*[Hh]elm.*\\*$")
|
(my--cleanup-buffers-add "^\\*[Hh]elm.*\\*$")
|
||||||
|
|
||||||
(bind helm-map
|
|
||||||
(kbd "C-w") 'evil-delete-backward-word
|
|
||||||
(kbd "C-u") 'helm-delete-minibuffer-contents
|
|
||||||
(kbd "C-r") 'evil-ex-paste-from-register ; Evil registers in helm! Glorious!
|
|
||||||
[escape] 'helm-keyboard-quit)
|
|
||||||
|
|
||||||
(evil-ex-define-cmd "a" 'helm-projectile-find-other-file)
|
(evil-ex-define-cmd "a" 'helm-projectile-find-other-file)
|
||||||
(evil-ex-define-cmd "proj[ect]" 'helm-projectile-switch-project)
|
(evil-ex-define-cmd "proj[ect]" 'helm-projectile-switch-project)
|
||||||
(evil-ex-define-cmd "ag" 'my:helm-ag-search)
|
(evil-ex-define-cmd "ag" 'my:helm-ag-search)
|
||||||
|
@ -83,7 +77,6 @@
|
||||||
helm-swoop-speed-or-color t
|
helm-swoop-speed-or-color t
|
||||||
helm-swoop-split-window-function 'popwin:popup-buffer)
|
helm-swoop-split-window-function 'popwin:popup-buffer)
|
||||||
|
|
||||||
(after "helm-css-scss"
|
|
||||||
;; Ex-mode interface for `helm-swoop', `helm-multi-swoop-all' (if `bang'), or
|
;; Ex-mode interface for `helm-swoop', `helm-multi-swoop-all' (if `bang'), or
|
||||||
;; `helm-css-scss' and `helm-css-scss-multi' (if `bang') if major-mode is
|
;; `helm-css-scss' and `helm-css-scss-multi' (if `bang') if major-mode is
|
||||||
;; `scss-mode'
|
;; `scss-mode'
|
||||||
|
@ -92,15 +85,10 @@
|
||||||
(interactive "<a><!>")
|
(interactive "<a><!>")
|
||||||
(if (eq major-mode 'scss-mode)
|
(if (eq major-mode 'scss-mode)
|
||||||
(if bang (helm-css-scss-multi search) (helm-css-scss search))
|
(if bang (helm-css-scss-multi search) (helm-css-scss search))
|
||||||
(if bang (helm-multi-swoop-all search) (helm-swoop :$query search)))))))
|
(if bang (helm-multi-swoop-all search) (helm-swoop :$query search))))))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
(after "projectile"
|
|
||||||
(use-package helm-projectile
|
|
||||||
:config
|
|
||||||
(setq projectile-switch-project-action 'helm-projectile)))
|
|
||||||
|
|
||||||
(after "winner"
|
(after "winner"
|
||||||
;; Tell winner-mode to ignore helm buffers
|
;; Tell winner-mode to ignore helm buffers
|
||||||
(dolist (bufname '("*helm recentf*"
|
(dolist (bufname '("*helm recentf*"
|
||||||
|
@ -126,11 +114,37 @@
|
||||||
:prompt helm-global-prompt
|
:prompt helm-global-prompt
|
||||||
:candidate-number-limit helm-company-candidate-number-limit)))))
|
:candidate-number-limit helm-company-candidate-number-limit)))))
|
||||||
|
|
||||||
(progn ; helm hacks
|
(after "projectile"
|
||||||
|
(use-package helm-projectile
|
||||||
|
:config
|
||||||
|
(setq projectile-switch-project-action 'helm-projectile))
|
||||||
|
|
||||||
;; Don't show the project name in the prompts; I already know.
|
;; Don't show the project name in the prompts; I already know.
|
||||||
(defun projectile-prepend-project-name (string)
|
(defun projectile-prepend-project-name (string)
|
||||||
(format helm-global-prompt string))
|
(format helm-global-prompt string))
|
||||||
|
|
||||||
|
;; All this for a smaller prompt (it was redundant with helm headers)
|
||||||
|
(defmacro helm-projectile-command (command source prompt)
|
||||||
|
`(defun ,(intern (concat "helm-projectile-" command)) (&optional arg)
|
||||||
|
(interactive "P")
|
||||||
|
(if (projectile-project-p)
|
||||||
|
(projectile-maybe-invalidate-cache arg))
|
||||||
|
(let ((helm-ff-transformer-show-only-basename nil)
|
||||||
|
;; for consistency, we should just let Projectile take care of ignored files
|
||||||
|
(helm-boring-file-regexp-list nil))
|
||||||
|
(helm :sources ,source
|
||||||
|
:buffer "*helm projectile*"
|
||||||
|
:prompt helm-global-prompt))))
|
||||||
|
|
||||||
|
(helm-projectile-command "switch-project" 'helm-source-projectile-projects helm-global-prompt)
|
||||||
|
(helm-projectile-command "find-file" helm-source-projectile-files-and-dired-list helm-global-prompt)
|
||||||
|
(helm-projectile-command "find-file-in-known-projects" 'helm-source-projectile-files-in-all-projects-list helm-global-prompt)
|
||||||
|
(helm-projectile-command "find-file-dwim" 'helm-source-projectile-files-dwim-list helm-global-prompt)
|
||||||
|
(helm-projectile-command "find-dir" helm-source-projectile-directories-and-dired-list helm-global-prompt)
|
||||||
|
(helm-projectile-command "recentf" 'helm-source-projectile-recentf-list helm-global-prompt)
|
||||||
|
(helm-projectile-command "switch-to-buffer" 'helm-source-projectile-buffers-list helm-global-prompt))
|
||||||
|
|
||||||
|
(progn ; helm hacks
|
||||||
;; No persistent header
|
;; No persistent header
|
||||||
(defadvice helm-display-mode-line (after undisplay-header activate)
|
(defadvice helm-display-mode-line (after undisplay-header activate)
|
||||||
(setq header-line-format nil))
|
(setq header-line-format nil))
|
||||||
|
@ -163,8 +177,6 @@
|
||||||
(propertize (concat " " hlstr hlend) 'face 'helm-header))))
|
(propertize (concat " " hlstr hlend) 'face 'helm-header))))
|
||||||
(when force (force-mode-line-update))))
|
(when force (force-mode-line-update))))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
||||||
|
|
||||||
(progn ; popwin
|
(progn ; popwin
|
||||||
(push '("^\\*helm.*\\*$" :position bottom :regexp t :height 18)
|
(push '("^\\*helm.*\\*$" :position bottom :regexp t :height 18)
|
||||||
popwin:special-display-config))
|
popwin:special-display-config))
|
||||||
|
@ -178,4 +190,10 @@
|
||||||
(evil-define-command my:helm-recentf (&optional bang)
|
(evil-define-command my:helm-recentf (&optional bang)
|
||||||
:repeat nil
|
:repeat nil
|
||||||
(interactive "<!>")
|
(interactive "<!>")
|
||||||
(if bang (helm-recentf) (helm-projectile-recentf))))))
|
(if bang (helm-recentf) (helm-projectile-recentf))))
|
||||||
|
|
||||||
|
(bind helm-map
|
||||||
|
"C-w" 'evil-delete-backward-word
|
||||||
|
"C-u" 'helm-delete-minibuffer-contents
|
||||||
|
"C-r" 'evil-ex-paste-from-register ; Evil registers in helm! Glorious!
|
||||||
|
[escape] 'helm-keyboard-quit)))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue