Useful bash commands for editing the text on each line of a multi-line selection in Sublime Text. Copy selections to the clipboard, run the command, paste modified selections back in the document.
Math with numbers, adds +1
to each and evaluates it with bc
:
pbpaste | sed 's/$/+1/' | bc | perl -pe 'chomp if eof' | pbcopy
First letter to uppercase:
pbpaste | perl -lpe's/^(.*)/\U$1/' | perl -pe 'chomp if eof' | pbcopy
First letter to lowercase:
pbpaste | perl -lpe's/^(.*)/\L$1/' | perl -pe 'chomp if eof' | pbcopy