ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Bulk Renamer

by guille ALL

Bulk rename directory files in Sublime Text

Labels utilities

Details

Installs

  • Total 30
  • Win 13
  • Mac 9
  • Linux 8
Oct 14 Oct 13 Oct 12 Oct 11 Oct 10 Oct 9 Oct 8 Oct 7 Oct 6 Oct 5 Oct 4 Oct 3 Oct 2 Oct 1 Sep 30 Sep 29 Sep 28 Sep 27 Sep 26 Sep 25 Sep 24 Sep 23 Sep 22 Sep 21 Sep 20 Sep 19 Sep 18 Sep 17 Sep 16 Sep 15 Sep 14 Sep 13 Sep 12 Sep 11 Sep 10 Sep 9 Sep 8 Sep 7 Sep 6 Sep 5 Sep 4 Sep 3 Sep 2 Sep 1 Aug 31 Aug 30
Windows 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0
Mac 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

Sublime Bulk Renamer

Sublime Bulk Renamer (sbr) allows you to bring the power of Sublime Text to… rename files in a directory.

Heavily inspired by oil.nvim and nnn's batch renamer. If you haven't used those, a video is perhaps the best way to introduce it:

https://github.com/user-attachments/assets/d457768d-2ce0-40ad-8a40-f22da839e094

Features

  • You can do basically anything that Sublime and Python's Pathlib support.
  • Handles cycles and chains gracefully, so you can swap the name of two files without worrying about data loss or overridding them accidentally.
  • This also allows you to quickly open Sublime Text to bulk rename the current directory from your terminal, for example (Linux/OSX):
subl --command 'sbr_bulk_rename_in_dir {"dirs": ["'"$(pwd)"'"]}'

Limitations

  • Unlike oil.nvim, this package does not allow creating or deleting files. This is intentionally not considered and is very unlikely to get added later on.
  • Since sbr uses the # character for comments in the View that gets opened for renaming, the end state of a directory can't have any children whose name begin with #. Sorry! I might add escapes (\#) at some point if anyone really needs it.

Future work

  • add confirmation prompt on exit (settings-based)
  • add visual indicators of file vs dir, maybe with annotation with the original name
  • bulk rename including subdirectories, with configurable default depth
  • (maybe) add side bar menu item for files, to bulk rename parent dir