Commit Graph

764 Commits

Author SHA1 Message Date
John D Pell
ad1d73aaa1 lib/command_duration: remove temporary files 2022-03-04 12:39:02 -08:00
John D Pell
df87b41635 lib/theme: use _command_exists() in rbenv_version_prompt() 2022-03-03 22:54:09 -08:00
John D Pell
7762aa687a lib/theme: local hg_root in hg_prompt_vars() 2022-03-03 22:54:09 -08:00
John D Pell
c9efc161ff lib/theme: improve performance of scm()
- Don't invoke the source control utility when all we want to know is if we're somewhere inside the repository; use `_bash-it-find-in-ancestor()`.
2022-03-03 22:54:09 -08:00
John D Pell
d86a182b6e lib/theme: export $LS_COLORS et al 2022-03-03 22:54:09 -08:00
John D Pell
c6ac9109d7 lib/theme: parameter cleanup
Improve handling of parameters by adding defaults (often blank).

Alsö, eliminate newlines from `echo` in many places.
2022-03-03 22:54:09 -08:00
John D Pell
2b3af0d8c9 lib/theme: eliminate a lot of subshells
A lot of useless `echo`s in here.
2022-03-03 22:54:09 -08:00
John D Pell
ac0d91b682 lib/theme.githelpers: remove dead code
Five years deprecation is plenty warning.
2022-03-03 22:54:09 -08:00
John D Pell
1d73537dbf lib/theme: shfmt && shellcheck
My apologies to future `git blame` hunters ♥

Use the "short" host name by default (`\h`), not the fully qualified domain name (`\H`)...

lib/theme: don't redefine battery_char()

Combine the two definitions for `battery_char()` so the second one doesn't just overwrite the first one. Do one or the other, not both.

Don't evaluate if `battery_percentage()` is available at load time, evaluate it at run time.

Don't run `date` for `$THEME_TIME_FORMAT`, use `\D{fmt}`.
2022-03-03 22:54:09 -08:00
John D Pell
6bacd5fb1c lib/githelpers: shfmt && shellcheck
My apologies to future `git blame` hunters ♥
2022-03-03 22:54:08 -08:00
John D Pell
fbc5d0a5af lib/p4helpers: shfmt
My apologies to future `git blame` hunters ♥
2022-03-03 22:53:13 -08:00
John D Pell
0e0e0d3035 lib/theme: Fix a *few* SC2154
These variables are referenced by themes already linted.
2022-03-03 22:53:13 -08:00
John D Pell
2cea663a4a lib/theme: handle undefined parameter 2022-02-18 03:06:17 -08:00
John D Pell
363827a3b5 theme/pure: cleanup
Use `\$` to let _Bash_ choose the mark, move `PS1=` outside the `case` statement.

#TODO: last command status?
2022-02-13 16:18:00 -08:00
John D Pell
5d5858058e lib/history: new functions _bash-it-history-auto-*()
Two new functions `_bash-it-history-auto-save()` and `_bash-it-history-auto-load()`, which append new history to disk and load new history from disk, respectively.

See bash-it/bash-it#1595 for discussion.
2022-02-08 16:59:29 -08:00
John D Pell
5f19de8d51 plugin/colors: rename theme/colors 2022-01-28 13:09:00 -08:00
John D Pell
9f146f937a lib/preexec: consolidate helper functions
Define the helper functions for `bash-preexec.sh` immediately after importing it, rather than in `lib/theme`.
- `__check_precmd_conflict()` and `save_append_prompt_command()` are generally useful and not theme-specific.
- Add matching `__check_preexec_conflict()` and `safe_append_preexec()`.
2022-01-25 13:00:04 -08:00
Noah Gorny
44a1b55db7 Merge pull request #2037 from gaelicWizard/theme/brunton
theme/brunton: `shellcheck`
2022-01-25 18:18:54 +02:00
Noah Gorny
dd83efc35f Merge pull request #2041 from gaelicWizard/theme/sudo
lib/theme: disable THEME_CHECK_SUDO
2022-01-25 18:12:47 +02:00
John D Pell
b1e922ea38 theme/norbu: shellcheck && shfmt
# Conflicts:
#	clean_files.txt
2022-01-25 00:01:27 -08:00
Noah Gorny
dbb3ea4736 Merge pull request #2035 from gaelicWizard/theme/pete
theme/pete: `shellcheck` && `shfmt`
2022-01-24 23:32:58 +02:00
John D Pell
21942f6275 lib/theme: disable THEME_CHECK_SUDO
Move `$THEME_CHECK_SUDO` to `lib/them`, and set it to `false` instead of `true`.
2022-01-24 11:46:16 -08:00
John D Pell
27ebc585be theme/brunton: SC2154
Handle all unbound parameters, even colors!
2022-01-12 13:38:10 -08:00
John D Pell
8e8fe69db4 theme/pete: shellcheck && shfmt 2022-01-12 13:29:40 -08:00
John D Pell
bdaf29f84c Create lib finalize hook
Create an array `_bash_it_library_finalize_hook` and loop at the end of the main `bash_it.sh` to run each element in the array.

The purpose here is to run some command after everything else has been loaded. For example, the appearance lib checks for executables for SCM commands, but `$PATH` may be altered after appearance has loaded and therefore some available commands may never be discovered. Therefore, create `_bash_it_appearance_scm_init()` and add it to the hook. It will re-check at end of `bash_it.sh` just before prompt is first displayed.
2022-01-09 00:46:51 -08:00
John D Pell
fcbe4e90b7 theme/easy: SC2154
Handle all unbound parameters, even colors!
2022-01-08 08:45:52 -08:00
John D Pell
c7c447a54b theme/candy: SC2154
Handle all unbound parameters, even colors!
2022-01-08 08:45:52 -08:00
John D Pell
262e55eda2 theme/bobby: SC2154
Handle all unbound parameters, even colors!
2022-01-08 08:45:52 -08:00
John D Pell
6db5f38f6e theme/atomic: lint/cleanup
Use `[[` instead of `[`, set some local variables, still more to clean
2022-01-08 08:45:35 -08:00
Noah Gorny
6fc47a7671 Merge pull request #2021 from NariyasuHeseri/master
theme/powerline: fix error `scm: parameter not defined`
2022-01-07 08:51:00 +02:00
Nariyasu Heseri
9d8002226d theme/powerline: fix error scm: parameter not defined 2022-01-06 18:44:18 +09:00
John D Pell
f2dcb2aff6 theme/essential: s/echo/printf/g 2022-01-03 20:45:39 -08:00
John D Pell
3695862b43 theme/essential: cleanup
Lose a couple of useless `echo`s/subshells.

Alsö, lose the incorrect VIM modeline from the bottom. Our formatting standard is specified in `$BASH_IT/.EditorConfig`.
2022-01-03 20:45:39 -08:00
John D Pell
d1b7166358 theme/essential: shfmt 2022-01-03 20:45:39 -08:00
John D Pell
9f79848eed theme/essential: SC2154
Handle all unbound parameters, even colors!
2022-01-03 20:45:39 -08:00
John D Pell
2991aa66ca theme/powerline: SC2154, SC2248 2021-12-27 12:20:46 -08:00
John D Pell
c323357067 theme/purity: SC2154
Handle all unbound parameters, even colors!
2021-12-27 12:20:46 -08:00
John D Pell
e560e88814 theme/pure: SC2154
Handle all unbound parameters, even colors!
2021-12-27 12:20:46 -08:00
John D Pell
895102edeb theme/codeword: SC2154
Handle all unbound parameters, even colors!
2021-12-27 12:20:46 -08:00
John D Pell
4bc83d7940 theme/bira: SC2154
Handle all unbound parameters, even colors!
2021-12-27 12:20:46 -08:00
John D Pell
2c14a18483 theme/bakke: fix SC2154
Handle all unbound parameters, even colors!
2021-12-27 12:20:46 -08:00
John D Pell
c769234350 theme/90210: fix SC2154
Handle all unbound parameters, even colors!
2021-12-27 12:20:46 -08:00
Mike James
1273504267 themes: fix doubletime_multiline scm_prompt
Replace doubletime_scm_prompt with scm_prompt.
2021-11-26 13:21:07 -08:00
Noah Gorny
2d1bd82575 Merge pull request #1975 from krapshsa/krapshsa-patch-1
Fix save-and-reload-history command not found
2021-10-18 22:22:21 +03:00
Noah Gorny
5feebcc9d9 Merge pull request #1974 from zou000/patch-1
Fix home dir substitution
2021-10-18 21:59:59 +03:00
krapshsa
b0e8729b0f Fix save-and-reload-history command not found 2021-10-19 00:58:01 +08:00
Noah Gorny
7987e4bfcd Merge pull request #1883 from seefood/ira/autosave-history-plml
Add history flushes on each command to the powerline themes
2021-10-17 19:51:56 +03:00
zou000
7911f770cf use \w 2021-10-16 22:29:25 -07:00
zou000
bb3a51f742 Update powerline.base.bash 2021-10-16 20:24:07 -07:00
zou000
413d7a1326 Fix home dir substitution
See the discussions in 953e422bed (commitcomment-58148656) . Tested with bash 5.1 and  bash 3.2
2021-10-16 19:15:00 -07:00