Smirnov Olexandr
Smirnov Olexandr
ss2316544@gmail.com Update kitty bg color, nvim config. Add bgcolor function in zshrc for set specific bg color, hot keys for archiving in vifm, 5 years ago
ss2316544@gmail.com Update kitty bg color, nvim config. Add bgcolor function in zshrc for set specific bg color, hot keys for archiving in vifm, 5 years ago
| 1 | #!/bin/sh |
| 2 | add() { |
| 3 | local file="$1" |
| 4 | echo $file >> .gitignore |
| 5 | } |
| 6 | del() { |
| 7 | local file="$1" |
| 8 | sed -i "/$file/d" .gitignore |
| 9 | } |
| 10 | edit() { |
| 11 | local oldname="$1" |
| 12 | local newanme="$2" |
| 13 | sed -in "s|$oldname|$newanme|g" .gitignore |
| 14 | } |
| 15 | show() { |
| 16 | if [ -f '/usr/bin/bat' ] |
| 17 | then |
| 18 | bat .gitignore |
| 19 | else |
| 20 | cat .gitignore |
| 21 | fi |
| 22 | } |
| 23 | |
| 24 | case "$1" in |
| 25 | add|a) shift; add "$@" ;; |
| 26 | del|d) shift; del "$@" ;; |
| 27 | mv) shift; edit "$@" ;; |
| 28 | show|s) shift; show ;; |
| 29 | help) echo "add/a - filename add to ignore" |
| 30 | echo "del/d - filename del from ignore" |
| 31 | echo "mv - oldname newname chage file name" |
| 32 | echo "show - show ignore file" |
| 33 | ;; |
| 34 | *) echo "Command is not valid" |
| 35 | esac |