Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I move a file to another directory? #460

Closed
Kurren123 opened this issue Aug 2, 2024 · 6 comments
Closed

How can I move a file to another directory? #460

Kurren123 opened this issue Aug 2, 2024 · 6 comments

Comments

@Kurren123
Copy link

Is it possible to move a file from its current directory to a different one using oil.nvim?

I know we can move it to a subdirectory by putting NewDir/ in front of the file name. But moving it out of the current directory will require printing the file path relative to a root folder.

@TheLeoP
Copy link
Contributor

TheLeoP commented Aug 6, 2024

  1. Cut the file from the current directory by putting the cursor above it and dd
  2. Navigate to the target directory (using telescope/fzf-lua, :e, or the builtin - keymap to go up a directory)
  3. Paste the file p
  4. Save the buffer :w

@Kurren123
Copy link
Author

Thank you!

@sbushmanov
Copy link

sbushmanov commented Sep 19, 2024

What if I'm pasting between 2 nvim instances opened on tmux?

I'm getting error on write:

Error detected while processing BufWriteCmd Autocommands for "oil://*":
Error parsing oil buffers

@TheLeoP
Copy link
Contributor

TheLeoP commented Sep 19, 2024

Oil keeps track of each file by assigning an ID to it. The ID is local to each Neovim instance. So, you can't do file operations betweens different Neovim instances

@sbushmanov
Copy link

sbushmanov commented Sep 19, 2024

@TheLeoP
Thanks, got it.
Can you suggest then how to paste a file to the desired directory in the Telescope window?

image

Pressing p does nothing for me

@windowsrefund
Copy link

From an efficiency perspective, that just seems like an odd (wrong) thing to want to do? Strikes me as...

  1. I just entered my house through the front door and am standing in the lobby.
  2. I see the kitchen is straight ahead and realize I want a beer from the fridge.
  3. I turn around, exit through the front door I just entered.
  4. I walk around the house and enter through the back patio door and proceed toward the fridge.

In fact, that may have been generous as we may actually be talking about breaking a window.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants