mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-01-26 11:14:08 +00:00
77 lines
2.4 KiB
Bash
Executable File
77 lines
2.4 KiB
Bash
Executable File
#!/usr/bin/env bash
|
||
# shellcheck shell=bash
|
||
# shellcheck disable=1091,2046
|
||
# vim: filetype=zsh
|
||
|
||
export DOTFILES="$HOME/.dotfiles"
|
||
source "$DOTFILES/scripts/shared.sh"
|
||
|
||
export LC_ALL=fi_FI.UTF-8
|
||
|
||
# Bash completion file location
|
||
export BASH_COMPLETION_USER_FILE="${XDG_CONFIG_HOME}/bash-completion/bash_completion"
|
||
|
||
# History env variables
|
||
export HIST_STAMPS="yyyy-mm-dd"
|
||
# Larger bash history (allow 32³ entries; default is 500)
|
||
export HISTSIZE=32768
|
||
export HISTFILESIZE=$HISTSIZE
|
||
# don't put duplicate lines or lines starting with space in the history.
|
||
# See bash(1) for more options
|
||
export HISTCONTROL=ignoreboth
|
||
# Make some commands not show up in history
|
||
export HISTIGNORE="ls:cd:cd -:pwd:exit:date:* --help"
|
||
# And include the parameter for ZSH
|
||
export HISTORY_IGNORE="(ls|cd|cd -|pwd|exit|date|* --help)"
|
||
|
||
# Less history location
|
||
export LESSHISTFILE="$XDG_STATE_HOME"/less/history
|
||
|
||
# Highlight section titles in manual pages
|
||
export LESS_TERMCAP_md="$ORANGE"
|
||
|
||
# zsh autoloaded terminfo
|
||
export TERMINFO="$XDG_DATA_HOME"/terminfo
|
||
export TERMINFO_DIRS="$XDG_DATA_HOME"/terminfo:/usr/share/terminfo
|
||
|
||
# Don’t clear the screen after quitting a manual page
|
||
export MANPAGER="less -X"
|
||
|
||
# Always enable colored `grep` output
|
||
export GREP_OPTIONS="--color=auto"
|
||
|
||
# check the window size after each command and, if necessary,
|
||
# update the values of LINES and COLUMNS.
|
||
hash shopt 2> /dev/null && shopt -s checkwinsize
|
||
|
||
# Load iterm2 shell integration
|
||
# https://iterm2.com/documentation-shell-integration.html
|
||
[[ -f "$XDG_BIN_HOME/iterm2_shell_integration.zsh" ]] \
|
||
&& source "$XDG_BIN_HOME/iterm2_shell_integration.zsh"
|
||
|
||
# Set dircolors based on the file, if it exists
|
||
have dircolors && eval $(dircolors "$XDG_CONFIG_HOME/dircolors")
|
||
|
||
# If we are using zsh, color our dir lists and such
|
||
if [ "$SHELL" = "$(which zsh)" ]; then
|
||
autoload -U colors zsh/terminfo compinit
|
||
colors
|
||
compinit -d "$XDG_CACHE_HOME"/zsh/zcompdump-"$ZSH_VERSION"
|
||
|
||
x-dc "$XDG_CACHE_HOME/zsh"
|
||
x-dc "$XDG_STATE_HOME/zsh"
|
||
export HISTFILE="$XDG_STATE_HOME/zsh/history"
|
||
zstyle ':completion:*' cache-path "$XDG_CACHE_HOME/zsh/zcompcache"
|
||
zstyle ':completion:*' list-colors "$LS_COLORS"
|
||
|
||
# fzf
|
||
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.zsh ] \
|
||
&& source "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.zsh
|
||
fi
|
||
|
||
# If we are using bash
|
||
if [ "$SHELL" = "$(which bash)" ]; then
|
||
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.bash ] \
|
||
&& source "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.bash
|
||
fi
|