It all started as a gist to keep track of my dotfiles: https://gist.github.com/uhop/f11632fa81bff6fa4c25300656dce6e7
Now I decided to use chezmoi to manage them across computers.
Generic instructions (see platform-specific notes below):
- Install brew on MacOS or Linux.
- Install
chezmoi
:brew install chezmoi
- Initialize dotfiles:
chezmoi init --apply uhop
- Reboot.
Important! If you are not me, change your name and email in the global git
config:
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
And update your GitHub user name in .chezmoi.toml.tmpl
and at the bottom of .bashrc
.
The choice of tools and aliases is influenced by:
- https://www.askapache.com/linux/bash_profile-functions-advanced-shell/
- https://dev.to/flrnd/must-have-command-line-tools-109f
- https://remysharp.com/2018/08/23/cli-improved
- https://www.cyberciti.biz/tips/bash-aliases-mac-centos-linux-unix.html
- https://opensource.com/article/22/11/modern-linux-commands
- https://github.com/ibraheemdev/modern-unix
- VIM:
The following tools are installed and aliased:
wget
,httpie
— likecurl
.age
,gpg
— encryption utilities.meld
— a visual diff/merge utility.diff-so-fancy
— a nicediff
pager.tealdeer
,cheat
— aman
replacement. Alternatives:tldr
.exa
— betterls
.bat
— bettercat
.fd
— betterfind
.ncdu
,dust
— betterdu
.ag
,ripgrep
— betterack
.tig
,lazygit
— text interface forgit
.broot
— bettertree
.prettyping
,gping
— betterping
.htop
— bettertop
.awscli
,aws-iam-authenticator
,kubernetes-cli
,helm
,gh
,hub
,nginx
,net-tools
,xh
— useful utilities for web development.parallel
— shell parallelization.fzf
— a command-line fuzzy finder.micro
— an editor. Alternatives:nano
.jq
— JSON manipulations.tmux
— the venerable terminal multiplexor.golang
,python3
,pyenv
,rustc
,wabt
,zig
— language environments we use and love.brotli
— better thangzip
, used by HTTP.mc
— Midnight Commander for file manipulations.alacritty
— no-nonsense terminal.duf
— a disk utility.hyperfine
— benchmarking better thantime
.zoxide
— bettercd
.bottom
— a system monitor.node
,nvm
,deno
,bun
— JavaScript environments.helix
— a modal text editor.whalebrew
— likebrew
but for Docker images.xc
— a task runner.mosh
— a mobile shell.lnav
— a log navigator
Check .bash_aliases
for a list of aliases.
These instructions assume a newly installed OS. Otherwise, adjust accordingly.
- Install prerequisites:
sudo apt install build-essential curl git git-gui gitk micro
- Install
brew
:/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- The exact installation instructions can change from time to time. Check https://brew.sh/ if you encounter any problems.
- Restart the session or initialize
brew
:eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
- Install
chezmoi
:bash install chezmoi
- Initialize dotfiles:
chezmoi init --apply uhop
- The initial script installs various utilities using
apt
. Thus it requires asudo
password. Don't be alarmed. Inspectrun_onchange_before_install-packages.sh.tmpl
for more details.
- The initial script installs various utilities using
- Reboot.
Fonts on Linux (Ubuntu): see https://askubuntu.com/questions/3697/how-do-i-install-fonts
- Download font, e.g., Hack Nerd Font and/or FiraCode Nerd Font from https://www.nerdfonts.com/font-downloads
- Unzip its archive to
~/.local/share/fonts/
. - Run:
fc-cache -fv
FiraCode Nerd Font is used for code
(Visual Studio Code). It supports common programming ligatures.
Hack Nerd Font is used as a monospaced font for terminals (e.g., gnome-terminal
) and similar programs (git-gui
, gitk
, …).
These dotfiles assume that these fonts are preinstalled and use them as appropriate.
Restricted soft on Ubuntu to play videos:
sudo apt install ubuntu-restricted-extras vlc libdvd-pkg
sudo dpkg-reconfigure libdvd-pkg
More on videos: https://www.omgubuntu.co.uk/2022/08/watch-bluray-discs-in-vlc-on-ubuntu-with-makemkv
To support cut-and-paste in the micro editor:
- Use the default (
"external"
) for the clipboard option. - Install a proper command-line clipboard tool:
- For Wayland:
sudo apt install wl-clipboard
- For X11 (realistically only one could be installed):
sudo apt install xclip xsel
- You may install all of them for a good measure:
sudo apt install wl-clipboard xclip xsel
- For Wayland:
F10 doesn't work in a terminal: https://superuser.com/questions/1543538/f10-key-not-working-in-terminal-mc-ubuntu-19-10
See: https://support.google.com/titansecuritykey/answer/9148044?hl=en
A key should be registered only once. When I attempted to do so, I was misleadingly informed that "this device cannot be used to create passkeys". When it happened, press "Use other device", which will switch from the current computer to the key and now everything will go smoothly.
Enabling Fn keys:
- https://help.ubuntu.com/community/AppleKeyboard
- https://askubuntu.com/questions/33514/use-function-keys-without-pressing-the-fn-button-in-the-mac-keyboard
Video driver:
- https://askubuntu.com/questions/1295423/ubuntu-20-04-on-imac-mid-2011-cant-adjust-brightness
- This answer worked for my MacBook Air: https://askubuntu.com/a/1478635
I use apt
, snap
, flatpak
, brew
and AppImageLauncher
. Most GUI apps are installed with flatpak
.
They are installed manually using Win-A (Cmd-A) from Gnome.
flatpak
flatseal
—flatpak
permission editor.calibre
— an e-book manager.- Web browsers (used for testing):
- Brave
- Chromium
- Google Chrome
- Microsoft Edge
- Communications:
- Skype
- Slack
- Zoom
steam
— the game launcher from Valve.wezterm
— a modern terminal.
snap
code
— Visual Studio Code.firefox
— a web browser (it comes preinstalled).postman
— a tool for debugging network services.- It is available as a flatpak, but apparently it is completely unusable.
AppImageLauncher
- It is installed using the official
.deb
file or the PPA: https://github.com/TheAssassin/AppImageLauncher/wiki/Install-on-Ubuntu-or-Debian
- It is installed using the official
The prettier
plugin is installed manually: https://github.com/claromes/micro-prettier
Consider its cousing for Python: https://github.com/claromes/micro-yapf
Links on customization: