Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -488,8 +488,10 @@ prefix argument, add the marked files to the current clipboard.
Past clipboards are stored in `dired-ranger-copy-ring` so you can
repeat the past pastes.

Call `dired-ranger-paste` or `dired-ranger-move` to copy or move
the files in the current clipboard to the current dired buffer.
Call `dired-ranger-paste`, `dired-ranger-move`, `dired-ranger-hardlink`,
`dired-ranger-symlink`, or `dired-ranger-symlink-relative` to
paste, move, hardlink, symlink, or create a reliative symlink from
the files in the current clipboard to the current dired buffer respectively.
With raw prefix argument (usually C-u), the clipboard is not
cleared, so you can repeat the copy operation in another dired
buffer.
Expand Down
41 changes: 41 additions & 0 deletions dired-ranger.el
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,47 @@ instead of copying them."
#'dired-ranger--name-constructor ?M)
(unless arg (ring-remove dired-ranger-copy-ring 0))))

;;;###autoload
(defun dired-ranger-symlink (arg)
"Symlink the items from copy ring to current directory.

This behaves like `dired-ranger-paste' but symlinks the files
instead of copying them."
(interactive "P")
(let* ((index (if (numberp arg) arg 0))
(data (ring-ref dired-ranger-copy-ring index))
(files (cdr data)))
(dired-create-files #'make-symbolic-link "Symlink" files
#'dired-ranger--name-constructor ?S)
(unless arg (ring-remove dired-ranger-copy-ring 0))))

;;;###autoload
(defun dired-ranger-symlink-relative (arg)
"Create a relative symlink for the items from copy ring to current directory.

This behaves like `dired-ranger-paste' but symlinks the files
instead of copying them."
(interactive "P")
(let* ((index (if (numberp arg) arg 0))
(data (ring-ref dired-ranger-copy-ring index))
(files (cdr data)))
(dired-create-files #'dired-make-relative-symlink "Symlink Relative" files
#'dired-ranger--name-constructor ?R)
(unless arg (ring-remove dired-ranger-copy-ring 0))))

;;;###autoload
(defun dired-ranger-hardlink (arg)
"Create a hardlink for the items from copy ring to current directory.

This behaves like `dired-ranger-paste' but hardlinks the files
instead of copying them."
(interactive "P")
(let* ((index (if (numberp arg) arg 0))
(data (ring-ref dired-ranger-copy-ring index))
(files (cdr data)))
(dired-create-files #'dired-hardlink "Hardlink" files
#'dired-ranger--name-constructor ?H)
(unless arg (ring-remove dired-ranger-copy-ring 0))))

;; bookmarks
(defcustom dired-ranger-bookmark-reopen 'ask
Expand Down