Created
February 2, 2017 15:42
-
-
Save djromero/124bdf544bb1d6d5f98d6a40ac429907 to your computer and use it in GitHub Desktop.
Simple shell script to move a file to ~/.Trash To invoke it in tig status view just pressing backspace.
This file contains hidden or 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
#!/bin/sh | |
# | |
# Move a file to ~/.Trash safely in tig status view. | |
# | |
# Copy it somewhere in your PATH and add to ~/.tigrc: | |
# | |
# bind status <Backspace> !trash.sh "%(file)" | |
# | |
path=$1 && shift | |
date_prefix=$(date +'%Y%m%d.%H%M%S') | |
file_name=$(basename ${path}) | |
/bin/mv -f "${path}" "${HOME}/.Trash/${date_prefix}-${file_name}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment