Commit Graph

3656 Commits (6dec28b5dfb25acabde7778f19ec28920102570c)

Author SHA1 Message Date
Kostas Giapis 476159eab9 Use bash features as much as possible 2021-12-11 17:48:33 +02:00
Kostas Giapis 15fe122c1f Make more variables local 2021-12-03 06:31:28 +02:00
Kostas Giapis 4d821338a3 Double quote some variables 2021-12-03 06:31:28 +02:00
Kostas Giapis 9c4f7773b9 Improve performance for the rest of bash-it completions 2021-12-03 06:31:16 +02:00
Kostas Giapis 5b29d3c6e6 Improve performance of 'bash-it enable' completions 2021-12-03 06:29:39 +02:00
David Farrell 1bc56b1d8f
plugin(dirs): remove shopt -s cdable_vars 2021-12-02 13:42:29 -08:00
noviicee 51042c2cf0 added alias ls='ls -F' 2021-12-02 23:49:58 +05:30
cornfeedhobo 1882f50aa1
Merge pull request #1982 from cornfeedhobo/align-history-plugins
Wholesale cleanup of all history plugins
2021-12-02 09:44:09 -06:00
cornfeedhobo 2c8ee40566
Fix linting errors that snuck in. 2021-12-02 09:14:01 -06:00
cornfeedhobo bdb5289660
Wholesale cleanup of all history plugins
- remove the use of redundant cite
- minor cleanups to history.plugin.bash
- set explicit load orders for history-search and history-substring-search
- add new plugin history-eternal
- replace superfluous trap for managing HISTTIMEFORMAT changes
2021-12-02 09:13:56 -06:00
Noah Gorny 036cf8ada0
Merge pull request #1987 from mikejamestx/dtml-scm_prompt
Themes: Fix doubletime_multiline scm_prompt
2021-11-29 23:59:24 +02: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 8784ed2785
Merge pull request #1986 from ajeetdsouza/zoxide
plugin: add zoxide
2021-11-24 21:43:39 +02:00
Ajeet D'Souza a89f2f8f13 plugin: add zoxide 2021-11-24 16:49:46 +05:30
Noah Gorny 447c89aa0e
Merge pull request #1981 from william-richard/make-default-branch-match-exactly-main
Look for branches that are literally the word main
2021-11-16 20:09:22 +02:00
William Richard 2a23598873
Make the regex looking for the main branch match the entire line 2021-11-15 12:19:05 -05:00
Noah Gorny 7b4056fdf9
Merge pull request #1984 from NoahGorny/docs-pin-docutils
docs: Pin docutils to 0.17.1
2021-11-13 20:25:33 +02:00
Noah Gorny 1ff2497c9e docs: Pin docutils to 0.17.1
Seems like docutils 0.18 has some problems and it is breaking our docs
build
(https://issues.apache.org/jira/browse/FLINK-24662)

Lets use 0.17.1 for now.
2021-11-12 19:14:22 +02:00
Noah Gorny ab3b8b8f22
Merge pull request #1979 from gaelicWizard/preexec-histcontrol
preexec: work around upstream mangling of `$HISTCONTROL`
2021-11-01 23:25:02 +02:00
William Richard daaab1b73d
Use \s instead of \b
\b matches things like - and _, which is often used in branch names
2021-10-25 11:55:26 -04:00
William Richard 98bd0ae149
Use `/b` to find the default branch, instead of start/end of line 2021-10-25 11:35:19 -04:00
Noah Gorny c90a6283ef
Merge pull request #1976 from gaelicWizard/utilities
Use `_bash-it-egrep()`
2021-10-23 23:33:04 +03:00
William Richard a14d9cb6ea
Look for branches that are literally the word main
I have a repo with many other branches that contain the string `main`,
but our default branch is still master.  This grep was seeing those other branches
and deciding that my default branch was `main`.  This tighter regex
fixes that behavior for me.
2021-10-22 11:19:21 -04:00
John D Pell bdfb987f0c plugin/xterm: don't rely on `$1`
_bash-preexec_ passes the "current" command line as `$1`, but this is unreliable and we explicitly discourage it's use.

Use `$BASH_COMMAND` instead.
2021-10-20 15:50:15 -04:00
John D Pell 9ce199c251 preexec: set options before load
By setting `__bp_delay_install`, we avoid any immediate initialization at all. We then override two troublesome functions before calling `__bp_install_after_session_init()`.

The `__bp_install_after_session_init()` function doesn't enable the DEBUG trap, just sets `$PROMPT_COMMAND` to include `__bp_install()`, so the actual final `$PROMPT_COMMAND` is not finished, and DEBUG trap set, until after the first prompt is displayed.
2021-10-20 15:28:59 -04:00
John D Pell 00f5f2a62e Use `_bash-it-egrep()` 2021-10-18 22:08:56 -04: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 5e3810ac96
Merge pull request #1973 from gaelicWizard/utilities
lib/utilities: minor improvements
2021-10-18 22:05:05 +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
John D Pell 253d1213e0 lib/utilities: new function `_bash-it-egrep()`
The existing function `_bash-it-grep()` is weird. New function `_bash-it-egrep()` just does the thing without requiring two subshells and manual invocation.
2021-10-18 09:14:32 -04:00
John D Pell b8ee63c67d lib/utilities: quote SC2295
Doesn't show up on my shellcheck 0.7.2, but does for NoahGorny!
2021-10-18 09:14:32 -04:00
John D Pell b986c39040 lib/utilities: XDG_CACHE_HOME
Use $XDG_CACHE_HOME environment constant instead of placing a tmp/cache folder inside the bash-it data repo. If not defined, fall back to current behavior.

This resolves Bash-It/Bash-It#1904.
2021-10-18 09:14:32 -04: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
John D Pell 7cd02781f8 lib/utilities: `_bash-it-component-help()`
No need to `rm` when we overwrite the file the line after next. Alsö, use `>|` in case the user sets `noclobber`; we do expressly intend to overwrite the file in this case.
2021-10-13 21:13:45 -07:00
John D Pell f7cc442af4 lib/utilities: simplify `_bash-it-array-dedup()`
alsö fix usage example of `_bash-it-array-contains-element()`
2021-10-13 09:28:21 -07:00
Noah Gorny 48c17e95c3
Merge pull request #1968 from gaelicWizard/oops
theme/powerline: fix an oops in the last patch
2021-10-12 23:26:17 +03:00
John D Pell 953e422bed theme/powerline: fix an oops in the last patch
The tilde should not have been escaped, and in fact I did not have it escaped in my main branch, but the PR I submitted did have it escaped and...now it shows up in the prompt line for all the PowerLine themes... oops.
2021-10-12 11:08:37 -07:00
Ira Abramov d6239cf190 Merge branch 'master' of https://github.com/bash-it/bash-it into ira/autosave-history-plml
* 'master' of https://github.com/bash-it/bash-it: (114 commits)
  ci: Bump go to 1.17 from 1.14
  skip go tests when go is not available
  plugins: Add ble.sh plugin
  clean up pyenv plugin
  Lint: prepare `lib/utilities` for `shellcheck` (#1933)
  plugin/base: improvements (#1930)
  plugins/percol: `bind`
  completion/git: `shfmt` && `shellcheck`
  completion/git: expand search range
  plugin/percol: `shellcheck` & `shfmt`
  plugins/percol: use `_command_exists`
  completion/pip: simplify code flow
  plugin/less-pretty-cat: remove `|| cat`
  completion/wpscan: simplify code flow (whitespace)
  plugins/less-pretty-cat: simplify code flow
  plugins/less-pretty-cat: use `_command_exists`
  lib/helpers: cite `_bash-it-find-in-ancestor()`
  gradle: adopt `_bash_it_find_in_ancestor()`
  lib/helpers: new function `_bash-it-find-in-ancestor()`
  completion/laravel: simplify code flow
  ...
2021-10-11 08:32:15 +03:00
Noah Gorny 49698e269a
Merge pull request #1971 from NoahGorny/ci-update-go-version
ci: Bump go to 1.17 from 1.14
2021-10-10 23:58:08 +03:00
Noah Gorny adab880f89 ci: Bump go to 1.17 from 1.14 2021-10-10 23:50:39 +03:00
Ira Abramov c3d333ddc4 fix based on remarks on PR 2021-10-10 15:25:45 +03:00
Noah Gorny cf08fcaff2
Merge pull request #1965 from gaelicWizard/completion-git
completion/git: improvements and linting
2021-10-07 00:10:47 +03:00
Noah Gorny c3382c7b50
Merge pull request #1884 from NoahGorny/add-blesh-plugin
plugins: Add ble.sh plugin
2021-10-06 22:49:15 +03:00
cornfeedhobo 07384bcf7c
Merge pull request #1967 from cornfeedhobo/goenv-go-tests
skip go tests when go is not available
2021-09-30 07:34:05 -05:00
cornfeedhobo b7feb14404
skip go tests when go is not available 2021-09-29 18:16:52 -05:00
Noah Gorny cd38f32d95 test: Fix completion tests and add profile completion ones 2021-09-29 00:30:24 +03:00