My dotfiles. https://github.com/davidosomething/dotfiles
- macOS/OS X, Arch Linux, and Debian compatible
- XDG compliance wherever possible to keep
$HOME
clean - ZSH and BASH configs
- VIM and Neovim configs
- RC files for lua, markdown, node, php, python, r, ruby, shell
Screenshot of my zsh prompt
For mac, see full install details in mac/README.md.
Clone and run the symlink script:
git clone --recurse-submodules https://git.io/vg0hV ~/.dotfiles
~/.dotfiles/bootstrap/symlink.sh
- Create XDG child directories (run
bootstrap/xdg.sh
). 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 change default shell to it (ensure listed in
/etc/shells
) and restart shell (zplug will self-install) - See OS specific notes in mac/README.md and for linux linux/README.md and linux/arch.md
- Chrome extensions I use are listed in chromium/README.md
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- Install nvm MANUALLY via git clone into
$XDG_CONFIG_HOME
, then use it to install a version ofnode
(andnpm install --global npm@latest
) php
,composer
, use composer to installwp-cli
- Use pyenv-installer for
pyenv
,pyenv-virtualenv
, then create a new env with a new python/pip.- Create virtualenvs for neovim.
These will assist in installing packages and dotfiles. Best to have the Environment set up first.
bootstrap/cleanup.sh
moves some dotfiles into their XDG Base Directory supported directoriesbootstrap/symlink.sh
symlinks rc files for bash, zsh, ack, (neo)vim, etc.bootstrap/terminfo.sh
will copy/compile terminfo files for user to~/.terminfo/*
bootstrap/x11.sh
symlinks.xbindkeysrc
,.xprofile
npm/install.sh
install default packages, requires you set up nvm and install node firstruby/install-default-gems.sh
requires you set up chruby and install a ruby firstpython/install.sh
requires you set up pyenv. Install default pip packages
The sourced dko::dotfiles::main()
function is available as the alias u
.
Use u
without arguments for usage.
bin/
- There's a readme in
bin/
describing each script/binary. This directory is added to the$PATH
.
- There's a readme in
local/
- Unversioned folder, put
zshrc
,bashrc
,npmrc
, andgitconfig
here and they will be automatically sourced, LAST, by the default scripts. No dots on the filenames.
- Unversioned folder, put
git/
- The comment character was changed from
#
to;
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 invim/after/syntax/gitcommit.vim
.
- The comment character was changed from
python/
- Never
sudo pip
. Set up a pyenv, and use a pyenv-virtualenv (which will delegate topyvenv
) if doing project specific stuff, and pip install into that userspace pyenv or virtualenv.
- Never
vim/
- If
curl
is installed, vim-plug will be downloaded and plugins will install on run. See vim/README.md for more information.
- If
echo $DKO_SOURCE
to see what files were loaded to get to the current shell
state. If you have node installed, the dko-sourced
(bin/dko-sourced) command has better output formatting.
For X apps (no terminal) the value is probably:
/etc/profile
.xprofile
shell/vars
shell/xdg
- 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
- Use the
- Function names
- My helpers for scripting and provisioning via these dotfiles are
namespaced following google shell style as
dko::function_name()
. These functions are expected to persist for the lifetime of the script or in the shell if the script was sourced. - 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()
.
- My helpers for scripting and provisioning via these dotfiles are
namespaced following google shell style as
- 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
andreadonly
variables as much as possible over global/shell-scoped variables.
- Use
Logo from jglovier/dotfiles-logo