Created
January 22, 2020 16:18
-
-
Save romuald/2bf303f194e001841c8f6d11cc0077f8 to your computer and use it in GitHub Desktop.
Sublime text alias, with +lineno option
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/bash | |
# Allow to use the subl command with +linenumber to go to line number (like vim) | |
# example: subl filename.py +208 | |
original=/usr/bin/subl | |
last="${@: -1}" | |
prev="${@:~1:1}" | |
if [ "$#" -gt 1 ] && [ -n "$last" ] && [ -n "$prev" ] && [[ "$last" =~ ^\+ ]]; then | |
$original "${@:1:$#-1}" "$prev:${last:1:64}" | |
else | |
$original $@ | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment