Skip to content

When bulk moving, set destination based on the directory under cursor #2395

@raine

Description

@raine

Describe the solution you'd like

When using bulk move (bmv) to move files, it would be great if the directory on the line where cursor is located would be set automatically in the prompt that appears when initiating bulk move:

Move to: /path/to/directory/where/cursor/is

Currently the prompt is set the current working directory.

Would be awesome, thanks.

Activity

alex-courtis

alex-courtis commented on Sep 2, 2023

@alex-courtis
Member

I noticed this the other day. This prompt is inconsistent with other operations e.g. paste and is not very useful.

Options:

  1. Set the path based on the node as above
  2. Just move without a prompt

We could combine the two with an option:

marks.bulk.move({opts})                      *nvim-tree-api.marks.bulk.move()*
    Move all marked nodes to the folder under the cursor.
    Uses the parent folder when the cursor is on a file.

    Parameters: ~{opts} (table) optional parameters

    Options: ~{prompt} (boolean) prompt for a directory before moving

It's a break, but I think it's a reasonable one. What do you reckon @gegoune ?

gegoune

gegoune commented on Sep 2, 2023

@gegoune
Collaborator

I don't mind breaking changes.

But if we are breaking do we want to do anything else as well? Do we maybe want to add path that will move files to that directory. Not sure how useful it is. Actually, adding it later wouldn't really be a breaking change, would it?

alex-courtis

alex-courtis commented on Sep 3, 2023

@alex-courtis
Member

Do we maybe want to add path that will move files to that directory. Not sure how useful it is.

That would be rather useful.

opts can always be added to later without breaking, however it would be convenient to just do it now.

marks.bulk.move({opts})                      *nvim-tree-api.marks.bulk.move()*
    Move all marked nodes to the folder under the cursor.
    Uses the parent folder when the cursor is on a file.

    Parameters: ~{opts} (table) optional parameters

    Options: ~{prompt} (boolean) prompt for a directory before moving
      • {path}   (string) absolute or relative destination path, overriding the node's
alex-courtis

alex-courtis commented on Sep 3, 2023

@alex-courtis
Member

It may be possible to add a path to fs.paste however I think I'm feature creeping here.

added 2 commits that reference this issue on Mar 2, 2024
added 5 commits that reference this issue on Mar 6, 2024
added a commit that references this issue on Mar 15, 2024
cfea5bd

1 remaining item

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @raine@alex-courtis@gegoune

      Issue actions

        When bulk moving, set destination based on the directory under cursor · Issue #2395 · nvim-tree/nvim-tree.lua