1. :r !ls *.png
1、:r, read file into buffer
2. :%s/.*/mv & &/
:[range]s/
In the replacement string, & represents the matched pattern
%, every line
s, substitute
参考:https://nosarthur.github.io/productivity/2021/08/27/ex-vim.html
3. :w !sh
1、:w, write to file
!sh 执行
整体参考https://www.reddit.com/r/vim/comments/b14wef/bulk_renaming_with_rangervim_short_video_tutorial/
转载请注明:牛哥678 » vim: rename files