Skip to content

🔧 A repository of my dotfiles to setup my development environments

Notifications You must be signed in to change notification settings

erictleung/dotfiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dotfiles

A repository of my dotfiles and OS-specific configuration details.

Contents

Motivation

This directory, as with many dotfile repositories, aim to create a reproducible configuration setup for when you move to a new computer. Because of my work and personal computer usage, I am to account for all major operating systems i.e. macOS, Windows, and Unix.

GNU Stow is used to manage my dotfiles. It symbolically links my configuration files to their appropriate places.

Setup

Install with respect to working operating system.

sudo apt-get install stow
brew install stow
sudo pacman -S stow

Installation

# Setup SSH keys
ssh-keygen

# ...Copy key from ~/.ssh/id_rsa.pub
# Add value to GitHub list of acceptable keys

# Install dotfiles
cd ~
git clone [email protected]:erictleung/dotfiles.git
cd dotfiles

# Install specific configurations
stow bash # e.g. bash configuration files

Operating Systems

Windows

If possible, installing the Windows Subsystem for Linux is the most ideal situation to having a terminal-like interface.

As an Emacs user, I want to use the visual GUI. This requires an X Client to generate the GUI. This can done using X Launch. Some instructions to set this up are written up here.

If WSL cannot used because of administrative privileges, the second best option is to install an Emacs GUI with Git Bash. To install the GUI from here. Download one of the installers, like emacs-27.2-x86_64-installer.exe,should install Emacs in C:/Program Files/.

When opening Emacs, the home directory is located in C:/Users/<user_name>/AppData/Roaming/. Because I use SyncThing to sync my Org mode notes, SyncThing should put its folders in this Roaming/ directory for path navigation to work as expected. Similarly, my dotfiles/ should be copied into this directory.

From Git Bash, you can run the following to link these files because stow don't be able to reach it properly.

cd
ln -s ~/dotfiles/emacs/.emacs.d ~/AppData/Roaming

In the past, I have made use of Cygwin as the terminal window I use. Updates and package management are done using the Cygwin executable file. However, it appears MSYS2 is a better alternative bceause it

"...provide[s] a build environment for native Windows software and the Cygwin-using parts are kept at a minimum."

When setting up MSYS2, the path defaults to the AppData/Roaming/ directory. To make it more native with the Window's user home director, navigate to ~/etc/nsswitch.conf and make the edit

db_home: windows # cygwin desc

These changes are summarized here. The packages in MSYS2 can be found here and here.

There is a package manager, chocolatey, that I've heard about and have downloaded, but it is less utilized. I will note here on using it in the future.

Unix

Homebrew and Linuxbrew are both great package managers when you don't have access to root.

Note: must have Ruby installed.

# macOS
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

# Linux
sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"

To uninstall Homebrew, run the following:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"

For LaTeX on Ubuntu,

cd ~
mkdir texmf
sudo apt-get install xzdec
tlmgr init-usertree

Termux

These tools are missing from the shell, so let's install them here.

pkg install vim emacs make git curl openssh stow

To install various machine learning packages, I found this repository helpful in some of the commands to run to install

https://github.com/sanheensethi/Installing-ML-in-Termux-Python

A quick summary of the commands below:

apt update
apt upgrade

apt install clang git python python-dev fftw freetype freetype-dev libpng \
    libpng-dev pkg-config

pip install --upgrade pip
pip install numpy matplotlib pandas jupyter

apt install wget

curl -o setup.sh https://its-pointless.github.io/setup-pointless-repo.sh
bash setup.sh
apt install scipy
rm setup.sh

pip install scikit-learn

Software Specific Setups

Emacs Info

Here are some notable packages I regularly depend on:

  • academic-phrases for academic writing
  • ace-window for better window management
  • avy/swiper for navigation in files
  • company for autocomplete
  • deft/zetteldeft for quick note management
  • elfeed/elfeed-org/elfeed-goodies for RSS reading
  • helm-bibtex for searching and managing bibliographies
  • org-brain for concept mapping
  • org-mode for drafting documents and organizing
  • org-ref for BibTeX bibliography management
  • projectile for quickly navigating files across project
  • try for simply trying out packages without commitments
  • w3m for browsing the internet within Emacs
  • which-key for hints when pressing key chords
  • writegood-mode for writing well
  • yasnippet for quick snippets and templates

Vim Setup

Run the following.

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

Then from within vim, run

:PluginInstall

to install the listed plugins in vim configuration file.

Git Setup

Reminder that this directory has git configurations that can be done again, but the information already exists here to make a consistent configuration across computers.

Useful Software

Below are some pieces of software that are useful for working and help me interface with files and be productive.

CLI

  • pandiff - Prose diffs for any document format supported by Pandoc; installs by npm.
  • jq - Lightweight and flexible command-line JSON processor.
  • ranger - A VIM-inspired file manager for the console.
  • sqlfluff - The SQL Linter for humans.
  • QRcode.show - Generate QR code using curl.
  • ShellCheck - A static analysis tool for shell scripts (live editor).

Web Tools

Cross-Platform Desktop

  • Color Oracle - Design for color impaired.
  • Freeplane - Free mind mapping and knowledge management software.
  • Publish or Perish - Retrieved and analyzes academic citations from variety of sources with a number of metrics.
  • TikZit - Simple GUI editor for graphs and string diagrams.
  • VLC Media Player - Free and open source cross-platform multimedia player.
  • LICEcap - Capture an area of your desktop and save it directly to .GIF.

Note: The above desktop applications were chosen to be cross platform and standards based in terms of their inputs and outputs, if applicable.

Windows Specific

  • Dexpot - Virtual desktops for Windows.
  • Cygwin - Linux feeling on Windows 7 (Windows 10 has Windows Subsystem for Linux (WSL) option for terminal).
  • WinDirStat - Disk usage statistics viewer and cleanup tool.
  • Rapid Environment Editor - Windows environment variables management.
  • ImageGlass - A lightweight, versatile image viewer.

Firefox Plugins