1
0
Fork 0
dot/bashrc

63 lines
1.4 KiB
Bash
Raw Normal View History

2023-12-20 20:49:40 +01:00
# ~/.bashrc
2023-08-12 01:22:07 +02:00
2023-12-20 20:49:40 +01:00
# if not running interactively, don't do anything
[ -z "$PS1" ] && return
2023-08-12 01:22:07 +02:00
2023-12-20 20:49:40 +01:00
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
2023-08-12 01:22:07 +02:00
2023-12-20 20:49:40 +01:00
# history
2024-01-14 23:24:31 +01:00
export HISTCONTROL=ignoredups:erasedups
export HISTSIZE=-1
export HISTFILESIZE=-1
2023-12-20 20:49:40 +01:00
shopt -s histappend
2024-01-14 23:24:31 +01:00
PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"
2023-08-12 01:22:07 +02:00
2023-12-20 20:49:40 +01:00
# set the title to user@host:dir
PS1="\[\e]0;\u@\h:\w\a\]$PS1"
2023-12-17 19:54:11 +01:00
2023-12-20 21:07:55 +01:00
# readline
bind "set editing-mode vi"
bind "set keyseq-timeout 50"
bind "set show-mode-in-prompt on"
bind "set vi-ins-mode-string \1\e[35m\2+\1\e[0m\2"
bind "set vi-cmd-mode-string :"
bind "set keymap vi-command"
bind "j:history-substring-search-forward"
bind "k:history-substring-search-backward"
bind "set keymap vi-insert"
bind '"\e[A":history-substring-search-backward'
bind '"\e[B":history-substring-search-forward'
bind "set show-all-if-ambiguous on"
bind "set completion-display-width 0"
bind "set colored-stats on"
bind "set visible-stats on"
2023-08-12 01:22:07 +02:00
# aliases
# exit
alias q="exit"
alias :q="exit"
# grep
alias grep="grep --color"
# ls
alias ls="ls --color"
2024-01-14 23:24:31 +01:00
alias ll="ls -AF1L"
alias lll="ls -AFlh"
2023-08-12 01:22:07 +02:00
# nvim
2024-01-14 23:24:31 +01:00
alias :e=nvim
2023-08-12 01:22:07 +02:00
2023-12-20 20:49:40 +01:00
# enable bash completion in interactive shells
2023-08-12 01:22:07 +02:00
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi