More inline rename shortcuts

I'd like to see a few extra additions to the already useful set of shortcuts able to be performed when inline renaming is active (e.g. Ctrl+L for converting the selected text to lowercase). I do a lot of item creation and naming and could see the following come in handy.

Additions:

  • Ctrl+Space: Convert hyphens (technically, hyphen-minuses) and underscores to spaces.

  • Ctrl+-: Convert spaces to hyphen-minuses.

    • E.g. "hello{space}{space}world" to "hello--world" (the forum post formatting condenses two spaces into a single). That is to say, don't trim >1 consecutive space down to a single hyphen-minus.

    • I'd argue this (and the previous shortcut) shouldn't apply to hyphens which are typographical, such as the dash ‐, the hyphen ‐, or en-/em-dashes –/—, i.e. only affect the hyphen-minus character - (typically found on keyboards).

  • Ctrl+Shift+-: Convert spaces to underscores.

    • Currently, a bug is present as this shortcut produces , which—when confirming the new item name—fails due to the zero-width illegal character.
  • Ctrl+J: Join all words, i.e. remove all spaces.

  • Ctrl+R: Replace special/illegal characters in the item name with a user-defined character defined via the Preferences, say by default, a space.

  • Ctrl+\: Clean the item name of special/illegal characters.

    • Mostly useful for ridding of /s, or if using the paste as-is shortcut suggestion below.

    • This and the previous shortcut would make pasting in a URI or any other string that may contain characters which would either create a directory structure or perform some other special operation, not do so, but instead be stripped down to a plain and valid item name.

  • Ctrl+Shift+V: Paste the string as-is, including illegal characters. Obviously, if the name was confirmed in this state, it shouldn't be allowed, but being able to paste the string as-is would give one the opportunity to convert illegal characters (using Ctrl+R above) to underscores, for example. Currently, pasting https://example.com/?query=abc&search=1 is automatically formatted as https/example.com/query=abc&search=1 and so illegal characters have been stripped and therefore couldn't be manually replaced, e.g. to produce https___example.com__query=abc&search=1.

Improvements:

  • Ctrl+P: It could be nice if the first word after every period which is followed by a space is also capitalised, not only the very first letter of the item name. I'm guessing this shortcut was implemented because a true sentence case is unnecessarily complex to program. This faux sentence case feature could be assigned to Ctrl+S instead, but then both the P and S variant would almost be identical and I am not sure how useful they'd be as separate functions.

Nice to have, but likely not worth the effort:

  • Ctrl+T: Title case: example: "The Quick Brown Fox Jumps over the Lazy Dog".

    • Title case varies from standard to standard so one size wouldn't fit all, and I imagine this feature would need a few dictionaries and ways to override the default rules to get it working right in practice. Too complicated like a true sentence case.

    • I think using Ctrl+W and then manually lowercasing several words likely is good enough for the time being. What could help this manual approach is if one could hold Ctrl and double-click and highlight multiple words, and then Ctrl+L the selected words at once, but I'm not sure such a thing is even possible to implement with the current fields in use (never seen this in any software).

Thanks!

- Directory Opus v12.26 x64 Build 8006
- Windows 11 Pro v21H2 Build 22000.376
1 Like

A proper Opus-style solution would be to introduce a new section in the hotkey list and allow us to write our own inline rename scripts.

2 Likes

I wouldn't be against that and would in fact would like to see it, but some additional defaults provided with Opus wouldn't hurt either. The ones related to operating on underscores, hyphens, and spaces in particular are probably useful to almost everyone (not just programmers who usually need to name things without whitespaces; an image downloaded from the 'net with underscores for spaces could be quickly tidied up with such shortcuts).