Goodbye Helm, hello Ivy
This commit is contained in:
parent
e8344945f5
commit
bc33e39823
14 changed files with 191 additions and 83 deletions
57
core/defuns/defuns-ivy.el
Normal file
57
core/defuns/defuns-ivy.el
Normal file
|
@ -0,0 +1,57 @@
|
|||
;;; defuns-ivy.el
|
||||
|
||||
;;;###autoload
|
||||
(defun doom/ivy-switch-buffer (&optional all-p)
|
||||
"Displays open buffers in current project. If ALL-P, then show all open
|
||||
buffers."
|
||||
(interactive)
|
||||
(let ((this-command 'ivy-switch-buffer))
|
||||
(ivy-read "Switch to buffer: " (doom/get-buffer-names (not all-p))
|
||||
:matcher #'ivy--switch-buffer-matcher
|
||||
:preselect (buffer-name (other-buffer (current-buffer)))
|
||||
:action #'ivy--switch-buffer-action
|
||||
:keymap ivy-switch-buffer-map
|
||||
:caller 'doom/ivy-switch-buffer)))
|
||||
|
||||
;;;###autoload
|
||||
(defun doom/ivy-kill-ring ()
|
||||
(interactive)
|
||||
(ivy-read "Kill ring:" (--filter (not (or (< (length it) 3)
|
||||
(string-match-p "\\`[\n[:blank:]]+\\'" it)))
|
||||
(remove-duplicates kill-ring :test' equal))))
|
||||
|
||||
;;;###autoload (autoload 'doom:ivy-recentf "defuns-ivy" nil t)
|
||||
(evil-define-command doom:ivy-recentf (&optional bang)
|
||||
"Ex-mode interface for `ivy-recentf' and `projectile-recentf'."
|
||||
:repeat nil
|
||||
(interactive "<!>")
|
||||
(if bang (ivy-recentf) (projectile-recentf)))
|
||||
|
||||
;;;###autoload (autoload 'doom:ivy-swipe "defuns-ivy" nil t)
|
||||
(evil-define-command doom:ivy-swiper (&optional search)
|
||||
(interactive "<a>")
|
||||
(swiper (or search (thing-at-point 'symbol))))
|
||||
|
||||
;;;###autoload (autoload 'doom:ivy-ag-search "defuns-ivy" nil t)
|
||||
(evil-define-operator doom:ivy-ag-search (beg end search regex-p &optional dir)
|
||||
"Preform a counsel search with SEARCH. If SEARCH is nil and in visual mode,
|
||||
use the selection, otherwise activate live ag searching in helm.
|
||||
|
||||
If REGEX-P is non-nil, SEARCH will be treated as a regular expression.
|
||||
DIR specifies the default-directory from which ag is run."
|
||||
:type inclusive :repeat nil
|
||||
(interactive "<r><a><!>")
|
||||
(let ((counsel-ag-base-command
|
||||
(format "ag --nocolor --nogroup %s %%s -- ."
|
||||
(if regex-p "-Q" "")))
|
||||
(search (or search (and beg end (buffer-substring-no-properties beg end)))))
|
||||
(counsel-ag search (or dir (f-slash (doom/project-root))))))
|
||||
|
||||
;;;###autoload (autoload 'doom:ivy-ag-search-cwd "defuns-ivy" nil t)
|
||||
(evil-define-operator doom:ivy-ag-search-cwd (beg end search regex-p)
|
||||
:type inclusive :repeat nil
|
||||
(interactive "<r><a><!>")
|
||||
(doom:ivy-ag-search beg end search regex-p default-directory))
|
||||
|
||||
(provide 'defuns-ivy)
|
||||
;;; defuns-ivy.el ends here
|
|
@ -92,9 +92,12 @@ normal mode if there are no fields."
|
|||
;;;###autoload
|
||||
(defun doom/yas-find-file ()
|
||||
"Browse through snippets folder"
|
||||
;; FIXME
|
||||
(interactive)
|
||||
(doom/ido-find-file (car doom-snippet-dirs)))
|
||||
(projectile-find-file-in-directory (car yas-snippet-dirs)))
|
||||
|
||||
;;;###autoload
|
||||
(defun doom/yas-ivy-prompt (prompt choices &optional display-fn)
|
||||
(yas-completing-prompt prompt choices display-fn #'ivy-completing-read))
|
||||
|
||||
(provide 'defuns-yasnippet)
|
||||
;;; nlinum-defuns.el ends here
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue