Have you every needed to drag and drop something but then realised that you have to open a shudders non-Emacs file manger? Well not anymore! This package adds bindings for dragon so that you can live in Emacs a little more!
Do note that dired already acts like a sink in normal use so I won’t add dragon functionality for that. It’s a “why add an extra step” sort of thing.
These commands are the original work of @ymarco. Thanks!
They open up a dragon instance for the current file unless its an org or tex
file. then it will check for a corresponding pdf file and drag that instead
that is still a work in progress. You can still use the command but it will just
drag the current file
At
Command | Use | Flag | Requires |
---|---|---|---|
:drag | an evil ex command to drag the current buffer and quit | -x | evil |
dired-dragon-current-file | a vanilla version of the :drag command | -x | Nothing |
These commands are meant to be used in dired.
Commands | Use | Flag(s) |
---|---|---|
dired-dragon | The Default, drags all and closes after one drop | -x -a |
dired-dragon-individual | window stays open and you can drag all the files | |
dired-dragon-stay | All files will be dropped into the same place but the window will stick around | -a |
(use-package dired-dragon
:straight (:host github
:repo "jeetelongname/dired-dragon"))
;; packages.el
(package! dired-dragon :recipe (:host github
:repo "jeetelongname/dired-dragon"))
;; config.el
(use-package! dired-dragon)
if you are on a distro that names dragon differently cough arch then you can change the
variable dired-dragon-location
to the name and or location of your choice
(setq dired-dragon-location (executable-find "the name of the executable"))
;; using executable find is a little better as it does not hard code the location
;; but this is optional, just provide it with a full path (eg /usr/bin/dragon)
If you are a doom emacs user (like me) then this snippet will help
;; config.el
(use-package! dired-dragon
:after dired
:config
(map! :map dired-mode-map
(:prefix "C-d" ;; I don't use `C-d' all to much in dired thus the remap
:n "d" #'dired-dragon
:n "s" #'dired-dragon-stay
:n "i" #'dired-dragon-individual)))
This should be a copy and paste affair but I don’t use vanilla extensively
(use-package dired-dragon
:straight (:host github
:repo "jeetelongname/dired-dragon")
;; if you use use-package for bindings
:bind (:map dired-mode-map
("C-d d" . dired-dragon)
("C-d s" . dired-dragon-stay)
("C-d i" . dired-dragon-individual))
;; if you don't
(define-key dired-mode-map (kbd "C-d d") 'dired-dragon)
(define-key dired-mode-map (kbd "C-d s") 'dired-dragon-stay)
(define-key dired-mode-map (kbd "C-d i") 'dired-dragon-individual))
yeah this is not ideal and a me issue (not a dragon issue) if this is still here then I have forgotten about this entry or its not fixed.
Issue’s are welcome! Pull requests as well. This is my first “formal” package so any pointers would be appreciated