Skip to main content
simplify explanation, mention deleting the buffer
Source Link

To delete the file temporarily

:!rm %

, execute :!rm % is. % expands to the currently opened file

Ctrl+Z, stopsfile's name. Vim doesn't automatically delete the process

checkbuffer, but you can manually do so with ls:bd, file no longer on the disk.

fg brings back To verify that the file on vim

you can save ithas been deleted, using regular vim commandsexecute !ls.

To delete the file temporarily

:!rm %

% is the currently opened file

Ctrl+Z, stops the process

check with ls, file no longer on the disk

fg brings back the file on vim

you can save it, using regular vim commands

To delete the file, execute :!rm %. % expands to the file's name. Vim doesn't automatically delete the buffer, but you can manually do so with :bd.

To verify that the file has been deleted, execute !ls.

improved formatting
Source Link
Thomas
  • 6.6k
  • 8
  • 31
  • 34

To delete the file temporarily

:!rm %

:!rm %

%% is the currently opened file

Control ZCtrl+Z, stops the process

check with lsls, file no longer on the disk

fgfg brings back the file on vim

you can save it, using regular vim commands

To delete the file temporarily

:!rm %

% is the currently opened file

Control Z, stops the process

check with ls, file no longer on the disk

fg brings back the file on vim

you can save it, using regular vim commands

To delete the file temporarily

:!rm %

% is the currently opened file

Ctrl+Z, stops the process

check with ls, file no longer on the disk

fg brings back the file on vim

you can save it, using regular vim commands

Source Link
Justin
  • 81
  • 1
  • 1

To delete the file temporarily

:!rm %

% is the currently opened file

Control Z, stops the process

check with ls, file no longer on the disk

fg brings back the file on vim

you can save it, using regular vim commands