Improve dash.app integration
This commit is contained in:
parent
8f274e06a7
commit
bd52011f80
2 changed files with 35 additions and 5 deletions
25
core/defuns/defuns-dash.el
Normal file
25
core/defuns/defuns-dash.el
Normal file
|
@ -0,0 +1,25 @@
|
|||
;;; defuns-dash.el --- Dash.app integration
|
||||
|
||||
;;;###autoload
|
||||
(defun narf/dash-at-pt ()
|
||||
(interactive)
|
||||
(if (evil-visual-state-p)
|
||||
(dash-at-point-run-search (buffer-substring-no-properties (region-beginning) (region-end))
|
||||
(dash-at-point-guess-docset))
|
||||
(dash-at-point)))
|
||||
|
||||
;;;###autoload (autoload 'narf:dash "defuns-dash" nil t)
|
||||
(evil-define-command narf:dash (bang input)
|
||||
(interactive "<!><a>")
|
||||
(let ((docset (unless bang (dash-at-point-guess-docset)))
|
||||
(query input))
|
||||
(when (evil-visual-state-p)
|
||||
(setq query (concat (buffer-substring-no-properties (region-beginning) (region-end))
|
||||
" " query)))
|
||||
(when (or (not query) (string-empty-p query))
|
||||
(setq query (thing-at-point 'symbol)))
|
||||
(dash-at-point-run-search query docset)))
|
||||
|
||||
|
||||
(provide 'defuns-dash)
|
||||
;;; defuns-dash.el ends here
|
Loading…
Add table
Add a link
Reference in a new issue