Skip to content
An engineer's approach to organize dotfiles
Python Shell AutoHotkey
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bash-git-prompt @ 40f2d1b
bin
ipython/profile_default
jupyter
pandoc/templates
prm @ b8d7541
.gitignore
.gitmodules
ConEmu.xml
LICENSE
README.md
aliases.sh
exports.sh
functions.sh
gitconfig
latexmkrc
macos.sh
path.sh
prompt.sh
secondlaw.sh
windows.sh

README.md

secondlaw

An engineer's approach to organize dotfiles. We try to minimize entropy, although that's not always possible.

This is a personal project where I try to organize my terminal configurations. There aren't any special features; I just want to have all my configurations acessible everywhere, in a very OS-independent and modularized way.

Installation

First, on Windows :

  1. Install Git for Windows, making sure to do a complete installation (install all utilies, add folders to PATH);
  2. Clone this repository to a directory of your choice, using the --recursive flag (since I include some submodules);
  3. Install ConEmu;
  4. Copy ConEmu.xml to %APPDATA% (unfortunately, it seems ConEmu cannot read symbolic links as settings file, so anytime the settings file it has to be exported to this repo to keep track of it; on the other hand, every time this repo is update you may have to copy this file again);
  5. Run ConEmu to make sure everything is working;
  6. Install AutoHotKey and add to PATH;
  7. Create shortcuts for the AutoHotKey scripts in the StartUp Folder %APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup;

On OS X:

  1. Clone this repository to a directory of your choice, using the --recursive flag (since I include some submodules).

Then, on either Windows OR OS X:

  1. Symlink ~/.gitconfig/ to $SECONDLAW/gitconfig;
  2. Install Visual Studio Code;
  3. Inside your bash configuration file (e.g. ~/.bash_profile), define the SECONDLAW variable to point to the installation directory from the step above, and then include source $SECONDLAW/secondlaw.sh in the configuration file. Important! Don't forget to actually define this variable, since it is used thourghout this project;
  4. Install TeX Live and create a symbolic link for latexmkrc to ~/.latexmkrc;
  5. Install my LaTeX packages:
  6. Install pandoc and create a symbolic link for the pandoc directory to Pandoc data directory (run pandoc --version to check your system's data dir);
  7. Create a prm-data-win or prm-data-osx (depending on your system) inside this directory;
  8. Install the DejaVu fonts;
  9. Install Python 3 and pipenv.

Current features

We are just at the beginning. First, the basics:

  • Some git aliases (type alias to see what's defined)
  • PDF mode for latexmkrc (later I may develop on this)
  • The EDITOR variable points to Visual Studio Code (or Emacs, if that is not available). The e alias is set up to the available editor.

Terminal in Windows

For Windows: Hyper-I will activate/deactivate ConEmu in a Visor style (you may want to put a shortcur to ConEmu in your start folder to assure fast access to the terminal on Windows).

The Hyper key is "created" by bin/hyper.ahk, transforming the left Ctrl key into Ctrl-Shift-Alt. This key combination is very hard to type and hence will likely not be used by any major application; therefore, it is useful for defining global, system-wide shortcuts.

For more explanations, including the source for this inspiration and how I configure keyboards, see this post of mine. I suggest also the use of my homectrl script.

Git prompt

I tried to develop a nice and simple prompt, and the implementation is based on my fork of git-prompt-bash. Basically, the prompt looks like this: <user> in <dir> <git-info>. This repo is included as a submodule. The theme used is Solarized.

Bash projects

I use my fork of the prm package. In secondlaw.sh, I defined two possible locations for the configuration files for this package, based on the operating system (the prm-data-* directories). Check the repo page for more details. There are also some useful aliases.

Autohotkey

I will collect some AutoHotKey scripts in the bin directory (together with some other bash scripts). Read the comments in them to see what they do.

Pandoc

My most common use case is to convert Markdown notes to LaTeX and PDF. I've tweaked the default Pandoc template for LaTeX, to use the techreport class and the engsymbols and magref packages (hence the requirements to install them).

IPython and Jupyter

The main Jupyter configuration directory is set to $SECONDLAW/jupyter. If you don't have Jupyter installed (presumably via Anaconda), nothing will happen.

There is a basic nbconvert configuration to my own uses. The custom templates are defined in $SECONDLAW/jupyter/templates. For they to make sense, you have to install my custom LaTeX classes and packages described above.

The IPython configuration directory is set to $SECONDLAW/ipython.

Only the configuration files and templates are tracked in version control for these profiles.

You can’t perform that action at this time.