diff options
| author | 2026-02-10 04:29:50 +0000 | |
|---|---|---|
| committer | 2026-02-10 04:29:50 +0000 | |
| commit | c52036c2bece92b960af560256e15961fd283ecc (patch) | |
| tree | 84e86e8e975ec69a04f6e4401e8c5e2082630190 /dot_bashrc | |
| parent | add .profile (diff) | |
| download | dotfiles-c52036c2bece92b960af560256e15961fd283ecc.tar.gz | |
add .bashrc
Diffstat (limited to 'dot_bashrc')
| -rw-r--r-- | dot_bashrc | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/dot_bashrc b/dot_bashrc new file mode 100644 index 0000000..7308301 --- /dev/null +++ b/dot_bashrc | |||
| @@ -0,0 +1,80 @@ | |||
| 1 | # If not running interactively, don't do anything | ||
| 2 | [[ $- != *i* ]] && return | ||
| 3 | |||
| 4 | alias ls='ls -p --color=auto' | ||
| 5 | alias ll='ls -Alh' | ||
| 6 | alias cz='chezmoi' | ||
| 7 | alias e="emacsclient --no-wait --quiet" | ||
| 8 | alias ee="emacsclient --no-wait --quiet --create-frame" | ||
| 9 | alias cmatrix="cmatrix -C blue" | ||
| 10 | |||
| 11 | PS1='\[\e[36m\][\[\e[34m\]\u\[\e[36m\]@\[\e[34m\]\h\[\e[36m\]:\[\e[34m\]\w\[\e[36m\]] \[\e[95m\]\$\[\e[0m\] ' | ||
| 12 | |||
| 13 | # Update window size after every command | ||
| 14 | shopt -s checkwinsize | ||
| 15 | |||
| 16 | # Prevent file overwrite on stdout redirection | ||
| 17 | # Use `>|` to force redirection to an existing file | ||
| 18 | set -o noclobber | ||
| 19 | |||
| 20 | # Turn on recursive globbing (enables ** to recurse all directories) | ||
| 21 | shopt -s globstar | ||
| 22 | |||
| 23 | # Automatically trim long paths in the prompt (requires Bash 4.x) | ||
| 24 | PROMPT_DIRTRIM=2 | ||
| 25 | |||
| 26 | # Perform file completion in a case insensitive fashion | ||
| 27 | bind "set completion-ignore-case on" | ||
| 28 | |||
| 29 | # Treat hyphens and underscores as equivalent | ||
| 30 | bind "set completion-map-case on" | ||
| 31 | |||
| 32 | # Display matches for ambiguous patterns at first tab press | ||
| 33 | bind "set show-all-if-ambiguous on" | ||
| 34 | |||
| 35 | # Immediately add a trailing slash when autocompleting symlinks to directories | ||
| 36 | bind "set mark-symlinked-directories on" | ||
| 37 | |||
| 38 | # Append to the history file, don't overwrite it | ||
| 39 | shopt -s histappend | ||
| 40 | |||
| 41 | # Save multi-line commands as one command | ||
| 42 | # shopt -s cmdhist | ||
| 43 | |||
| 44 | # Record each line as it gets issued | ||
| 45 | PROMPT_COMMAND='history -a' | ||
| 46 | |||
| 47 | # Huge history. Doesn't appear to slow things down, so why not? | ||
| 48 | HISTSIZE=500000 | ||
| 49 | HISTFILESIZE=100000 | ||
| 50 | |||
| 51 | # Avoid duplicate entries | ||
| 52 | # HISTCONTROL="erasedups:ignoreboth" | ||
| 53 | |||
| 54 | # Don't record some commands | ||
| 55 | export HISTIGNORE="&:[ ]*:exit:bg:fg:history:clear" | ||
| 56 | export HISTFILE="$XDG_CACHE_HOME/.bash_history" | ||
| 57 | |||
| 58 | # Use standard ISO 8601 timestamp | ||
| 59 | # %F equivalent to %Y-%m-%d | ||
| 60 | # %T equivalent to %H:%M:%S (24-hours format) | ||
| 61 | HISTTIMEFORMAT='%F %T ' | ||
| 62 | |||
| 63 | # Prepend cd to directory names automatically | ||
| 64 | shopt -s autocd | ||
| 65 | # Correct spelling errors during tab-completion | ||
| 66 | shopt -s dirspell | ||
| 67 | # Correct spelling errors in arguments supplied to cd | ||
| 68 | shopt -s cdspell | ||
| 69 | |||
| 70 | # This defines where cd looks for targets | ||
| 71 | # Add the directories you want to have fast access to, separated by colon | ||
| 72 | # Ex: CDPATH=".:~:~/projects" will look for targets in the current working directory, in home and in the ~/projects folder | ||
| 73 | CDPATH="." | ||
| 74 | |||
| 75 | # This allows you to bookmark your favorite places across the file system | ||
| 76 | # Define a variable containing a path and you will be able to cd into it regardless of the directory you're in | ||
| 77 | shopt -s cdable_vars | ||
| 78 | # export dotfiles="$HOME/dotfiles" | ||
| 79 | |||
| 80 | export GPG_TTY=$(tty) | ||
