bash-it takes rather a while to startup, around 0.5 seconds on my
laptop. After a bit of timing it appears the majority of the time is
spent in themes/colors.theme.bash. The reason for that is the fancy
abstraction layers that use $(). For example, consider this code:
red="$(color reset red)"
It will go through 9 forkexecs to evaluate:
red="$(color reset red)"
"$(__color_parse make_ansi reset red)"
"$(__make_ansi reset red)"
"\[\e[$(__reset red)m\]"
"\[\e[0;$(__red)m\]"
"\[\e[0;$(__color red)m\]"
"\[\e[0;$(__color_normal_fg $(__color_red))m\]"
"\[\e[0;$(__color_normal_fg 1)m\]"
"\[\e[0;31m\]"
With all the variables in colors.theme.bash, this adds up to hundreds of
forks:
$ strace -f bash ./colors.theme.bash 2>&1 | grep clone | wc -l
649
The solution is to replace the function with its result:
-red="$(color reset red)"
+red='\[\e[0;31m\]'
This is safe, since colors.theme.bash never calls external functions or
takes any input. So, its result can be safely hard-coded.
This improves startup time dramatically. Try adding "time" to your .bashrc:
# Load Bash It
time source $BASH_IT/bash_it.sh
before:
real 0m0.462s
user 0m0.100s
sys 0m0.399s
after:
real 0m0.150s
user 0m0.091s
sys 0m0.064s
See https://github.com/wting/autojump for more details.
Currently only supports the version installed through Homebrew on OS X.
Please feel free to provide a PR for supporting additional installation
options.
I was seeing an issue where modifying PATH caused the Ruby plugin
tests to fail. I fixed that and while digging around fixed an issue
that would cause the tests to behave weirdly if run from any other
location.
This solves one of the issues noted in #687, but I haven't tried
running the new tests from that PR with these changes.
There are multiple ways to install fasd, but the initialization
still needs to happen. Currently, fasd is broken in bash in that
it doesn't maintain the exit code properly. This custom init removes
the call to `fasd --init bash-hook` and replaces it with the version
that would be generated once fasd PR #72 is merged.
See: https://github.com/clvv/fasd/pull/72
- "bash-it search term1 [term2]...."
- we are using existing 'bash-it show plugins|aliases|completions'
commands output, to search (with grep) for lines that match the
search terms, and then output the matches.
- wrote a simple unit test that for whatever reason fails on Travis,
so wrapped it in 'if "Darwin"'...
- Added more information to the README about the practice of using `git
pair`, and provided instructions on installing the support.
- Write a more reliable fallback that uses `user.name` to extract user
initials, when `user.initials` aren't set.