Skip to content

one.bash + one.share = an awesome shell.

License

Notifications You must be signed in to change notification settings

one-bash/one.share

Repository files navigation

one.share

one.bash + one.share = an awesome shell.

The one.share is the one.bash official repo, which provides common aliases/completions/plugins/configs/bin/sub for one.bash.

Features

Preview

Click to expend/collapse

preview.png

Use sub commands:

sub-commands.jpeg

Bubble Style and Block Style:

bubble-and-block-styles.png

Environments

  • ✅ iTerm2 Build 3.0.14 (Terminal.app compatible)
  • ✅ GNU Bash 4.4 or 5.0+
  • ✅ Tmux 3.3+ (Not necessary. Tmux compatible)
  • ✅ MacOS Intel Arch
  • ✅ MacOS ARM Arch
  • ✅ Linux/Unix system
  • 🚫 Windows system
  • 🚫 Zsh. This project is just for Bash players. Zsh players should use Oh My Zsh.

Dependencies

Required Dependencies

Optional Dependencies

These dependencies are not required for the project. It will improve the experience of terminal. Install them as your requirement.

Git Submodules

Git submodules required in one.bash.

  • bash-preexec: Add preexec_functions, precmd_functions arrays, and precmd, preexec functions for bash.

Versions

See tags. The versions follows the rules of SemVer 2.0.0.

Installation

Just invoke one dep install to install.

Update

one dep update one.share to update codes.

Usage

one repo enable-recommended

# If ONE_BASH_IT_ENABLE=true
one completion enable aliases.completion

Read one.bash documents for usage.

File Structure

.
├── alias/                        # Available aliases
├── bin/                            # Executables. The directory path is added to PATH by one.bash.
├── completion/                    # Available completions
├── config/                        # dotfiles, configs
├── deps/                           # the dependencies for modules
│   ├── a-bash-prompt/              # https://github.com/adoyle-h/a-bash-prompt
│   ├── bash-preexec/               # https://github.com/rcaloras/bash-preexec
│   ├── cheatsheets-community/      # https://github.com/cheat/cheat
│   └── z.lua/                      # https://github.com/skywind3000/z.lua
├── docs/                           # The documents of this project
├── plugin/                        # Available plugins
│   ├── completions.bash            # Enable general completions and tab complete keymap
│   ├── preexec.bash                # Enable bash-preexec
│   └── prompt.bash                 # Enable a-bash-prompt
└── sub/                            # The commands for ONE_SUB

Notice

Slow Loading

Some modules are slow. Set ONE_DEBUG=true in ONE_CONF file, you will see the logs showing slow loading time.

  • With ONE_NO_MODS=true, [one.bash|00:00:00|entry.bash] loaded success (Total 112ms)
  • With ONE_NO_MODS=false and one plugin enable fuck nvm npm, [one.bash|00:00:00|entry.bash] loaded success (Total 2200ms)

UI

If using tmux, $TERM should be xterm-256color or screen-256color for best appearance.

Usage

prompt

Use one_prompt_append add function to PROMPT_COMMAND.

plugin:completion

When one plugin enable completion,

The completion files loaded in order:

  • bash_completion will load files in order:
    • ${BASH_COMPLETION_COMPAT_DIR:-/usr/local/etc/bash_completion.d}
    • ${BASH_COMPLETION_USER_FILE:-~/.bash_completion}
  • this plugin will load
    • $HOME/.bash_completions

Suggestion, Bug Reporting, Contributing

Before opening new Issue/Discussion/PR and posting any comments, please read Contributing Guidelines.

Copyright and License

Copyright 2022-2024 ADoyle (adoyle.h@gmail.com). Some Rights Reserved. The project is licensed under the Apache License Version 2.0.

Read the LICENSE file for the specific language governing permissions and limitations under the License.

Read the NOTICE file distributed with this work for additional information regarding copyright ownership.