1

Lesson learned, never use Vim's 'd' to move a large chunk of code from file to file. Need to move a large chunk of Rust code from one file to another, when I quit the session and edit the file needs to be pasted, the entire content, disappeared, divided into atoms.

Edit: I found that the 'd' command means 'delete command', so that may explain why. But still.

Comments
  • 0
    Add the following line to .vimrc if you want Vim to directly sync the copied/deleted data with the system clipboard:

    set clipboard=unnamedplus

    Then yank the text (or delete if you wanna live dangerously) and then press `p` in the other file.

    Or you can open the other file directly in the same Vim session with `:e <other file path>`, though if the current file has unsaved changes that only works if you have `set hidden` set.
  • 0
    Won't do you much good now, but for future reference: configure vim to use "persistent undo*, this will allow you to re-open the file you deleted from and simply u(ndo) your delete 😊
Add Comment