File tree Expand file tree Collapse file tree 1 file changed +28
-1
lines changed
Expand file tree Collapse file tree 1 file changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -336,8 +336,35 @@ add-shadow() {
336336 convert " $1 " -trim \( +clone -background grey25 -shadow 80x40+5+30 \) +swap -background transparent -layers merge +repage " $1 -shadow.png"
337337}
338338
339+ cw () {
340+ MESSAGE=" ${1:- work} "
341+ git add -u && git commit -m " $MESSAGE " && git push
342+ }
343+
339344v () {
340- nvim $( fzf)
345+ FILE=$( fzf)
346+ print -s " nvim $FILE "
347+ nvim " $FILE "
348+ }
349+
350+ # print bytes in human readable format
351+ bytes () {
352+ BYTE_COUNT=" $1 "
353+ if [ -z " $BYTE_COUNT " ]; then
354+ echo " Usage: bytes <number_of_bytes>"
355+ return 1
356+ fi
357+ if [ " $BYTE_COUNT " -lt 1024 ]; then
358+ echo " ${BYTE_COUNT} B"
359+ elif [ " $BYTE_COUNT " -lt $(( 1024 ** 2 )) ]; then
360+ echo " $(( BYTE_COUNT / 1024 )) KB"
361+ elif [ " $BYTE_COUNT " -lt $(( 1024 ** 3 )) ]; then
362+ echo " $(( BYTE_COUNT / 1024 ** 2 )) MB"
363+ elif [ " $BYTE_COUNT " -lt $(( 1024 ** 4 )) ]; then
364+ echo " $(( BYTE_COUNT / 1024 ** 3 )) GB"
365+ else
366+ echo " $(( BYTE_COUNT / 1024 ** 4 )) TB"
367+ fi
341368}
342369
343370installdeb () {
You can’t perform that action at this time.
0 commit comments