PowerBash is a comprehensive, user-scoped environment configuration suite that supercharges your command-line productivity. It provides a highly customized Bash shell, advanced Git integration, a powerful tmux setup, and a feature-rich Vim environment with pre-configured plugins, all designed for convenience, clarity, and efficiency.
- Custom PS1 Prompt:
- Shows command return code status (
xfor failure,ofor success). - Displays the current Git branch (with
⎇symbol) if inside a Git repository. - Presents a complete and informative present working directory (PWD) path.
- Distinguishes root (
#) and normal user ($) prompts.
- Shows command return code status (
- Clipboard Integration:
- Includes the
osc_yankfunction for copying text to the system clipboard via OSC52 escape sequences, supporting xterm, tmux, and screen.
- Includes the
- Improved History and Usability:
- Appends to history, ignores duplicates, and sets sensible history sizes.
- Enables useful shell options:
globstar,checkwinsize,autoindent, and more.
- Colorful and Informative:
- Color support for prompt,
ls,grep, and GCC output. - Handy aliases for
ls,grep, and more. - Syntax highlighting for
manpages, supported bybat.
- Color support for prompt,
- Automatic Sourcing:
- Loads additional aliases from
~/.bash_aliasesif present. - Enables programmable completion if available.
- Loads additional aliases from
- Custom
.gitconfig:- Useful aliases for submodule management (commands like
git sclone,git supdate, etc.). - Pretty log formatting (commands like
git lg). - Sets Vim as the default editor and uses a custom commit message template.
- Enables colored output and credential storage.
- Useful aliases for submodule management (commands like
.gitignore:- Ignores build artifacts, tags, cscope files, and visual studio code editor folders.
- Commit Message Template:
- Enforces a consistent, emoji-based commit message style with clear scopes and change types.
- User-level
.tmux.conf:- Enables mouse support, sets a modern status line, and configures useful key bindings.
- Ensures compatibility with various tmux versions.
- Sets up history limits, color schemes, and other usability tweaks.
- Custom
.vimrc:- Enables syntax highlighting, color schemes (Dracula), and improved UI elements.
- Sets up filetype detection, indentation, and encoding options.
- Defines convenient key mappings for window navigation, quickfix, and more.
- Integrates cscope support for code navigation.
- Adds OSC52 yank support for copying text from remote to the local system clipboard.
- Pre-configured Plugins (via Pathogen):
- a.vim Swtich between source files and header files quickly.
- ack.vim: Fast code pattern searching (configured to use
agif available). - auto-pairs: Automatic insertion of matching brackets and quotes.
- dracula.vim: Dracula color scheme.
- indentline: Visual indentation guides.
- leaderf: Fuzzy file and tag finder.
- lightline.vim: Lightweight, customizable statusline.
- minibufexpl.vim: Buffer explorer.
- NERDTree: File explorer sidebar.
- nerdtree-git-plugin: Git status integration for NERDTree.
- OmniCppComplete: C++ code completion.
- rainbow: Rainbow parentheses for better code readability.
- taglist.vim: Source code tag browser.
- vim-auto-popmenu: Improved completion popup.
- vim-commentary: Easy commenting.
- vim-cppman: C++ manual integration.
- vim-dict: Dictionary support for Vim.
- vim-gitbranch: Git branch info for statuslines.
- vim-gitgutter: Git diff indicators in the sign column.
- vim-gutentags: Automatic tag file management.
- vim-plugin-AnsiEsc: ANSI escape sequence highlighting.
- vim-polyglot: Language pack for Vim.
- xterm-color-table.vim: Color table utility.
-
Clone the repository with submodules:
git clone --recurse-submodules https://github.com/sheer-rey/PowerBash.git
-
Install the configuration files by running the installer script:
cd PowerBash ./PowerBash -iBy default, this installs to your
$HOMEdirectory. See./PowerBash -hfor more information. -
Start the new bash environment or re-source your .bashrc to make configuration changes take effect in your shell:
source ~/.bashrc
-
Start a new tmux session to enjoy tmux with the enhanced configuration:
tmux
-
Open Vim to enjoy the enhanced environment:
vim
To uninstall PowerBash and revert to your previous configurations, run the uninstaller script:
cd PowerBash
./PowerBash -uThis will remove the installed configuration files from your $HOME directory.
- Enjoy a prompt that shows command status, Git branch, and full PWD.

- Use
osc_yankto copy text to your clipboard from the terminal. - Use handy aliases like
ll,la, andalert.
-
Use aliases like
git lg,git sclone,git supdate,git sfetch,git spull,git spush, etc.

-
Commit messages will use the provided template for clarity and consistency.

-
Use mouse support, modern status line, and improved navigation out of the box.

-
Commonly used tmux shortcuts
Keys Action Notes Prefix cCreate new window Opens a new tmux window Prefix &Kill current window Prompts for confirmation Prefix nNext window Cycle to the next window Prefix pPrevious window Cycle to the previous window Prefix <Num>Choose window Prefix ,Rename window Prompts for a new window name Prefix .Move window Prompt for destination index Prefix %Split pane vertically Creates a vertical split Prefix "Split pane horizontally Creates a horizontal split Prefix oSelect next pane Cycle focus to the next pane Prefix ;Select previous pane Cycle focus to the previous pane Prefix zToggle pane zoom Zooms the current pane Prefix xKill current pane Closes the active pane Prefix {Swap pane left/up Swap current pane with previous Prefix }Swap pane right/down Swap current pane with next Prefix [Enter copy mode Navigate and copy text in history Prefix ]Paste buffer Paste the tmux buffer into pane Prefix rReload config Reload ~/.tmux.confwithout restartingPrefix dDetach session Detach from the current tmux session Prefix sChoose session Interactive session switcher Prefix ?Show key bindings Displays configured tmux shortcuts
Notes:
Default Prefix isCtrl+B, configured Prefix isAlt+E.
If a mapping conflicts with your terminal, ensure your terminal emulator sends Alt/Meta keys or remap the prefix.
-
Use
<Leader>nto toggle NERDTree,<Leader>yto yank to clipboard,<Leader>mto toggle taglist, and more. -
Enjoy enhanced code navigation, completion, and syntax highlighting.
-
Commonly used vim commands and key mappings (Configured is
;in this setup)Command Description Provided by :w<CR>Save current file Built-in :q<CR>Quit current window Built-in :e {file}<CR>Open/edit a file Built-in :split<CR>Split window horizontally Built-in :vsplit<CR>Split window vertically Built-in :ls<CR>List opened buffers Built-in :bnext<CR>Jump to next buffer Built-in :bprev<CR>Jump to previous buffer Built-in :CscopeReload<CR>Try to find cscope database in pwdand reload itProject-configured :Helptags<CR>Generate vim help documents for installed plugins pathogen.vim :Ack {pattern}<CR>Fast project search (uses agif available)ack.vim :LeaderfFiles<CR>Open fuzzy file finder ctrlp / leaderf :LeaderfBuffer<CR>Open fuzzy buffer finder ctrlp / leaderf :LeaderfFunction<CR>Open fuzzy function finder for current buffer leaderf :LeaderfFunctionAll<CR>Open fuzzy function finder for all loaded buffers leaderf :Cppman! {symbol}<CR>Open C manual for symbol vim-cppman :Cppman {symbol}<CR>Open C++ manual for symbol vim-cppman
Key Mapping Description Provided by <C-W> hJump to the window left Built-in <C-W> jJump to the window below Built-in <C-W> kJump to the window above Built-in <C-W> lJump to the window right Built-in <C-P>Open fuzzy file finder ctrlp / leaderf <C-X><C-O>Trigger omni-completion (C/C++ via OmniCppComplete) OmniCppComplete
Key Mapping without prefix Description Provided by gcToggle comment on selected lines vim-commentary gccToggle comment on current line vim-commentary ]cJump to next git change vim-gitgutter [cJump to previous git change vim-gitgutter KOpen C/C++ manual page for symbol under the cursor vim-cppman
Key Mapping with key Description Provided by <Leader>hJump to the window left Project-configured <Leader>jJump to the window below Project-configured <Leader>kJump to the window above Project-configured <Leader>lJump to the window right Project-configured <Leader>sSplit window horizontally and explore current file's directory Project-configured <Leader>vSplit window vertically and explore current file's directory Project-configured <Leader>yYank selection to local clipboard via OSC52 Project-configured <Leader>coOpen quickfix window Project-configured <Leader>ccClose quickfix window Project-configured <Leader>cnJump to next result of quickfix window Project-configured <Leader>cpJump to previous result of quickfix window Project-configured <Leader>clShow result list in quickfix window Project-configured <Leader>aSwitch between source/header file (C/C++) a.vim <Leader>nToggle file explorer sidebar NERDTree <Leader>mToggle source tag browser taglist.vim <Leader>ffOpen fuzzy file finder ctrlp / leaderf <Leader>fbOpen fuzzy buffer finder ctrlp / leaderf <Leader>fmOpen fuzzy function finder for current buffer leaderf <Leader>famOpen fuzzy function finder for all loaded buffers leaderf <Leader>frLaunch leaderf to use rg interactively leaderf
Notes:
Built-in commands work in any Vim. Plugin-provided commands may require the plugin to be installed and loaded (they are included in this project).
To find exact commands for a plugin, open its docs under ~/.vim/bundle/{plugin}/doc or use:Helptagsafter installing bundles.
If Python support is not available in Vim or Vim version is below 7.4.1126, Leaderf plugin is inactive and CtrlP plugin is fallback to active, otherwise CtrlP plugin is disabled.
Check Python support with:echo has('python')or:echo has('python3')in Vim command mode.
Check Vim version with:versionin Vim command mode.
In order to make PowerBash works properly, ensure you have the following tools installed:
gittmux(almost versions is compatible, but 3.4 and above recommended)vim(almost versions is compatible, but 8.1 and above recommended)python2/3(for various Vim plugins)
And to make full use of all features, it's recommended to also have the following tools:
bat(for syntax highlighting inmanpages)ackorag(for fast searching in Vim)ctags(for taglist and code navigation in Vim)cscope(for code navigation in Vim)gtags(for GNU Global tagging system support in Vim)gtags-cscope(for cscope database generation and code navigation in Vim)rg(ripgrep, for fuzzy finding in Vim)cppman(for C++ manual integration in Vim)
With Ubuntu22.04 or later, you can install these tools using:
sudo apt install -y git tmux vim python3 bat ack silversearcher-ag universal-ctags cscope global ripgrep cppman- You can further customize any configuration file in your
HOME/directory. - You can further add your own aliases to
~/.bash_aliases. - You can further extend Vim with more plugins by adding them to
HOME/.vim/bundle/.
This project is inspired by and adapted or reused from the following excellent resources:
- PowerVim
- OmniCppComplete
- a.vim
- ack.vim
- auto-pairs
- ctrlp.vim
- dracula.vim
- indentLine
- leaderF
- lightline.vim
- minibufexpl.vim
- nerdtree
- nerdtree-git-plugin
- rainbow
- taglist.vim
- vim-auto-popmenu
- vim-commentary
- vim-cppman
- vim-dict
- vim-gitbranch
- vim-gitgutter
- vim-gutentags
- vim-plugin-AnsiEsc
- vim-polyglot
- xterm-color-table.vim
Thanks to their authors for their contributions to the open-source community!
This project is licensed under the GPL-3.0 License.
Make your Bash, Git, tmux, and Vim environments more powerful and convenient with PowerBash!
