Compare commits
5 Commits
9262c9795a
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
7166d9196a
|
|||
|
61de00137c
|
|||
|
ad5a6c98ea
|
|||
|
634f4950f0
|
|||
|
5002a409f9
|
@@ -0,0 +1,23 @@
|
|||||||
|
# dotfiles
|
||||||
|
|
||||||
|
Designed around [GNU stow][gnu stow manual].
|
||||||
|
For `zsh` or `bash` (or both). Include `shell/` always.
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
```sh
|
||||||
|
git clone <repo> ~/.dotfiles
|
||||||
|
cd ~/.dotfiles
|
||||||
|
stow shell zsh # or: stow shell bash
|
||||||
|
```
|
||||||
|
|
||||||
|
## Update
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cd ~/.dotfiles
|
||||||
|
git pull
|
||||||
|
stow -R shell zsh # restow this host's packages
|
||||||
|
```
|
||||||
|
|
||||||
|
[gnu stow manual]: https://www.gnu.org/software/stow/manual/stow.html
|
||||||
|
|
||||||
@@ -10,7 +10,8 @@
|
|||||||
# Case-insensitive globbing (used in pathname expansion)
|
# Case-insensitive globbing (used in pathname expansion)
|
||||||
shopt -s nocaseglob;
|
shopt -s nocaseglob;
|
||||||
|
|
||||||
# Append to the Bash history file, rather than overwriting it
|
# Append to the Bash history file, rather than overwriting it.
|
||||||
|
# (HISTFILE/HISTSIZE/HISTFILESIZE/HISTCONTROL come from ~/.config/shell/exports.)
|
||||||
shopt -s histappend;
|
shopt -s histappend;
|
||||||
|
|
||||||
# Autocorrect typos in path names when using `cd`
|
# Autocorrect typos in path names when using `cd`
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
# Readline config (bash line editing + any readline program: python, psql...).
|
||||||
|
# Set via $INPUTRC; see shell/exports. zsh ignores this (uses ZLE); its
|
||||||
|
# equivalent prefix-search bindings live in zsh/.zshrc.
|
||||||
|
#
|
||||||
|
# Pull in distro defaults; a custom INPUTRC otherwise replaces them entirely.
|
||||||
|
$include /etc/inputrc
|
||||||
|
|
||||||
|
# zsh-style prefix history search: type a prefix, Up/Down walk matching
|
||||||
|
# history entries. Empty prefix = previous/next.
|
||||||
|
#
|
||||||
|
# Bind arrows straight to the search functions. Do NOT wrap in a macro that
|
||||||
|
# appends end-of-line (\C-e) to mimic zsh's cursor-at-end: \C-e moves point to
|
||||||
|
# the line end, and history-search-* takes its prefix from start-of-line to
|
||||||
|
# point -- so the next press searches for the whole recalled line, finds
|
||||||
|
# nothing, and Up/Down go dead. Pure readline has no history-search-end widget;
|
||||||
|
# cursor lands at the prefix boundary, which is readline's intended behavior.
|
||||||
|
"\e[A": history-search-backward
|
||||||
|
"\e[B": history-search-forward
|
||||||
|
"\eOA": history-search-backward
|
||||||
|
"\eOB": history-search-forward
|
||||||
@@ -7,8 +7,14 @@ export XDG_CACHE_HOME="$HOME/.cache"
|
|||||||
# Default editor
|
# Default editor
|
||||||
export EDITOR='vim'
|
export EDITOR='vim'
|
||||||
|
|
||||||
# Shell history file
|
# Shell history (env vars both shells read; each ignores the other's by name —
|
||||||
|
# zsh uses SAVEHIST, bash uses HISTFILESIZE/HISTCONTROL. zsh dedup is a setopt,
|
||||||
|
# not an env var, so it stays in .zshrc).
|
||||||
export HISTFILE="${XDG_CACHE_HOME:-$HOME/.cache}/shell/history"
|
export HISTFILE="${XDG_CACHE_HOME:-$HOME/.cache}/shell/history"
|
||||||
|
export HISTSIZE=1000000 # commands kept in memory (both shells)
|
||||||
|
export SAVEHIST=1000000 # zsh: lines written to $HISTFILE
|
||||||
|
export HISTFILESIZE=1000000 # bash: lines written to $HISTFILE
|
||||||
|
export HISTCONTROL=ignoreboth # bash: drop dups + space-prefixed
|
||||||
|
|
||||||
# Global git config file
|
# Global git config file
|
||||||
export GIT_CONFIG_GLOBAL="${XDG_CONFIG_HOME:-$HOME/.config}/git/config"
|
export GIT_CONFIG_GLOBAL="${XDG_CONFIG_HOME:-$HOME/.config}/git/config"
|
||||||
@@ -33,5 +39,8 @@ export PYTHON_HISTFILE="${XDG_CACHE_HOME:-$HOME/.cache}/python/history"
|
|||||||
# Wget config file
|
# Wget config file
|
||||||
export WGETRC="${XDG_CONFIG_HOME:-$HOME/.config}/wget/rc"
|
export WGETRC="${XDG_CONFIG_HOME:-$HOME/.config}/wget/rc"
|
||||||
|
|
||||||
|
# Readline config file (bash line editing + any readline program)
|
||||||
|
export INPUTRC="${XDG_CONFIG_HOME:-$HOME/.config}/readline/inputrc"
|
||||||
|
|
||||||
# NOTE: ZDOTDIR lives in ~/.zshenv, not here. It must be set before zsh reads
|
# NOTE: ZDOTDIR lives in ~/.zshenv, not here. It must be set before zsh reads
|
||||||
# any rc file, and this file is sourced too late for that.
|
# any rc file, and this file is sourced too late for that.
|
||||||
|
|||||||
@@ -8,5 +8,9 @@ for _file in "${XDG_CONFIG_HOME:-$HOME/.config}"/shell/{aliases,functions,extra}
|
|||||||
done
|
done
|
||||||
unset _file
|
unset _file
|
||||||
|
|
||||||
|
# Ensure the history dir exists; neither shell mkdir's it, so without this
|
||||||
|
# $HISTFILE writes fail silently on a fresh host.
|
||||||
|
[ -n "$HISTFILE" ] && mkdir -p "$(dirname "$HISTFILE")"
|
||||||
|
|
||||||
# pyenv interactive shims (pyenv init - autodetects the running shell):
|
# pyenv interactive shims (pyenv init - autodetects the running shell):
|
||||||
command -v pyenv >/dev/null 2>&1 && eval "$(pyenv init -)"
|
command -v pyenv >/dev/null 2>&1 && eval "$(pyenv init -)"
|
||||||
|
|||||||
@@ -12,9 +12,9 @@ setopt autocd # Automatically cd into typed directory.
|
|||||||
stty stop undef # Disable ctrl-s to freeze terminal.
|
stty stop undef # Disable ctrl-s to freeze terminal.
|
||||||
setopt interactive_comments
|
setopt interactive_comments
|
||||||
|
|
||||||
# History in cache directory:
|
# HISTFILE/HISTSIZE/SAVEHIST come from ~/.config/shell/exports (shared).
|
||||||
HISTSIZE=10000000
|
# Dedup is a setopt, not an env var (bash's HISTCONTROL=ignoreboth equivalent):
|
||||||
SAVEHIST=10000000
|
setopt hist_ignore_all_dups hist_ignore_space
|
||||||
|
|
||||||
# Basic auto/tab complete:
|
# Basic auto/tab complete:
|
||||||
autoload -U compinit
|
autoload -U compinit
|
||||||
|
|||||||
Reference in New Issue
Block a user