diff --git a/fish/.config/fish/.fishfile.swp b/fish/.config/fish/.config.fish.swp similarity index 92% rename from fish/.config/fish/.fishfile.swp rename to fish/.config/fish/.config.fish.swp index c5e1f76..23cf17c 100644 Binary files a/fish/.config/fish/.fishfile.swp and b/fish/.config/fish/.config.fish.swp differ diff --git a/fish/.config/fish/conf.d/_pure_init.fish b/fish/.config/fish/conf.d/_pure_init.fish deleted file mode 100644 index 04b45d8..0000000 --- a/fish/.config/fish/conf.d/_pure_init.fish +++ /dev/null @@ -1,8 +0,0 @@ -# Deactivate the default virtualenv prompt so that we can add our own -set --global --export VIRTUAL_ENV_DISABLE_PROMPT 1 - -# Whether or not is a fresh session -set --global _pure_fresh_session true - -# Register `_pure_prompt_new_line` as an event handler fot `fish_prompt` -functions -q _pure_prompt_new_line diff --git a/fish/.config/fish/conf.d/pure.fish b/fish/.config/fish/conf.d/pure.fish deleted file mode 100644 index 396fa93..0000000 --- a/fish/.config/fish/conf.d/pure.fish +++ /dev/null @@ -1,66 +0,0 @@ -set --global pure_version 2.5.2 # used for bug report - -# Base colors -_pure_set_default pure_color_primary blue -_pure_set_default pure_color_info cyan -_pure_set_default pure_color_mute brblack -_pure_set_default pure_color_success magenta -_pure_set_default pure_color_normal normal -_pure_set_default pure_color_danger red -_pure_set_default pure_color_light white -_pure_set_default pure_color_warning yellow -_pure_set_default pure_color_dark black - -# Prompt -_pure_set_default pure_symbol_prompt "❯" -_pure_set_default pure_symbol_reverse_prompt "❮" # used for VI mode -_pure_set_default pure_color_prompt_on_error pure_color_danger -_pure_set_default pure_color_prompt_on_success pure_color_success - -# Current Working Directory -_pure_set_default pure_color_current_directory pure_color_primary - -# Git -_pure_set_default pure_enable_git true -_pure_set_default pure_symbol_git_unpulled_commits "⇣" -_pure_set_default pure_symbol_git_unpushed_commits "⇡" -_pure_set_default pure_symbol_git_dirty "*" -_pure_set_default pure_color_git_unpulled_commits pure_color_info -_pure_set_default pure_color_git_unpushed_commits pure_color_info -_pure_set_default pure_color_git_branch pure_color_mute -_pure_set_default pure_color_git_dirty pure_color_mute - -# SSH info -_pure_set_default pure_color_ssh_hostname pure_color_mute -_pure_set_default pure_color_ssh_separator pure_color_mute -_pure_set_default pure_color_ssh_user_normal pure_color_mute -_pure_set_default pure_color_ssh_user_root pure_color_light - -# Number of running jobs -_pure_set_default pure_show_jobs false -_pure_set_default pure_color_jobs pure_color_normal - -# Virtualenv for Python -_pure_set_default pure_color_virtualenv pure_color_mute - -# Print current working directory at the beginning of prompt -# true (default): current directory, git, user@hostname (ssh-only), command duration -# false: user@hostname (ssh-only), current directory, git, command duration -_pure_set_default pure_begin_prompt_with_current_directory true - -# Show exit code of last command as a separate prompt character (cf. https://github.com/sindresorhus/pure/wiki#show-exit-code-of-last-command-as-a-separate-prompt-character) -# false - single prompt character, default -# true - separate prompt character -_pure_set_default pure_separate_prompt_on_error false - -# Max execution time of a process before its run time is shown when it exits -_pure_set_default pure_threshold_command_duration 5 -_pure_set_default pure_color_command_duration pure_color_warning - -# VI mode indicator -# true (default): indicate a non-insert mode by reversing the prompt symbol (❮) -# false: indicate vi mode with [I], [N], [V] -_pure_set_default pure_reverse_prompt_symbol_in_vimode true - -# Title -_pure_set_default pure_symbol_title_bar_separator "—" diff --git a/fish/.config/fish/config.fish b/fish/.config/fish/config.fish index 31c824e..ee988c6 100644 --- a/fish/.config/fish/config.fish +++ b/fish/.config/fish/config.fish @@ -5,7 +5,6 @@ set -gx PATH ~/.emacs.d/bin $PATH set -gx PATH ~/.fzf/bin $PATH set -gx PATH ~/.local/bin $PATH set -gx PATH ~/.asdf/install/rust/stable/bin $PATH -set -gx SLACK_CLI_TOKEN (pass personal/slack/token) fzf_key_bindings set -gx EDITOR vi set -gx XDG_RUNTIME_DIR /run/user/(id -u) diff --git a/fish/.config/fish/fish_variables b/fish/.config/fish/fish_variables index 037ba1a..9429466 100644 --- a/fish/.config/fish/fish_variables +++ b/fish/.config/fish/fish_variables @@ -14,6 +14,7 @@ SETUVAR __fish_init_2_3_0:\x1d SETUVAR __fish_init_3_x:\x1d SETUVAR __tf_func:function\x20__tf_alias\x20\x2dd\x20\x22Correct\x20your\x20previous\x20console\x20command\x22\x3b\x20\x20set\x20\x2dl\x20fucked_up_command\x20\x24history\x5b1\x5d\x3b\x20\x20env\x20TF_SHELL\x3dfish\x20TF_ALIAS\x3d__tf_alias\x20PYTHONIOENCODING\x3dutf\x2d8\x20thefuck\x20\x24fucked_up_command\x20\x7c\x20read\x20\x2dl\x20unfucked_command\x3b\x20\x20if\x20\x5b\x20\x22\x24unfucked_command\x22\x20\x21\x3d\x20\x22\x22\x20\x5d\x3b\x20\x20\x20\x20eval\x20\x24unfucked_command\x3b\x20\x20\x20\x20builtin\x20history\x20delete\x20\x2d\x2dexact\x20\x2d\x2dcase\x2dsensitive\x20\x2d\x2d\x20\x24fucked_up_command\x3b\x20\x20\x20\x20builtin\x20history\x20merge\x20\x5e\x20/dev/null\x3b\x20\x20end\x3bend\x3b SETUVAR __tf_vers:The\x20Fuck\x203\x2e28\x20using\x20Python\x203\x2e7\x2e1\x20and\x20Fish\x20Shell\x202\x2e7\x2e1 +SETUVAR chain_links:chain\x2elinks\x2eroot\x1echain\x2elinks\x2ejobs\x1echain\x2elinks\x2epwd\x1echain\x2elinks\x2evcs_branch\x1echain\x2elinks\x2evcs_dirty\x1echain\x2elinks\x2evcs_stashed SETUVAR fish_color_autosuggestion:555\x1ebrblack SETUVAR fish_color_cancel:\x2dr SETUVAR fish_color_command:\x2d\x2dbold diff --git a/fish/.config/fish/fishfile b/fish/.config/fish/fishfile index 6deaccb..b9ab372 100644 --- a/fish/.config/fish/fishfile +++ b/fish/.config/fish/fishfile @@ -4,4 +4,4 @@ jethrokuan/fzf oh-my-fish/plugin-direnv joseluisq/gitnow fishpkg/fish-git-util -rafaelrinaldi/pure +oh-my-fish/theme-krisleech diff --git a/fish/.config/fish/functions/_pure_format_time.fish b/fish/.config/fish/functions/_pure_format_time.fish deleted file mode 100644 index 0773f6b..0000000 --- a/fish/.config/fish/functions/_pure_format_time.fish +++ /dev/null @@ -1,32 +0,0 @@ -set fail 1 - -function _pure_format_time \ - --description="Format milliseconds to a human readable format" \ - --argument-names milliseconds threshold - - if test $milliseconds -lt 0; return $fail; end - - set --local seconds (math -s0 "$milliseconds / 1000 % 60") - set --local minutes (math -s0 "$milliseconds / 60000 % 60") - set --local hours (math -s0 "$milliseconds / 3600000 % 24") - set --local days (math -s0 "$milliseconds / 86400000") - set --local time - - if test $days -gt 0 - set time $time (printf "%sd" $days) - end - - if test $hours -gt 0 - set time $time (printf "%sh" $hours) - end - - if test $minutes -gt 0 - set time $time (printf "%sm" $minutes) - end - - if test $seconds -gt $threshold - set time $time (printf "%ss" $seconds) - end - - echo -e (string join ' ' $time) -end diff --git a/fish/.config/fish/functions/_pure_get_prompt_symbol.fish b/fish/.config/fish/functions/_pure_get_prompt_symbol.fish deleted file mode 100644 index 5352f58..0000000 --- a/fish/.config/fish/functions/_pure_get_prompt_symbol.fish +++ /dev/null @@ -1,14 +0,0 @@ -function _pure_get_prompt_symbol \ - --description 'Print prompt symbol' \ - --argument-names exit_code - - set --local prompt_symbol $pure_symbol_prompt - set --local is_vi_mode (string match -r "fish_(vi|hybrid)_key_bindings" $fish_key_bindings) - if test -n "$is_vi_mode" \ - -a "$pure_reverse_prompt_symbol_in_vimode" = true \ - -a "$fish_bind_mode" != "insert" - set prompt_symbol $pure_symbol_reverse_prompt - end - - echo "$prompt_symbol" -end diff --git a/fish/.config/fish/functions/_pure_parse_directory.fish b/fish/.config/fish/functions/_pure_parse_directory.fish deleted file mode 100644 index fb3822a..0000000 --- a/fish/.config/fish/functions/_pure_parse_directory.fish +++ /dev/null @@ -1,14 +0,0 @@ -function _pure_parse_directory \ - --description "Replace '$HOME' with '~'" \ - --argument-names max_path_length - - set --local folder (string replace $HOME '~' $PWD) - - if test -n "$max_path_length"; - if test (string length $folder) -gt $max_path_length; - # If path exceeds maximum symbol limit, use default fish path formating function - set folder (prompt_pwd) - end - end - echo $folder -end diff --git a/fish/.config/fish/functions/_pure_parse_git_branch.fish b/fish/.config/fish/functions/_pure_parse_git_branch.fish deleted file mode 100644 index a666f2a..0000000 --- a/fish/.config/fish/functions/_pure_parse_git_branch.fish +++ /dev/null @@ -1,4 +0,0 @@ -function _pure_parse_git_branch --description "Parse current Git branch name" - command git symbolic-ref --short HEAD 2>/dev/null; - or command git name-rev --name-only HEAD 2>/dev/null -end diff --git a/fish/.config/fish/functions/_pure_place_iterm2_prompt_mark.fish b/fish/.config/fish/functions/_pure_place_iterm2_prompt_mark.fish deleted file mode 100644 index b999b7a..0000000 --- a/fish/.config/fish/functions/_pure_place_iterm2_prompt_mark.fish +++ /dev/null @@ -1,5 +0,0 @@ -function _pure_place_iterm2_prompt_mark - if functions -q iterm2_prompt_mark - iterm2_prompt_mark - end -end diff --git a/fish/.config/fish/functions/_pure_print_prompt.fish b/fish/.config/fish/functions/_pure_print_prompt.fish deleted file mode 100644 index 9c0174c..0000000 --- a/fish/.config/fish/functions/_pure_print_prompt.fish +++ /dev/null @@ -1,11 +0,0 @@ -function _pure_print_prompt - set --local prompt - - for prompt_part in $argv - if test (_pure_string_width $prompt_part) -gt 0 - set prompt "$prompt $prompt_part" - end - end - - echo (string trim -l $prompt) -end diff --git a/fish/.config/fish/functions/_pure_prompt.fish b/fish/.config/fish/functions/_pure_prompt.fish deleted file mode 100644 index 3f67704..0000000 --- a/fish/.config/fish/functions/_pure_prompt.fish +++ /dev/null @@ -1,11 +0,0 @@ -function _pure_prompt \ - --description 'Print prompt symbol' \ - --argument-names exit_code - - set --local jobs (_pure_prompt_jobs) - set --local virtualenv (_pure_prompt_virtualenv) # Python virtualenv name - set --local vimode_indicator (_pure_prompt_vimode) # vi-mode indicator - set --local pure_symbol (_pure_prompt_symbol $exit_code) - - echo (_pure_print_prompt $jobs $virtualenv $vimode_indicator $pure_symbol) -end diff --git a/fish/.config/fish/functions/_pure_prompt_beginning.fish b/fish/.config/fish/functions/_pure_prompt_beginning.fish deleted file mode 100644 index 5f00236..0000000 --- a/fish/.config/fish/functions/_pure_prompt_beginning.fish +++ /dev/null @@ -1,6 +0,0 @@ -function _pure_prompt_beginning - # Clear existing line content - set --local clear_line "\r\033[K" - - echo $clear_line -end diff --git a/fish/.config/fish/functions/_pure_prompt_command_duration.fish b/fish/.config/fish/functions/_pure_prompt_command_duration.fish deleted file mode 100644 index d35b3a6..0000000 --- a/fish/.config/fish/functions/_pure_prompt_command_duration.fish +++ /dev/null @@ -1,11 +0,0 @@ -function _pure_prompt_command_duration - set --local command_duration - - # Get command execution duration - if test -n "$CMD_DURATION" - set command_duration (_pure_format_time $CMD_DURATION $pure_threshold_command_duration) - end - set --local command_duration_color (_pure_set_color $pure_color_command_duration) - - echo "$command_duration_color$command_duration" -end diff --git a/fish/.config/fish/functions/_pure_prompt_current_folder.fish b/fish/.config/fish/functions/_pure_prompt_current_folder.fish deleted file mode 100644 index af8e9ee..0000000 --- a/fish/.config/fish/functions/_pure_prompt_current_folder.fish +++ /dev/null @@ -1,11 +0,0 @@ -set fail 1 - -function _pure_prompt_current_folder --argument-names current_prompt_width - - if test -z "$current_prompt_width"; return $fail; end - - set --local current_folder (_pure_parse_directory (math $COLUMNS - $current_prompt_width - 1)) - set --local current_folder_color (_pure_set_color $pure_color_current_directory) - - echo "$current_folder_color$current_folder" -end diff --git a/fish/.config/fish/functions/_pure_prompt_ending.fish b/fish/.config/fish/functions/_pure_prompt_ending.fish deleted file mode 100644 index ba92511..0000000 --- a/fish/.config/fish/functions/_pure_prompt_ending.fish +++ /dev/null @@ -1,3 +0,0 @@ -function _pure_prompt_ending - echo (set_color normal)" " -end diff --git a/fish/.config/fish/functions/_pure_prompt_first_line.fish b/fish/.config/fish/functions/_pure_prompt_first_line.fish deleted file mode 100644 index 6b3f3b6..0000000 --- a/fish/.config/fish/functions/_pure_prompt_first_line.fish +++ /dev/null @@ -1,35 +0,0 @@ -function _pure_prompt_first_line \ - --description 'Print contextual information before prompt.' - - if not type -fq git # exit if git is not available - return 1 - end - - set --local prompt_ssh (_pure_prompt_ssh) - set --local prompt_git (_pure_prompt_git) - set --local prompt_command_duration (_pure_prompt_command_duration) - set --local prompt (_pure_print_prompt \ - $prompt_ssh \ - $prompt_git \ - $prompt_command_duration - ) - set --local prompt_width (_pure_string_width $prompt) - set --local current_folder (_pure_prompt_current_folder $prompt_width) - - set --local prompt_components - if test $pure_begin_prompt_with_current_directory = true - set prompt_components \ - $current_folder \ - $prompt_git \ - $prompt_ssh \ - $prompt_command_duration - else - set prompt_components \ - $prompt_ssh \ - $current_folder \ - $prompt_git \ - $prompt_command_duration - end - - echo (_pure_print_prompt $prompt_components) -end diff --git a/fish/.config/fish/functions/_pure_prompt_git.fish b/fish/.config/fish/functions/_pure_prompt_git.fish deleted file mode 100644 index 140639a..0000000 --- a/fish/.config/fish/functions/_pure_prompt_git.fish +++ /dev/null @@ -1,20 +0,0 @@ -function _pure_prompt_git \ - --description 'Print git repository informations: branch name, dirty, upstream ahead/behind' - - if test $pure_enable_git != true - return - end - - set --local is_git_repository (command git rev-parse --is-inside-work-tree 2>/dev/null) - - if test -n "$is_git_repository" - set --local git_prompt (_pure_prompt_git_branch)(_pure_prompt_git_dirty) - set --local git_pending_commits (_pure_prompt_git_pending_commits) - - if test (_pure_string_width $git_pending_commits) -ne 0 - set git_prompt $git_prompt $git_pending_commits - end - - echo $git_prompt - end -end diff --git a/fish/.config/fish/functions/_pure_prompt_git_branch.fish b/fish/.config/fish/functions/_pure_prompt_git_branch.fish deleted file mode 100644 index 777cd0e..0000000 --- a/fish/.config/fish/functions/_pure_prompt_git_branch.fish +++ /dev/null @@ -1,6 +0,0 @@ -function _pure_prompt_git_branch - set --local git_branch (_pure_parse_git_branch) # current git branch - set --local git_branch_color (_pure_set_color $pure_color_git_branch) - - echo "$git_branch_color$git_branch" -end diff --git a/fish/.config/fish/functions/_pure_prompt_git_dirty.fish b/fish/.config/fish/functions/_pure_prompt_git_dirty.fish deleted file mode 100644 index fbf31e3..0000000 --- a/fish/.config/fish/functions/_pure_prompt_git_dirty.fish +++ /dev/null @@ -1,18 +0,0 @@ -function _pure_prompt_git_dirty - set --local git_dirty_symbol - set --local git_dirty_color - - set --local is_git_dirty ( - # The first checks for staged changes, the second for unstaged ones. - # We put them in this order because checking staged changes is *fast*. - not command git diff-index --ignore-submodules --cached --quiet HEAD -- >/dev/null 2>&1 - or not command git diff --ignore-submodules --no-ext-diff --quiet --exit-code >/dev/null 2>&1 - and echo "true" - ) - if test -n "$is_git_dirty" # untracked or un-commited files - set git_dirty_symbol "$pure_symbol_git_dirty" - set git_dirty_color (_pure_set_color $pure_color_git_dirty) - end - - echo "$git_dirty_color$git_dirty_symbol" -end diff --git a/fish/.config/fish/functions/_pure_prompt_git_pending_commits.fish b/fish/.config/fish/functions/_pure_prompt_git_pending_commits.fish deleted file mode 100644 index 98359c4..0000000 --- a/fish/.config/fish/functions/_pure_prompt_git_pending_commits.fish +++ /dev/null @@ -1,27 +0,0 @@ -function _pure_prompt_git_pending_commits - set --local git_unpushed_commits - set --local git_unpulled_commits - - set --local has_upstream (command git rev-parse --abbrev-ref '@{upstream}' 2>/dev/null) - if test -n "$has_upstream" # check there is an upstream repo configured - and test "$has_upstream" != '@{upstream}' # Fixed #179, dont check the empty repo - command git rev-list --left-right --count 'HEAD...@{upstream}' \ - | read --local --array git_status - set --local commit_to_push $git_status[1] - set --local commit_to_pull $git_status[2] - - if test $commit_to_push -gt 0 # upstream is behind local repo - set --local git_unpushed_commits_color \ - (_pure_set_color $pure_color_git_unpushed_commits) - set git_unpushed_commits "$git_unpushed_commits_color$pure_symbol_git_unpushed_commits" - end - - if test $commit_to_pull -gt 0 # upstream is ahead of local repo - set --local git_unpulled_commits_color \ - (_pure_set_color $pure_color_git_unpulled_commits) - set git_unpulled_commits "$git_unpulled_commits_color$pure_symbol_git_unpulled_commits" - end - end - - echo "$git_unpushed_commits$git_unpulled_commits" -end diff --git a/fish/.config/fish/functions/_pure_prompt_jobs.fish b/fish/.config/fish/functions/_pure_prompt_jobs.fish deleted file mode 100644 index b04fd8c..0000000 --- a/fish/.config/fish/functions/_pure_prompt_jobs.fish +++ /dev/null @@ -1,9 +0,0 @@ -function _pure_prompt_jobs --description "Display number of running jobs" - if test $pure_show_jobs = true - set --local njobs (count (jobs -p)) - set --local jobs_color (_pure_set_color $pure_color_jobs) - if test $njobs -gt 0 - echo "$jobs_color"[$njobs] - end - end -end diff --git a/fish/.config/fish/functions/_pure_prompt_new_line.fish b/fish/.config/fish/functions/_pure_prompt_new_line.fish deleted file mode 100644 index c61a820..0000000 --- a/fish/.config/fish/functions/_pure_prompt_new_line.fish +++ /dev/null @@ -1,11 +0,0 @@ -function _pure_prompt_new_line \ - --description "Do not add a line break to a brand new session" \ - --on-event fish_prompt - - set --local new_line - if test $_pure_fresh_session = false - set new_line "\n" - end - - echo -e -n "$new_line" -end diff --git a/fish/.config/fish/functions/_pure_prompt_ssh.fish b/fish/.config/fish/functions/_pure_prompt_ssh.fish deleted file mode 100644 index 3ff11ea..0000000 --- a/fish/.config/fish/functions/_pure_prompt_ssh.fish +++ /dev/null @@ -1,5 +0,0 @@ -function _pure_prompt_ssh - if test "$SSH_CONNECTION" != "" - echo (_pure_prompt_ssh_user)(_pure_prompt_ssh_separator)(_pure_prompt_ssh_host) - end -end diff --git a/fish/.config/fish/functions/_pure_prompt_ssh_host.fish b/fish/.config/fish/functions/_pure_prompt_ssh_host.fish deleted file mode 100644 index d403c80..0000000 --- a/fish/.config/fish/functions/_pure_prompt_ssh_host.fish +++ /dev/null @@ -1,7 +0,0 @@ -function _pure_prompt_ssh_host - set --query --global hostname - or set --local hostname (hostname -s) # current host name compatible busybox - set --local hostname_color (_pure_set_color $pure_color_ssh_hostname) - - echo "$hostname_color$hostname" -end diff --git a/fish/.config/fish/functions/_pure_prompt_ssh_separator.fish b/fish/.config/fish/functions/_pure_prompt_ssh_separator.fish deleted file mode 100644 index 10ae5e8..0000000 --- a/fish/.config/fish/functions/_pure_prompt_ssh_separator.fish +++ /dev/null @@ -1,6 +0,0 @@ -function _pure_prompt_ssh_separator - set --local separator_symbol "@" - set --local separator_symbol_color (_pure_set_color $pure_color_ssh_separator) - - echo "$separator_symbol_color$separator_symbol" -end diff --git a/fish/.config/fish/functions/_pure_prompt_ssh_user.fish b/fish/.config/fish/functions/_pure_prompt_ssh_user.fish deleted file mode 100644 index e0cf879..0000000 --- a/fish/.config/fish/functions/_pure_prompt_ssh_user.fish +++ /dev/null @@ -1,10 +0,0 @@ -function _pure_prompt_ssh_user - set --local username (whoami) # current user name - set --local username_color (_pure_set_color $pure_color_ssh_user_normal) # default color - - if test "$username" = "root" - set username_color (_pure_set_color $pure_color_ssh_user_root) # different color for root - end - - echo "$username_color$username" -end diff --git a/fish/.config/fish/functions/_pure_prompt_symbol.fish b/fish/.config/fish/functions/_pure_prompt_symbol.fish deleted file mode 100644 index 768eca7..0000000 --- a/fish/.config/fish/functions/_pure_prompt_symbol.fish +++ /dev/null @@ -1,20 +0,0 @@ -function _pure_prompt_symbol \ - --description 'Print prompt symbol' \ - --argument-names exit_code - - set --local prompt_symbol (_pure_get_prompt_symbol) - set --local symbol_color_success (_pure_set_color $pure_color_prompt_on_success) - set --local symbol_color_error (_pure_set_color $pure_color_prompt_on_error) - set --local command_succeed 0 - - set --local symbol_color $symbol_color_success # default pure symbol color - if test $exit_code -ne $command_succeed - set symbol_color $symbol_color_error # different pure symbol color when previous command failed - - if test "$pure_separate_prompt_on_error" = true - set symbol_color "$symbol_color_error$prompt_symbol$symbol_color_success" - end - end - - echo "$symbol_color$prompt_symbol" -end diff --git a/fish/.config/fish/functions/_pure_prompt_vimode.fish b/fish/.config/fish/functions/_pure_prompt_vimode.fish deleted file mode 100644 index 04d38b4..0000000 --- a/fish/.config/fish/functions/_pure_prompt_vimode.fish +++ /dev/null @@ -1,5 +0,0 @@ -function _pure_prompt_vimode - if test $pure_reverse_prompt_symbol_in_vimode = false - echo (fish_default_mode_prompt) - end -end diff --git a/fish/.config/fish/functions/_pure_prompt_virtualenv.fish b/fish/.config/fish/functions/_pure_prompt_virtualenv.fish deleted file mode 100644 index 6cb2ed6..0000000 --- a/fish/.config/fish/functions/_pure_prompt_virtualenv.fish +++ /dev/null @@ -1,8 +0,0 @@ -function _pure_prompt_virtualenv --description "Display virtualenv directory" - if test -n "$VIRTUAL_ENV" - set --local virtualenv (basename "$VIRTUAL_ENV") - set --local virtualenv_color (_pure_set_color $pure_color_virtualenv) - - echo "$virtualenv_color$virtualenv" - end -end diff --git a/fish/.config/fish/functions/_pure_set_color.fish b/fish/.config/fish/functions/_pure_set_color.fish deleted file mode 100644 index c05769a..0000000 --- a/fish/.config/fish/functions/_pure_set_color.fish +++ /dev/null @@ -1,19 +0,0 @@ -function _pure_set_color \ - --description 'Set color' \ - --argument-names var - - set --local color $var - # Backwards compatibility for colors defined as control sequencies instead of fish colors - if not string match --quiet --all --regex '\e\[[^m]*m' $color[1] - and set -q $color - set color $$var - end - - set --local result $color - if not string match --quiet --all --regex '\e\[[^m]*m' $result[1] - and not test -z $result[1] - set result (set_color $color) - end - - echo "$result" -end diff --git a/fish/.config/fish/functions/_pure_set_default.fish b/fish/.config/fish/functions/_pure_set_default.fish deleted file mode 100644 index 69e6054..0000000 --- a/fish/.config/fish/functions/_pure_set_default.fish +++ /dev/null @@ -1,8 +0,0 @@ -function _pure_set_default \ - --description 'Set default value for configuration variable' \ - --argument-names var default - - if not set -q --universal $var - set --universal $var $default - end -end diff --git a/fish/.config/fish/functions/_pure_string_width.fish b/fish/.config/fish/functions/_pure_string_width.fish deleted file mode 100644 index 0c1957b..0000000 --- a/fish/.config/fish/functions/_pure_string_width.fish +++ /dev/null @@ -1,9 +0,0 @@ -function _pure_string_width \ - --description 'returns raw string length, i.e. ignore ANSI-color' \ - --argument-names prompt - - set --local empty '' - set --local raw_prompt (string replace --all --regex '\e\[[^m]*m' $empty -- $prompt) - - string length -- $raw_prompt -end diff --git a/fish/.config/fish/functions/fish_greeting.fish b/fish/.config/fish/functions/fish_greeting.fish deleted file mode 100644 index 018520b..0000000 --- a/fish/.config/fish/functions/fish_greeting.fish +++ /dev/null @@ -1,2 +0,0 @@ -function fish_greeting -end diff --git a/fish/.config/fish/functions/fish_mode_prompt.fish b/fish/.config/fish/functions/fish_mode_prompt.fish deleted file mode 100644 index 428a658..0000000 --- a/fish/.config/fish/functions/fish_mode_prompt.fish +++ /dev/null @@ -1,2 +0,0 @@ -function fish_mode_prompt -end diff --git a/fish/.config/fish/functions/fish_prompt.fish b/fish/.config/fish/functions/fish_prompt.fish index 9b313e3..ce2b1bc 100644 --- a/fish/.config/fish/functions/fish_prompt.fish +++ b/fish/.config/fish/functions/fish_prompt.fish @@ -1,11 +1,31 @@ -function fish_prompt - set --local exit_code $status # save previous exit code - - echo -e -n (_pure_prompt_beginning) # init prompt context (clear current line, etc.) - echo -e (_pure_prompt_first_line) # print current path, git branch/status, command duration - _pure_place_iterm2_prompt_mark # place iTerm shell integration mark - echo -e -n (_pure_prompt $exit_code) # print prompt - echo -e (_pure_prompt_ending) # reset colors and end prompt - - set _pure_fresh_session false +# name: Krisleech +function _git_branch_name + echo (command git symbolic-ref HEAD 2> /dev/null | sed -e 's|^refs/heads/||') +end + +function _is_git_dirty + echo (command git status -s --ignore-submodules=dirty 2> /dev/null) +end + +function fish_prompt + set -l cyan (set_color -o cyan) + set -l yellow (set_color -o yellow) + set -l red (set_color -o red) + set -l blue (set_color -o blue) + set -l green (set_color -o green) + set -l normal (set_color normal) + + set -l cwd $cyan(basename (prompt_pwd)) + + if [ (_git_branch_name) ] + set -l git_branch (_git_branch_name) + set git_info "$green$git_branch " + + if [ (_is_git_dirty) ] + set -l dirty "$yellow✗" + set git_info "$git_info$dirty" + end + end + + echo -n -s $cwd $red '|' $git_info $normal ⇒ ' ' $normal end diff --git a/fish/.config/fish/functions/fish_title.fish b/fish/.config/fish/functions/fish_title.fish deleted file mode 100644 index ff918ab..0000000 --- a/fish/.config/fish/functions/fish_title.fish +++ /dev/null @@ -1,16 +0,0 @@ -function fish_title \ - --description "Set title to current folder and shell name" \ - --argument-names last_command - - set --local basename (string replace -r '^.*/' '' -- $PWD) - set --local current_folder (_pure_parse_directory) - set --local current_command (status current-command 2>/dev/null; or echo $_) - - set --local prompt "$basename: $last_command $pure_symbol_title_bar_separator $current_command" - - if test -z "$last_command" - set prompt "$current_folder $pure_symbol_title_bar_separator $current_command" - end - - echo $prompt -end