Skip to content

dragon bindings for our favorite file manager

License

Notifications You must be signed in to change notification settings

mjkalyan/dired-dragon

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 

Repository files navigation

dragon bindings for dired

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.

Table of Contents

In-File Commands

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

CommandUseFlagRequires
:dragan evil ex command to drag the current buffer and quit-xevil
dired-dragon-current-filea vanilla version of the :drag command-xNothing

In-Dired Commands

These commands are meant to be used in dired.

CommandsUseFlag(s)
dired-dragonThe Default, drags all and closes after one drop-x -a
dired-dragon-individualwindow stays open and you can drag all the files
dired-dragon-stayAll files will be dropped into the same place but the window will stick around-a

Installation

Straight

(use-package dired-dragon
  :straight (:host github
             :repo "jeetelongname/dired-dragon"))

Doom

;; packages.el
(package! dired-dragon :recipe (:host github
                                :repo "jeetelongname/dired-dragon"))
;; config.el
(use-package! dired-dragon)

Configuring

Variables

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)

Some pre-made configurations

Doom Emacs

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)))

Vanilla

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))

Known Bugs

The file will not open if there are spaces in the name.

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.

Contributing

Issue’s are welcome! Pull requests as well. This is my first “formal” package so any pointers would be appreciated

About

dragon bindings for our favorite file manager

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Emacs Lisp 100.0%