Last active
January 21, 2022 01:08
-
-
Save celadevra/641f179e7519c3dc2546fa4104e165ad to your computer and use it in GitHub Desktop.
Fish shell customizations
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
| function fish_prompt -d "Write out the prompt" | |
| set -g last_status $status | |
| printf '[%s@%s %s%s%s]\n(%s%s/%s%s) %s%s%s > ' $USER $hostname \ | |
| (set_color cyan) (prompt_date) (set_color normal) \ | |
| (set_color yellow) $SHLVL (prompt_status) (set_color normal) \ | |
| (set_color $fish_color_cwd) $PWD (set_color normal) | |
| end | |
| function prompt_date -d "Show date and time in prompt" | |
| date "+%Y.%m.%d %H:%M" | |
| end | |
| function prompt_status -d "Show exit status" | |
| set -l red (set_color -o red) | |
| set -l green (set_color -o green) | |
| if test $last_status = 0 | |
| echo "$greenโ" | |
| else | |
| echo $red$last_status | |
| end | |
| end |
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
| function na; | |
| task log +memo $argv; | |
| end | |
| function nl; | |
| task +memo comp end:today; | |
| end | |
| function nls; # note list and search | |
| task +memo comp $argv; | |
| end | |
| function ns; # note show | |
| task $argv; | |
| end | |
| function nid; # get note uuids | |
| task +memo uuids $argv; | |
| end | |
| function nlk -a src dst; # link notes | |
| task $src annotate "๐ $dst" && task $dst annotate "๐ $src"; | |
| end | |
| function nfu -a src; # follow up notes | |
| set -l new_note $argv[2..-1]; | |
| task log +memo $new_note; | |
| set -l last_id (task +memo entry:today all 2>/dev/null | grep -E '(^[0-9]{1,2} | - )[A-Z]' | awk '{print $3}' | head -n1) | |
| echo "Modifying $src and $last_id" | |
| task $src annotate "๐ $last_id" && task $last_id annotate "๐ $src"; | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment