Skip to content

julian7/dotfiles

Repository files navigation

Julian7's dotfiles

This is my more or less educated guess on how to use a unix system. I use ZSH and FISH, therefore you won't find any other configurations (maybe bash later, as a fallback).

ZSH config

Most parts of the config is separated into various .zsh files in ~/.zsh.d. Notable settings:

  • editor: finds proper EDITOR var, creates some convenience aliases
  • osx-proxy-icons: adds proxy icon support to OSX Terminal
  • paths: extra path settings for rust, rbenv, Rancher Desktop
  • ruby: some ruby and ruby on rails aliases, sets up chruby / rbenv
  • settings: ZSH settings
  • ssh: GnuPG / Secretive agent support, Updates terminal titles on SSH
  • tmux: aliases and ssh title replacer function

FISH config

Fish settings are in ~/.config/fish/conf.d directory, which is 100% controlled by this repository. Notable settings:

  • paths: it adds a lot of convenience paths such as $HOME/bin and $HOME/.bin, keybase, homebrew, etc.
  • chefdk: aliases
  • direnv: loads fish hooks for direnv
  • docker: convenience aliases
  • editor: selects best editor, sets EDITOR environment variable, convenience aliases
  • fisher-bootstrap: downloads and runs fisher package manager
  • go: best practice variables
  • k8s: convenience aliases
  • node: yarn settings
  • ruby: convenience aliases, chruby-fish (if installed).
  • ssh: yubikey's OpenPGP ssh agent handling
  • tmux: aliases
  • tools: modern unix tool alternatives
  • vault: auth alias
  • wsl2: Yubikey support on Windows WSL2 environment: connects gpg-agent and ssh-agent with gpg4win, if wsl2-ssh-pageant.exe is available

Fish plugins are managed by fisher, and installed fisher plugins are controlled by this repository.

Plugins

  • fisher: package manager for fish

Other dotfiles

  • ack
  • git: global gitconfig and gitignore
  • terraform: to have a central plugin cache. Set TF_CLI_CONFIG_FILE variable to a different file if you want to modify it.
  • tmux

aliases and functions

  • ack: ack-grep (if ack-grep is installed)
  • b: bundle (ruby)
  • be: bundle exec (ruby)
  • ce: chef exec (chefdk)
  • cbe: chef exec bundle exec (chefdk)
  • dex: docker exec -ti, running sh by default
  • dstat (dip) shows docker images' IP addresses and memory consumption
  • dps: nicer docker ps
  • grep: grep -a --color=always (general)
  • gvim: set to mvim (if installed)
  • joe: set to 'vim' on systems where joe is not installed
  • k: kubectl
  • killagent: more drastic gpg-agent restarter, when reagent is not enough
  • kubesh: runs a docker image on kubernetes interactively
  • ls: uses exa if available
  • mate_wait: non-forking textmate
  • r: script/rails (ruby)
  • reagent: re-runs gpg-agent in case it becomes unavailable
  • serve: simple ruby-based static webserver
  • t: tmux -u (tmux)
  • tax: terraform apply x
  • tf: terraform
  • tpx: terraform plan -out x
  • vaultauth: runs userpass authentication to vault
  • vi: set to nvim, vim or mvim (if installed)
  • vim: set to nvim (if installed)

GIT aliases

  • aa: add --all
  • br: branch
  • ci: commit
  • co: checkout
  • cp: cherry-pick
  • dc: diff --cached
  • di: diff
  • fm: full merge (merge --no-ff)
  • h: pretty oneline history
  • largest: shows largest n (default: 10) files in git repository
  • man: help
  • s: switch (replacing checkout)
  • st: status -sb (shorter status)
  • unadd: reset HEAD
  • upstream: shows current branch's default remote

scripts

  • colorcolumn: just like 'column', but ANSI-colors-aware
  • kcx: kubernetes context switcher
  • kns: kubernetes namespace switcher
  • repostat: finds git repos in your path, and shows repo cleanliness
  • set-ssh-auth-sock: changing current SSH_AUTH_SOCK value. Currently gpg and secretive are supported.

Installation

  • Clone repo: git clone https://github.com/julian7/dotfiles.git
  • Change to dotfiles dir
  • Run ./INSTALL.sh
  • Modify your ~/.config/git/config file to reflect your personal setup (like user.name and user.email settings), as ~/.gitconfig is managed by dotfiles.

Example ~/.config/git/config file:

[user]
  name = Random J. Hacker
  email = rjh@example.com
[includeIf "gitdir:/Volumes/Work/**"]
  path = /Volumes/Work/.gitconfig
  • Set default SSH_AUTH_SOCK setter: if the system-provided SSH_AUTH_SOCK is not enough, you can choose from extra sockets (see ~/.ssh/sockets.conf). The file format is <NAME> <Path to socket>. No comments allowed.

    Create the file ~/.ssh/defaultsocket.conf with a single line containing the name of your chosen socket provider, like gpg or secretive.

  • Install packer.nvim for neovim, vim-plug for vim plugins.

Making changes

These changes are good for me, but you might want to have other settings (you don't want to publish your changes into git using my email address, do you?). This is where git comes handy.

  • Clone the repo and install (see above)
  • Make your changes
  • Commit changes (creating a local branch is a bonus)

Local changes can go to

  • ~/.zshrc.local
  • ~/.zshenv.local
  • ~/.zlogin.local
  • ~/.config/fish/config.fish (in case of using fish shell)
  • ~/.gitconfig.local (local git config)
  • ~/.config/nvim/lua/local/init.lua (local neovim config)
  • ~/.config/wezterm/local.lua (local wezterm config)

which are loaded at the end of the respective original scripts.

Upgrading

  • Fetch changes from GitHub
  • Merge changes with your changes (rebase works pretty well if you don't want to publish your repo anywhere)
  • Enjoy

Requirements

  • zsh / fish
  • git

OSX-specific

Use Homebrew. This is the easiest way of managing packages.

Extensions in mind

  • chruby: ruby selector environment: install with brew install chruby.
  • chruby-fish: wrapper around chruby for fish shell. Install with brew install chruby-fish.
  • direnv: Environment switcher for shell. Install with go get -u github.com/direnv/direnv.
  • dust: a more intuitive du, written in rust.
  • exa: Modern ls replacement, written in rust. It comes with a single binary, but can be installed with brew install exa too, on MacOS.
  • fzf: command line fuzzy finder in shell history. Install with brew install fzf, then run /usr/local/opt/fzf/install --key-bindings --completion --no-update-rc.
  • GNU Privacy Guard: OpenPGP implementation. Currently requires a MacOS-only pinentry program. Install: brew install gnupg
  • lazygit: CLI UI for git. Its neovim plugin allows lazygit integration, which makes fugitive basically obsolete.
  • Neovide: Simple cross-platform GUI for Neovim. Install: brew install --cask neovide.
  • packer.nvim: Neovim plugin manager. Run git clone --depth 1 https://github.com/wbthomason/packer.nvim ~/.local/share/nvim/site/pack/packer/start/packer.nvim to install.
  • pinentry-mac: GUI-based pinentry app for MacOS. Currently this is the pinentry application for GnuPG. Install: brew install pinentry-mac
  • rbenv: ruby selector environment: brew install rbenv / see README
  • powerline-go: Powerline-like shell prompt. Use of starship is more recommended. Install: go get -u github.com/justjanne/powerline-go
  • rbenv-vars: mkdir ~/.rbenv/plugins; cd ~/.rbenv/plugins; git clone https://github.com/sstephenson/rbenv-vars.git
  • ripgrep: blazing fast grep -r replacement. Install: brew install ripgrep / apt-get install ripgrep.
  • ruby-install: ruby builder for chruby: see README
  • ruby-build: ruby builder for rbenv: see README
  • rust: Rust programming language. Install with brew install rustup-init. Non-RISC non-mac installs can use curl https://sh.rustup.rs -sSf | sh. Then, use rustup-init to install rust packages.
  • Secretive: stores SSH keys in Secure Enclave (mac only). Install with brew install secretive.
  • starship: blazing-fast multi-shell command prompt. Install: brew install starship.
  • tmux: terminal multiplexer. You will love it, especially if you use PuTTY or any non-tabbed terminal clients.
  • vim-plug: Minimalist Vim Plugin Manager, used for vim installations. Run curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim to install, and then run vim -c PlugInstall -c exit -c exit to configure. Neovim users should install it by curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim instead.
  • wezterm: cross-platform terminal emulator and multiplexer written in rust. Install: brew install --cask wezterm.
  • wsl2-ssh-pageant: tunnels gpg4win's gpg agent into wsl2. To install, put the windows executable into your $HOME/.ssh in your wsl2 environment.
  • yarn: Alternative to Node Package Manager, especially for client-base javascript frameworks. Install with sudo npm -g install yarn.

Text font recommendations

The following fonts are all available in homebrew/cask-fonts cask. Add this cask to the tap to install these fonts: brew tap homebrew/cask-fonts. Then, install individual fonts with brew install --cask font-XXX (where font-XXX is the font name).

Prompt generators, vim statuslines require extra characters, Nerdfonts conversion is recommended.

  • Comic Mono: only for the lulz. Cask font name: font-comic-mono. Unfortunately, its Nerdfont version doesn't have a convenient install, it has to be installed manually from xtevenx/ComicMonoNF repo.
  • FiraCode: the first code font with ligatures. Font names: font-fira-code, font-fira-code-nerd-font.
  • Iosevka font. Narrow, but well-readable. It has ligatures and powerline support. Font names: font-iosevka, font-iosevka-nerd-font.
  • JetBrains Mono: monospace font from JetBrains. Font names: font-jetbrains-mono, font-jetbrains-mono-nerd-font. Note: this is the default font in all GUI settings.
  • Source Code Pro / Sauce Code Pro Nerd font: Font names: font-source-code-pro, font-sauce-code-pro-nerd-font.

Copyright

Creative Commons Licence This work is licensed under a Creative Commons Attribution 3.0 Unported License.

About

my unix environment

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published