In Vim, is there a way to move the selected text into <current_file>.bak, appending or prepending?
If possible, the backup file should not be displayed.
I envision the workflow to be:
- Select some text
- Type
:sbak - The selection is saved into
<current_file>.bak
You can do it in three steps:
:'<,'>w! >>file.bakto save selected lines tofile.bak(append)You can write a user-defined command
Sbakif you like: