Created
January 26, 2023 16:50
-
-
Save jdugarte/bdfe4c4cf58a280cb58537b8a02e56ce to your computer and use it in GitHub Desktop.
TextMate - Copy current file relative path
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
[[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh" | |
TM_PROJECT_DIRECTORY="$TM_PROJECT_DIRECTORY/" | |
echo -n "${TM_FILEPATH#$TM_PROJECT_DIRECTORY}" | pbcopy | |
echo 'Relative path copied to clipboard: '"${TM_FILEPATH#$TM_PROJECT_DIRECTORY}" |
Author
jdugarte
commented
Jan 26, 2023
- Bundles -> Edit Bundles...
- Press Cmd+N to create New Bundle
- Press Cmd+N to create Command
- Paste the code above to the bundle editor and set
- Input: Nothing
- Output: Show in Tool Tip
- Key Equivalent to something like Cmd+Shift+P
- Save bundle (Cmd+S)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment