diff --git a/.config/fish/conf.d/fisher.fish b/.config/fish/conf.d/fisher.fish new file mode 100644 index 0000000..b1e84fd --- /dev/null +++ b/.config/fish/conf.d/fisher.fish @@ -0,0 +1 @@ +fisher copy-user-key-bindings diff --git a/.config/fish/config.fish.backup b/.config/fish/config.fish.backup deleted file mode 100644 index 035bb24..0000000 --- a/.config/fish/config.fish.backup +++ /dev/null @@ -1,18 +0,0 @@ - switch (tty) - case "/dev/tty1" - tbsm - end -# THEME PURE # -set fish_function_path /home/glados/.config/fish/functions/theme-pure $fish_function_path -set -U fish_user_paths /usr/local/bin - -set -Ux ANDROID_HOME /mnt/LocalDiskD/Source/android/sdk -set -Ux EDITOR nvim -set -Ux D /mnt/LocalDiskD -set -Ux FZF_DEFAULT_COMMAND 'ff' -set -Ux PAGER "nvim -c 'set ft=man' -" - - -source /usr/share/autojump/autojump.fish - -xrdb ~/.Xresources diff --git a/.config/fish/fishfile b/.config/fish/fishfile new file mode 100644 index 0000000..064e958 --- /dev/null +++ b/.config/fish/fishfile @@ -0,0 +1 @@ +rafaelrinaldi/pure diff --git a/.config/fish/functions/__format_time.fish b/.config/fish/functions/__format_time.fish new file mode 100644 index 0000000..1831dbf --- /dev/null +++ b/.config/fish/functions/__format_time.fish @@ -0,0 +1,27 @@ +function __format_time -d "Format milliseconds to a human readable format" + set -l milliseconds $argv[1] + set -l seconds (math "$milliseconds / 1000 % 60") + set -l minutes (math "$milliseconds / 60000 % 60") + set -l hours (math "$milliseconds / 3600000 % 24") + set -l days (math "$milliseconds / 86400000") + set -l time + set -l threshold $argv[2] + + if test $days -gt 0 + set time (command printf "$time%sd " $days) + end + + if test $hours -gt 0 + set time (command printf "$time%sh " $hours) + end + + if test $minutes -gt 0 + set time (command printf "$time%sm " $minutes) + end + + if test $seconds -gt $threshold + set time (command printf "$time%ss " $seconds) + end + + echo -e $time +end diff --git a/.config/fish/functions/__parse_current_folder.fish b/.config/fish/functions/__parse_current_folder.fish new file mode 100644 index 0000000..3a1bcef --- /dev/null +++ b/.config/fish/functions/__parse_current_folder.fish @@ -0,0 +1,3 @@ +function __parse_current_folder -d "Replace '$HOME' with '~'" + string replace $HOME '~' $PWD +end diff --git a/.config/fish/functions/__parse_git_branch.fish b/.config/fish/functions/__parse_git_branch.fish new file mode 100644 index 0000000..a0d7532 --- /dev/null +++ b/.config/fish/functions/__parse_git_branch.fish @@ -0,0 +1,4 @@ +function __parse_git_branch -d "Parse current Git branch name" + command git symbolic-ref --short HEAD ^/dev/null; + or echo (command git show-ref --head -s --abbrev HEAD)[1] +end diff --git a/.config/fish/functions/__pure_set_default.fish b/.config/fish/functions/__pure_set_default.fish new file mode 100644 index 0000000..9830458 --- /dev/null +++ b/.config/fish/functions/__pure_set_default.fish @@ -0,0 +1,5 @@ +function __pure_set_default -S -a var default + if not set -q $var + set -g $var $default + end +end diff --git a/.config/fish/functions/fish_right_prompt.fish b/.config/fish/functions/fish_right_prompt.fish new file mode 100644 index 0000000..89f92ac --- /dev/null +++ b/.config/fish/functions/fish_right_prompt.fish @@ -0,0 +1,3 @@ +# Removes right prompt +function fish_right_prompt +end