Closed ghost closed 9 years ago
I've thought about this but I could never find a good way to reduce the scope to something feasible.
Wouldn't this basically be adding some git
and color
related functions to the /functions
directory? I am considering doing something like this in Wahoo.
Not sure... I don't think it's that easy... but it could be.
I think we just need to make sure these functions are autoloaded first and then they would be available to any omf users.
Right, loading the function is okay. The difficult I see lies on the function definition. Let me know when you have a draft and I can have a look! :)
You mean coming up with a good function? The problem I see is this will result in themes / plugins that are solely dependent on the current platform, OMF, Wahoo, etc. If only...
Maybe not, for instance, fish has builtin git functions.
Right, but still a bit obscure and not helpful without learning how to use them.
__fish_git_prompt (Prompt function for Git)
__fish_git_prompt_dirty (__fish_git_prompt helper, tells whether or not the current branch has tracked, modified files)
__fish_git_prompt_informative_status (set -l changedFiles (command git diff --name-status | cut -c 1-2) set -l stagedFi…)
__fish_git_prompt_operation_branch_bare (__fish_git_prompt helper, returns the current Git operation and branch)
__fish_git_prompt_repaint (Event handler, repaints prompt when functionality changes)
__fish_git_prompt_repaint_char (Event handler, repaints prompt when any char changes)
__fish_git_prompt_repaint_color (Event handler, repaints prompt when any color changes)
__fish_git_prompt_set_char (set -l user_variable_name "$argv[1]" set -l char $argv[2] set -l user_variable $$user_varia…)
__fish_git_prompt_set_color (set -l user_variable_name "$argv[1]" set -l user_variable $$user_variable_name set -l user…)
__fish_git_prompt_show_upstream (Helper function for __fish_git_prompt)
__fish_git_prompt_staged (__fish_git_prompt helper, tells whether or not the current branch has staged files)
__fish_git_prompt_validate_chars (__fish_git_prompt helper, checks char variables)
__fish_git_prompt_validate_colors
Somewhat fixed with #512
It would be useful to have a
util
plugin that other themes as well as plugins could use to reuse more code. Lately I see a lot of themes that are basically just change a few colors, copy a feature from another theme and the result is a file with 80 or more lines of code when it should be like 3 lines.