/dotfiles

My dotfiles, configurations, shell scripts and bin utilities.

Primary LanguageShellBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

dotfiles

My configurations and shell scripts.

Currently, it is only a personal workplace rather than a framework. So you should FORK the REPO first before using it.

TOC

Environments

  • iTerm2 Build 3.0.14 (Terminal.app compatible)
  • GNU bash 4.4.12(1)-release (x86_64-apple-darwin15.6.0) (GNU bash v3 compatible)
  • Tmux 2.3 (Not necessary. Tmux compatible)

Dependencies

  • git: It is required. Make sure it available before installation.
    • git-prompt: If omitted, PS1 will not show git prompt.
  • dotbot: To create symbolic links and manage the map via install.conf.yaml. There is no need to install dotbot manually. It is a part of this repo.
  • bash-it (modified version): To manage all shell scripts in modules: aliases, plugins, completions and shell appearance theme. It is required. Make sure it available before installation.

Features

Preview

preview.png

Responsive UI (Adjust with window width). No need to restart Terminal. Only press Enter:

responsive-ui.png

Highlight Backgound jobs:

background-jobs.png

Use sub commands:

sub-commands.jpeg

Installation

# Clone this repo
DOTFILE_DIR=~/dotfiles
git clone --depth 1 --recursive https://github.com/adoyle-h/dotfiles.git $DOTFILE_DIR
# Install bash_it framework which is required
git clone --depth 1 https://github.com/adoyle-h/bash-it ~/.bash_it
~/.bash_it/install.sh --no-modify-config
${DOTFILE_DIR}/bash_it/reset.sh
# Put your classified data in `secrets/` folder
mkdir -p ${DOTFILE_DIR}/secrets
# cheat is optional
git clone --depth 1 https://github.com/adoyle-h/my-command-cheat.git ${DOTFILE_DIR}/cheat
# neovim-config is optional
git clone --depth 1 --recursive https://github.com/adoyle-h/neovim-config.git ${DOTFILE_DIR}/nvim
# spencertipping/cd is optional
mkdir -p ~/.cd && git clone --depth 1 https://github.com/spencertipping/cd.git ~/.cd/core
# check `install.conf.yaml` file
# make soft-links for dotfiles
./install
# checkout the output

And then read the Configuration - Modifications by yourself section.

Configuration

Modifications by yourself

These parts of below files you should modify:

./configs/gitconfig:

[user]
    name = <your-username>
    email = <your-email>

UI

$TERM should be xterm-256color or screen-256color for best appearance.

Dotfiles

Edit the install.conf.yaml file.

Usage

Bootstrap

IT IS UNDER DEVELOPMENT. DO NOT USE!

Run ./bootstrap to initialize in a new environment.

Do not call the script under sudo.

Install

Run ./install to create symbolic links.

Do not call the script under sudo.

File Structure

