Skip to content

brumle80/dotfiles

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dotfiles

My dotfiles. https://github.com/davidosomething/dotfiles

terminal screenshot

Screenshot of my ZSH prompt

Installation

For mac, see full install details in mac/README.md.

Clone and run the symlink script:

git clone --recurse-submodules https://github.com/davidosomething/dotfiles ~/.dotfiles
~/.dotfiles/bootstrap/symlink

(WIP) After symlinking, ~/.dotfiles/bootstrap/cleanup can detect and move pre-existing dotfiles that might conflict with these.

Post-Installation

Recommended steps

  • Create XDG child directories (run bootstrap/xdg). The base directories are probably already initialized by /etc/xdg/autostart/user-dirs-update-gtk.desktop.
  • Install and use Fira (Fura) Mono for Powerline font (install to ${XDG_DATA_HOME}/fonts on *nix)
  • Install ZSH and set it as the default (ensure its presence in /etc/shells); restart the terminal and zplugin will self-install
  • See OS specific notes in mac/README.md and linux/README.md and linux/arch.md
  • Useful Chrome extensions are in chromium/README.md
  • Install node and the default npm packages; rm will then alias to the trash-cli script.

Dev environment setup

Install these using the system package manager. For macOS/OS X there are helper scripts.

  • chruby, ruby-install, then use ruby-install to install a version of ruby (preferably latest)
  • Install nvm MANUALLY via git clone into $XDG_CONFIG_HOME, then use it to install a version of node (and npm install --global npm@latest)
  • php, composer, use composer to install wp-cli
  • Use pyenv-installer for pyenv, pyenv-virtualenv, then create a new env with a new python/pip.
    • Remove ~/.local/pyenv if it exists before installing pyenv via pyenv-installer (e.g. had installed it via brew by accident)
    • Create virtualenvs for Neovim.

Provisioning scripts

These will assist in installing packages and dotfiles. Best to have the Environment set up first.

  • bootstrap/cleanup moves some dotfiles into their XDG Base Directory supported directories
  • bootstrap/symlink symlinks rc files for bash, ZSH, ack, (Neo)vim, etc.
  • bootstrap/terminfo will copy/compile terminfo files for user to ~/.terminfo/*
  • bootstrap/x11 symlinks .xbindkeysrc, .xprofile
  • npm/install install default packages, requires you set up nvm and install node first
  • ruby/install-default-gems requires you set up chruby and install a ruby first.
  • python/install installs default pip packages. Requires pyenv already set up,

Updating

The sourced dko::dotfiles::main() function is available as the alias u. Use u without arguments for usage.

Notes

  • bin/
    • There's a readme in bin/ describing each script/binary. This directory is in the $PATH.
  • local/
    • Unversioned folder, put zshrc, bashrc, npmrc, and gitconfig here and they will be automatically sourced, LAST, by the default scripts. No dots on the filenames.
  • git/
    • The comment character is # instead of ; so I can use Markdown in my commit messages without trimming the headers as comments. This is also reflected in a custom Vim highlighting syntax in vim/after/syntax/gitcommit.vim.
  • python/
    • Never sudo pip. Set up a pyenv, and use a pyenv-virtualenv (which will delegate to pyvenv) if doing project specific work, and pip install into that userspace pyenv or virtualenv.
  • ruby/
    • Never sudo gem. Set up a chruby env first, and then you can install gems into the userspace local to the active ruby env.
  • vim/
    • If curl is available, vim-plug can automatically download and install itself on first run. See vim/README.md for more information.

rc script source order

If you have node installed, the dko-sourced (bin/dko-sourced) command will show you (not exhaustively) the order scripts get sourced. Without node echo $DKO_SOURCE works.

For X apps (no terminal) the value is probably:

/etc/profile
.xprofile
  shell/vars
    shell/xdg

Shell script code style

  • Script architecture
    • Use the #!/usr/bin/env bash shebang and write with bash compatibility
    • Create a private main function with the same name as the shell script. E.g. for a script called fun, there should be a __fun() that gets called with the original arguments __fun $@
    • Two space indents
    • Prefer . over source
  • Function names
    • Namespace helpers for scripting and provisioning following google shell style as dko::function_name(). These functions persist for the lifetime of the script or in the shell for sourced scripts.
    • For private functions in a script, use two underscores __private_func() These function names are safe to reuse after script execution. When namespaced, they are in the form of __dko::function_name().
  • Variable interpolation
    • Always use curly braces around the variable name when interpolating in double quotes.
  • Variable names
    • Stick to nouns, lower camel case
  • Variable scope
    • Use local and readonly variables as much as possible over global/shell-scoped variables.
  • Comparison
    • Not strict on POSIX, but portability
    • Use BASH == for string comparison
    • Use BASH (( $A == 2 )) for integer comparison

Credits

Logo from jglovier/dotfiles-logo

About

mac OS, Arch Linux, and Debian/Ubuntu

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 51.7%
  • Vim Script 44.6%
  • Python 1.1%
  • JavaScript 1.0%
  • Ruby 1.0%
  • PHP 0.3%
  • Other 0.3%