<commit_before># MyBASH

This is my repository to store my personal bash configurations. They are divided into different files so it is easier to maintain different versions. They are also stored in ~/SHELL/mybash/ so that git can work properly, and they are sourced in .bash_profile and .bashrc by single line references so that they reference whatever version I'd like. There will be a write up for my blog for how I set this config up, how I use it, and why coming shortly, and its contents will be here and on my [personal site/blog](http://thepatternbuffer.com).

## Files
*heavily inspired by* [alrra/dotfiles](https://github.com/alrra/dotfiles)
This bash configuration seperates all of the configurations into different files based on the context:
- [x] `bash_profile`: the entry point for the login shell
- [x] `bashrc`: the standard entry point for non-login shell
- [x] `bash_exports`: custom dotfile that has all of bash's exports
- [x] `bash_aliases`: custom file that has all bash aliases as called by bashrc
- [x] `bash_functions`: custom file that has all bash functions called by bashrc
- [ ] `bash_options`: `shopt` tweaks to the shell, look at alrra/dotfiles for ideas

The `bash_profile` will only source `bash_exports` to load in all global variables needed that are customized for this configuration. Then in `bashrc` `bash_aliases`, `bash_functions`, `bash_general` & `bash_options` get sourced to create the proper non-login shell so that it's easier to manage all the numerous customizations this configuration has. On top of those sources listed, `bashrc` will also source a symlink, `prompt-link` which will point to the right script file inside of `./prompts` to use one of several different prompt options.


## Prompts


## Aliases


## Functions


## TODO
***Note*** *many other todos have been completed, but only recently have they been getting tracked inside this README*
- [x] add *golang* version of powerline prompt for better latency
- [ ] combine the functionality of `choose-prompt.sh` with `prepare.sh` since this doesn't need to be run several times. Also have the bash prompt be the default option
- [ ] add grep colors support based off [alrra/dotfiles](https://github.com/alrra/dotfiles/tree/master/src/shell/colors)
- [ ] add autocomplete functionality based off [alrra/dotfiles](https://github.com/alrra/dotfiles/tree/master/src/shell/autocomplete)
- [ ] add bash options into `bash_options.sh` based off [alrra/dotfiles](https://github.com/alrra/dotfiles/blob/master/src/shell/bash_options)


## Change History
- **History starts @ 2017 - 11 - 12** Lots of work has been done previously however
- **2017 - 11 - 12:** Restructure all configs to be more organized
  - `bash_exports`, `bash_aliases`, `bash_functions`, `bash_options` & `bash_general` have been created to seperate 
  - `MACHINE` variable now is exported based off which host OS this is run from
    - This is important for several exports, aliases, & functions that will be different due to host OS type
  - `BASH_CONFIGS_ROOT` variable now gets defined in `bash_profile` to make getting config paths easier
  - `prompts/` now has all prompt configs including submodules for more complex dynamic prompts
  - `prepare.sh` refactor & default prompt linking
    - Refactored so that every task is now a forward defined function
    - Refactored variable names so they're more readable, `*_SRC` is now an original file to be linked & `*_DST` is now for links
    - Now creates `prompt-link` so that it links to `bash-powerline` submodule as the default prompt since it's guaranteed to work fast on any UNIX system since it's entirely a bash script
- **2017 - 11 - 13:** powerline-go
  - Install [justjanne/powerline-go](https://github.com/justjanne/powerline-go)
  - `prompts/go-prompt.sh` now uses options inside `prompts/go-prompt-options.sh` to create a go-based powerline prompt
  - `prompts/go-prompt-options.sh` has a nicely commented set of variables containing all possible `powerline-go` options which are then included in `PROMPT_OPTS` within the file to include as many or few options to customize the powerline
  - `.gitignore` now ignores the `prompts/prompt-link` so it doesn't change the local prompt
  - `prompts/powerline-go` is the binary for launching go, which has to be included in `GOPATH` variable
    - this also means that `prompts/powerline-go` needs to be downloaded manually to be used
  - `bash_exports` now has improved `PATH`, `GOPATH` & `GOBIN` which makes `powerline-go` work and makes managing go projects easier
    - *i.e.* they're all inside `~/bin/go`


# OLD VERSION, KEEP WHAT IS USEFUL IN REWRITE DELETE REST
Whenever this repository is being used for the first time, a few things will need to be done first:
1. Run `git clone https://github.com/marcus-grant/mybash` in your `~/` directory, aka, your home
2. Clear .bashrc and paste this into it and save:
```
	if [ -f ~/Shell/mybash/.bashrc ]; then
		source ~/Shell/mybash/.bashrc
	fi

```
3. Do the same for `~/.bash_profile` with this:<commit_msg>update todos and changelog<commit_after># MyBASH

This is my repository to store my personal bash configurations. They are divided into different files so it is easier to maintain different versions. They are also stored in ~/SHELL/mybash/ so that git can work properly, and they are sourced in .bash_profile and .bashrc by single line references so that they reference whatever version I'd like. There will be a write up for my blog for how I set this config up, how I use it, and why coming shortly, and its contents will be here and on my [personal site/blog](http://thepatternbuffer.com).

## Files
*heavily inspired by* [alrra/dotfiles](https://github.com/alrra/dotfiles)
This bash configuration seperates all of the configurations into different files based on the context:
- [x] `bash_profile`: the entry point for the login shell
- [x] `bashrc`: the standard entry point for non-login shell
- [x] `bash_exports`: custom dotfile that has all of bash's exports
- [x] `bash_aliases`: custom file that has all bash aliases as called by bashrc
- [x] `bash_functions`: custom file that has all bash functions called by bashrc
- [ ] `bash_options`: `shopt` tweaks to the shell, look at alrra/dotfiles for ideas

The `bash_profile` will only source `bash_exports` to load in all global variables needed that are customized for this configuration. Then in `bashrc` `bash_aliases`, `bash_functions`, `bash_general` & `bash_options` get sourced to create the proper non-login shell so that it's easier to manage all the numerous customizations this configuration has. On top of those sources listed, `bashrc` will also source a symlink, `prompt-link` which will point to the right script file inside of `./prompts` to use one of several different prompt options.


## Prompts


## Aliases


## Functions


## TODO
***Note*** *many other todos have been completed, but only recently have they been getting tracked inside this README*
- [x] add *golang* version of powerline prompt for better latency
- [x] fix `choose-prompt.sh` to handle all edge cases and to be more readable
- [ ] add grep colors support based off [alrra/dotfiles](https://github.com/alrra/dotfiles/tree/master/src/shell/colors)
- [ ] add autocomplete functionality based off [alrra/dotfiles](https://github.com/alrra/dotfiles/tree/master/src/shell/autocomplete)
- [ ] add bash options into `bash_options.sh` based off [alrra/dotfiles](https://github.com/alrra/dotfiles/blob/master/src/shell/bash_options)


## Change History
- **History starts @ 2017 - 11 - 12** Lots of work has been done previously however
- **2017 - 11 - 12:** Restructure all configs to be more organized
  - `bash_exports`, `bash_aliases`, `bash_functions`, `bash_options` & `bash_general` have been created to seperate 
  - `MACHINE` variable now is exported based off which host OS this is run from
    - This is important for several exports, aliases, & functions that will be different due to host OS type
  - `BASH_CONFIGS_ROOT` variable now gets defined in `bash_profile` to make getting config paths easier
  - `prompts/` now has all prompt configs including submodules for more complex dynamic prompts
  - `prepare.sh` refactor & default prompt linking
    - Refactored so that every task is now a forward defined function
    - Refactored variable names so they're more readable, `*_SRC` is now an original file to be linked & `*_DST` is now for links
    - Now creates `prompt-link` so that it links to `bash-powerline` submodule as the default prompt since it's guaranteed to work fast on any UNIX system since it's entirely a bash script
- **2017 - 11 - 13:** powerline-go
  - Install [justjanne/powerline-go](https://github.com/justjanne/powerline-go)
  - `prompts/go-prompt.sh` now uses options inside `prompts/go-prompt-options.sh` to create a go-based powerline prompt
  - `prompts/go-prompt-options.sh` has a nicely commented set of variables containing all possible `powerline-go` options which are then included in `PROMPT_OPTS` within the file to include as many or few options to customize the powerline
  - `.gitignore` now ignores the `prompts/prompt-link` so it doesn't change the local prompt
  - `prompts/powerline-go` is the binary for launching go, which has to be included in `GOPATH` variable
    - this also means that `prompts/powerline-go` needs to be downloaded manually to be used
  - `bash_exports` now has improved `PATH`, `GOPATH` & `GOBIN` which makes `powerline-go` work and makes managing go projects easier
    - *i.e.* they're all inside `~/bin/go`
  - Complete rewrite of `prompts/choose-prompt.sh` since not all edge cases were addressed
  - Also rewrite `prompts/choose-prompt.sh` because it was hard to alter (spaghetti code) and to make it more readable (forward declaration)


# OLD VERSION, KEEP WHAT IS USEFUL IN REWRITE DELETE REST
Whenever this repository is being used for the first time, a few things will need to be done first:
1. Run `git clone https://github.com/marcus-grant/mybash` in your `~/` directory, aka, your home
2. Clear .bashrc and paste this into it and save:
```
	if [ -f ~/Shell/mybash/.bashrc ]; then
		source ~/Shell/mybash/.bashrc
	fi

```
3. Do the same for `~/.bash_profile` with this:
{'fraction_non_alphanumeric': 0.08536585365853659, 'fraction_numerical': 0.00526829268292683, 'mean_word_length': 4.219450101832994, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 12, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1580698', 'n_tokens_mistral': 3107, 'n_tokens_neox': 2843, 'n_words': 1362}