Update completion/helm
This commit is contained in:
parent
102c7df400
commit
e8e9f7683a
4 changed files with 106 additions and 84 deletions
44
modules/completion/helm/autoload/evil.el
Normal file
44
modules/completion/helm/autoload/evil.el
Normal file
|
@ -0,0 +1,44 @@
|
|||
;;; completion/helm/autoload/evil.el -*- lexical-binding: t; -*-
|
||||
|
||||
;;;###autoload (autoload '+helm:swoop "completion/helm/autoload/evil" nil t)
|
||||
(evil-define-command +helm:swoop (&optional search bang)
|
||||
"Invoke `swoop' with SEARCH. If BANG, do multiline search."
|
||||
(interactive "<a><!>")
|
||||
(helm-swoop :$query search :$multiline bang))
|
||||
|
||||
(defvar +helm--file-last-search nil)
|
||||
;;;###autoload (autoload '+helm:ag "completion/helm/autoload/evil" nil t)
|
||||
(evil-define-command +helm:ag (beg end query &optional bang directory)
|
||||
"TODO"
|
||||
(interactive "<r><a><!>")
|
||||
(require 'helm-ag)
|
||||
(helm-ag--init-state)
|
||||
(let ((helm-ag--default-directory (or directory (doom-project-root)))
|
||||
(helm-ag--last-query (or query
|
||||
(and beg end
|
||||
(> (abs (- end beg)) 1)
|
||||
(setq +helm--file-last-search
|
||||
(rxt-quote-pcre (buffer-substring-no-properties beg end))))
|
||||
+helm--file-last-search))
|
||||
(helm-ag-command-option (concat helm-ag-command-option (if bang " -a "))))
|
||||
(helm-attrset 'search-this-file nil helm-ag-source)
|
||||
(helm-attrset 'name (helm-ag--helm-header helm-ag--default-directory) helm-ag-source)
|
||||
(helm :sources '(helm-ag-source)
|
||||
:input query
|
||||
:buffer "*helm-ag*"
|
||||
:keymap helm-ag-map
|
||||
:history 'helm-ag--helm-history)))
|
||||
|
||||
;;;###autoload (autoload '+helm:ag-cwd "completion/helm/autoload/evil" nil t)
|
||||
(evil-define-command +helm:ag-cwd (beg end query &optional bang directory)
|
||||
"TODO"
|
||||
(interactive "<r><a><!>")
|
||||
(let ((helm-ag-command-option (if bang " -n ")))
|
||||
(+helm:ag beg end query t default-directory)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +helm:rg (&rest _) (interactive) (error "Not implemented yet"))
|
||||
;;;###autoload
|
||||
(defun +helm:rg-cwd (&rest _) (interactive) (error "Not implemented yet"))
|
||||
;;;###autoload
|
||||
(defun +helm:todo (&rest _) (interactive) (error "Not implemented yet"))
|
2
modules/completion/helm/autoload/helm.el
Normal file
2
modules/completion/helm/autoload/helm.el
Normal file
|
@ -0,0 +1,2 @@
|
|||
;;; completion/helm/autoload/helm.el -*- lexical-binding: t; -*-
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue