After going through the renaming guides from the doc folder in vim I found a way to replace text with the input :%s/frompattern/topattern/g
.
Reaching the renaming files with the file browser tutorial/guide I managed to learn the MR and R method stated in the netrw-R help file.
Then I tried to use the text replacing method on multiple files like so:
:set ma
:%s/frompattern/topattern/g
All the files changed after backspacing the :
requested from the notification
"Press Enter or Type Command To Continue".
All files changed unfortunately those changes have only been made inside vim , no files have been altered.
Is there a way to apply the changes after renaming them that way or is that input strictly for text inside a file/document ?
Trying to exit vim through :x
assuming it would apply changes gives me:
E45: 'readonly' option is set (add ! to override)
Press Enter or Type Command To Continue
Trying to exit with :x!
gives me:
"/home/user/VimLearning/"
E502: "/home/user/VimLearning/" is a directory
Press ENTER or type command to continue
I can only exit with :qa!
This post explains the same technique as the NetRw-R help file but better in my opinion.
But the question remains as to renaming multiple files via :%s/frompattern/topattern/g
and applying those changes. Would it be possible ?
Thanks for all the answers , I am really enjoying learning Vim and the QMV suggestion that was posted here. In the NetRw-R help file there is this info:
The g:netrw_rename_cmd variable is used to implement remote renaming. By default its value is:
ssh HOSTNAME mv
One may rename a block of files and directories by selecting them with V (linewise-visual) when using thin style.
The latter is what I am interested in. Renaming a block of files and directories. There are no examples. Would anyone be kind enough to point me towards one ? Or has that feature been removed or it is only for the renaming of remote files and folders as the text above it would mention ? Would that work the same as QMV ? Thank you guys , this community has been very helpful.
vidir
,qmv
and the such for that. Orvifm
file manager.