I’m a Un✪x shell and Vi[m] user since 1986 and after years, my environment settings become messy. I never have to clean up because I was the only one using it. … and it was so convenient.

But now, I’m about to persuade my colleague to use vim for better pair programming. We started with a newly created user on a macMini running OS X.

Quickly, it turns out that my beloved environment becomes a hurdle. Everything I want to show to my colleague doesn’t work (out of the box) on his machine. This was so annoying that I came to a hard, but I think healthful, decision.

I start my environment from scratch

  1. returned to bash from fish.
  2. empty .bashrc, .profile, and .vimrc.
  3. added the most needed configurations ans vim-plug ins only.
  4. made Gists for the files.

Compared to my grown environment settings, this seems to be almost empty and fits in my head again 😁.

.bashrc and .andi-bash-functions

The .bashrc sets the language and term environment to UTF-8 and to xterm256-color. Then it loads my function library from .andi-bash-functions to have some helpers available for ‘prompt setting’ and pulling/pushing the files to Gist.

You can find them here:

Vim

In Vim the problem mentioned above was even harder. Boy, this setup was a mess! So, I empty the file and place only eighty lines of really important settings.

Other than that, I start with a fresh list of vim plug-ins and Vundle as my plugin-manager and added the elixir-package and some color-schemes.

The gists are here:

Conclusion

Because I learned a lot how to properly use my tools, It is really easy to use an almost default environment.

Advise

Learn to use your utilities rather than tweak them with a lot of fancy stuff, only you will be able to orchestrate.

The Craftsman

Wanna try?

This works with bash only! Although it may work with Linux it is tested on MacOS only.

If you wanna try my setup you can do it in very simple steps:

First backup your files

cd ~
cp .bashrc ._bashrc
cp .profile ._profile
cp .vimrc ._vimrc
cp .vimrc.plugins ._vimrc.plugins

If any of this files doesn’t exist on your machine, just ignore.

.profile

If you don’t have a file ~/.profile then create it

#!/bin/bash

[[ -f "$HOME/.bashrc" ]] && source $HOME/.bashrc
[[ -f "$HOME/.fzf.bash" ]] && source $HOME/.fzf.bash

Download Gists

Next download my Gists. Assuming you have curl installed.

  curl -o .bashrc https://gist.githubusercontent.com/iboard/ed91af202c66e435469021cef009bec2/raw/e56cc0be82a4e8ab1744085550e1df633c948b59/.bashrc
  curl -o .andi-bash-functions https://gist.githubusercontent.com/iboard/d6e6d17aa92058dc0b05abfc5d8dcb4f/raw/95ed1858de81403d760a43454f3b85fe342031ef/.andi-bash-functions
  curl -o .vimrc https://gist.githubusercontent.com/iboard/53176a554f74b8097e4c06da795fb929/raw/ab62674970aaadf1e42da9ee4a7eec0a5c1c80e5/.vimrc
  curl -o .vimrc.plugins https://gist.githubusercontent.com/iboard/9f634aa50aecec94dbd19046a9b67dce/raw/dc875b52f0af99679ae38d95b432febc1a5c9f30/.vimrc.plugins

  chmod +x .bashrc
  chmod +x .andi-bash-functions

Open a new terminal and you should see a prompt like:

HOST ~user ➣

Setup Vim

Finally check the path $HOME/.vim.

If you have this folder, move it to another name for backup.

mv ~/.vim ~/._vim

Create a new path and install the Vundle Plug in manager.

mkdir -p .vim/bundle
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim

Start vim and enter :PluginInstall

Updates

If you don’t have Gist installed, do it now with

brew install gist

and login to github with

gist --login

Once you have done the initial setup as shown above, you can simply update to the latest version of the gists by running pull_gists && r in your terminal.

Contribution

Please send your contribution to andreas@altendorfer.at and I may merge it into the Gists.

Bug fixes and simplifications mostly welcome but complications will be ignored.

Fzf Fuzzy File Finding for bash

In addition to this simple bash-setup, I recommend installing Fzf. It is a very useful fuzzy file finder for your bash. Enter your_command <ctrl+t> and get an “autocomplete” which acts beautifyl with fuzzy file finding down the path.

To install via Homebrew run the following commands:

brew install fzf

# To install useful key bindings and fuzzy completion:
$(brew --prefix)/opt/fzf/install