.
β”œβ”€β”€ README.md
β”œβ”€β”€ bash/
β”‚   β”œβ”€β”€ bash_profile                # Link to ~/.bash_profile
β”‚   β”œβ”€β”€ bashrc                      # Link to ~/.bashrc
β”‚   β”œβ”€β”€ inputrc                     # Link to ~/.inputrc
β”‚   └── profile                     # Link to ~/.profile
β”œβ”€β”€ bash-custom/                    # your bash scripts
β”‚   β”œβ”€β”€ Debian/                     # bash scripts for Linux Debian
β”‚   β”‚   └── core.bash
β”‚   β”œβ”€β”€ aliases.shell.bash          # same to bash_it aliases
β”‚   β”œβ”€β”€ available/                  # Custom available bash scripts
β”‚   β”‚   └── zzz_last_cd.plugin.bash # Ensure the plugin should be loaded at last
β”‚   β”œβ”€β”€ bash_4.plugin.bash
β”‚   β”œβ”€β”€ cheat.plugin.bash
β”‚   β”œβ”€β”€ completions.shell.bash      # same to bash_it completions
β”‚   β”œβ”€β”€ editor.env.bash
β”‚   β”œβ”€β”€ enabled/                    # Custom enabled bash scripts
β”‚   β”‚   └── zzz_last_cd.plugin.bash -> ../available/zzz_last_cd.plugin.bash
β”‚   β”œβ”€β”€ env.shell.bash
β”‚   β”œβ”€β”€ functions.shell.bash        # same to bash_it lib
β”‚   β”œβ”€β”€ fzf.plugin.bash
β”‚   β”œβ”€β”€ gvm.plugin.bash
β”‚   β”œβ”€β”€ lesspipe.plugin.bash
β”‚   β”œβ”€β”€ Macos/                      # bash scripts for Macos
β”‚   β”‚   └── core.bash
β”‚   β”œβ”€β”€ optionals.shell.bash        # Shell Optional Behavior settings
β”‚   β”œβ”€β”€ path.env.bash               # change environment variable PATH
β”‚   β”œβ”€β”€ proxy.env.bash              # application proxy settings
β”‚   β”œβ”€β”€ secrets.env.bash -> ../secrets/secrets.env.bash
β”‚   β”œβ”€β”€ system-detect.shell.bash    # detect system and run its bash scripts
β”‚   β”œβ”€β”€ themes/                     # the bash_it theme
β”‚   β”‚   └── 𝕬/
β”‚   β”‚       └── 𝕬.theme.bash
β”‚   β”œβ”€β”€ tmux.plugin.bash
β”‚   β”œβ”€β”€ variables.shell.bash        # Shell Variables settings
β”‚   └── xcode.plugin.bash
β”œβ”€β”€ bash_it/                        # https://github.com/Bash-it/bash-it#your-custom-scripts-aliases-themes-and-functions
β”‚   β”œβ”€β”€ aliases.bash
β”‚   β”œβ”€β”€ completions.bash
β”‚   β”œβ”€β”€ enable.bash                 # bash_it configuration and entrance
β”‚   β”œβ”€β”€ lib.bash                    # Reset $PATH and $MANPATH, and set common functions
β”‚   β”œβ”€β”€ plugins.bash
β”‚   └── reset.sh                    # custom reset bash-it aliases/plugins/completions
β”œβ”€β”€ bin/                            # link to ~/bin
β”‚   β”œβ”€β”€ sub/                        # Collections of sub commands
β”‚   β”œβ”€β”€ sub-bin*                    # Sub main file
β”‚   └── a -> ./sub-bin              # Enterpoint of sub commands
β”œβ”€β”€ bootstrap -> ./bootstrap.bash*
β”œβ”€β”€ bootstrap.bash*
β”œβ”€β”€ cheat/                          # It is ignored in git. git clone https://github.com/adoyle-h/my-command-cheat cheat
β”œβ”€β”€ completions/                    # bash completions
β”œβ”€β”€ configs/                        # application configuration
β”œβ”€β”€ dotbot/                         # https://github.com/anishathalye/dotbot
β”œβ”€β”€ install*
β”œβ”€β”€ install.conf.yaml               # dotbot configuration
β”œβ”€β”€ nvim/                           # neovim configuration. It is ignored in git. git clone https://github.com/adoyle-h/neovim-config nvim
└── secrets/                        # Put your sensitive data here. It is ignored in git. mkdir secrets
    └── secrets.env.bash

Bash initialization process

It will generally execute these scripts in order:

  1. bash/bashrc
  2. bash_it/enable
  3. bash_it framework
    1. bash_it/{lib,aliases,completions,plugins}
  4. bash-custom/*.bash
    1. system-detect.shell.bash
      • Macos/*.bash
      • Debian/*.bash
  5. bash-custom/enabled/*.bash

Bash-it Enables/Disables

The aliases/plugins/completions I enabled could be referred in bash_it/reset.sh.

Customize your Bash

All your own plugins should be put in bash-custom/.

Sometimes, you could modify the files in bash_it/ for prior execution.

You should leave the bash/ folder alone. DO NOT CHANGE ANYTHING IN IT.

Binary executables

All your own binary executables should be put in bin folder.

Sub-commands

These executables could also be put in bin/sub/ which is included in $PATH, and it could be referred as sub-command. Example:

  • a help
  • a comments
  • a 256color

All sub-commands are auto-completed. Type a <Tab> to see all sub-commands.

Secret Data

Type ll bash-custom/secrets.env.bash, and you will see that:

bash-custom/secrets.env.bash@ -> ../secrets/secrets.env.bash

So, you could maintain your classified data in secrets/secrets.env.bash.

The secrets/ folder is ignored by git. You could put anything in this folder.

Version

No version yet

Suggestion, Bug Reporting, Contributing

Sorry, the project is a personal project which do not accept any Pull Requests. You could fork the repo to build your own project.

Any comments and suggestions are always welcome. Please open an issue to contact with me.

Copyright and License

Copyright (c) 2017 ADoyle. The project is licensed under the BSD 3-clause License.

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

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