/smart-shell

A set of configurations to improve shell (zsh/bash) experience

Primary LanguageShellThe UnlicenseUnlicense

This repository contains a set of opinionated configurations to improve the bash experience. I use bash a lot in my day to day job and outside it. One thing I frequently struggle with is when I have to work on another machine, e.g. a server on the cloud, and then I lose all of the configurations I have on my local machine. This problem becomes particularly bothering for me since I have to frequently create new machines on the cloud, making it difficult to apply the new configurations over and over. Furthermore, I might discover a new nice configuration I want to apply, but then I have to apply it on all machines. As such, I decided to push all the common configurations to GitHubs

Table of Contents

Features

Shell (Z shell and Bash)

  • Z shell: Install oh-my-zsh for improved experience.
  • Bash: Install oh-my-bash for improved experience.
  • Increase command history to a million so you don't lose any command from your history.
  • Some useful aliases.
  • A colored version of cat using vimcat. Just type vimcat <filename> to display file with highlighting.
  • A random password generator. Try it by calling: newpass.
  • Install fzf for fuzzy finding:
    • Use Ctrl-T to search for files in the current hierarchy.
    • Use Ctrl-F to search the content of files in the current hierarchy.
    • Use Ctrl-R to search command history using fuzzy funder.

Vim Features

Installation

smart-shell can be installed with the following command:

wget -qO- https://raw.githubusercontent.com/rafidka/smart-shell/master/install.sh | sh

This will do the following:

  1. Clone the repository under ~/smart-shell.
  2. Update .zshrc and .bash_profile files to source ~/smart-shell/activate.sh. This file, on the other hand, ensures that the repository is up-to-date and then source the ~/smart-shell/smart-shell.{bash|zsh} file.
  3. Update .vimrc to source ~/smart-shell/vimrc.vim.
  4. Upon execution, smart-shell.{bash|zsh} will also install the necessary plugins.

Bash Users

It is also worth mentioning that depending on whether you are running bash in interactive or non-interactive mode, either .bashrc or .bash_profile will be loaded. It is possible to put all your configuration in .bashrc and then in .bash_profile you simply source .bashrc like:

[ -f ~/.bashrc ] && . ~/.bashrc