What do you do when you have a Mac or Linux computer, and you get another one? You’ve spent a lot of time customizing your command line via your dot files (.bashrc, .bash_profile, .gitconfig, .vimrc, etc) over the last few years. During my research, people had created a number of cool solutions, that were virtually identical. The drawback was they weren’t shareable or reusable. To make them reusable, I added many of such snippets to Opal. Then I sanitized and standardized names and functionality Normally getting your command line configured on your new machine often takes a lot of work. That’s where Opal can help.
Opal, a Command Line Framework
Opal is a linux/unix command line framework for power users and web developers. Its’ design makes it re-usable across users and machines, and is easily extendable. It provides a solid foundation of dotfiles, that you can easily build upon. I wanted the project to be useful for others as well — so I made it extensible. Each major UNIX config file is created so that it includes the base configuration from Opal at the top, allowing the user to add their own below. Here’s a minimal .bashrc example to demonstrate what I mean.
#!/bin/bash source ~/opal/bash/bashrc # # Add you config below # source ~/.bash-aliases alias gca="git commit -a" alias ll="ls -l"
The 3 main pieces are Bash, Vim, and Git. Some users prefer ZShell, while others C Shell. However, I focus on Bash, since it has the biggest user base across Linux and Mac systems. Documentation for Opal is availabe at the GitHub repo, with a full documentation site currently being planned.
Bash Shell Configuration
.bash_profile provide a default shell configuration. There are large number of aliases, functions, and settings usable both in your config files, as well as on the command line. Numerous aliases representing the current date and time from various timezones are available. Convenience functions like
cdls help the user experience. New functions like
seg allows you to exttract a set of consecutive lines from the middle of a file. The
numseg operates like
seg with line numbers included, which is useful for providing samples of content.
Vim Editor Configuration
A set of Vim files are provided, one for general editing, as well as a configuration file for a number of major open source projects like WordPress, Drupal, Laravel, and CodeIgniter. A number of utility commands to make your command line experience little easier, a little better.
It was designed in part, with the hope of minimizing the duplication across individual dotfiles projects. Several utility functions are included, as well as multiple vimrc files to help web developers