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.
First, on Windows :
- Install Git for Windows, making sure to do a complete installation (install all utilies, add folders to PATH);
- Clone this repository to a directory of your choice, using the
--recursive
flag (since I include some submodules); - Install ConEmu;
- 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); - Run ConEmu to make sure everything is working;
- Install AutoHotKey and add to PATH;
- Create shortcuts for the AutoHotKey scripts in the StartUp Folder
%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup
;
On OS X:
- 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:
- Symlink
~/.gitconfig/
to$SECONDLAW/gitconfig
; - Install Visual Studio Code;
- Inside your bash configuration file (e.g.
~/.bash_profile
), define theSECONDLAW
variable to point to the installation directory from the step above, and then includesource $SECONDLAW/secondlaw.sh
in the configuration file. Important! Don't forget to actually define this variable, since it is used thourghout this project; - Install TeX Live and create a symbolic link for
latexmkrc
to~/.latexmkrc
; - Install my LaTeX packages:
- Install pandoc and create a symbolic link for the
pandoc
directory to Pandoc data directory (runpandoc --version
to check your system's data dir); - Create a
prm-data-win
orprm-data-osx
(depending on your system) inside this directory; - Install the DejaVu fonts;
- Install Python 3.
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 Insiders (or Emacs, if that is not available). Thee
alias is set up to the available editor.
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.
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.
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.
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.
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).
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.