|
| 1 | +# To the extent possible under law, the author(s) have dedicated all |
| 2 | +# copyright and related and neighboring rights to this software to the |
| 3 | +# public domain worldwide. This software is distributed without any warranty. |
| 4 | +# You should have received a copy of the CC0 Public Domain Dedication along |
| 5 | +# with this software. |
| 6 | +# If not, see <http://creativecommons.org/publicdomain/zero/1.0/>. |
| 7 | + |
| 8 | +# base-files version 4.2-3 |
| 9 | + |
| 10 | +# ~/.bashrc: executed by bash(1) for interactive shells. |
| 11 | + |
| 12 | +# The latest version as installed by the Cygwin Setup program can |
| 13 | +# always be found at /etc/defaults/etc/skel/.bashrc |
| 14 | + |
| 15 | +# Modifying /etc/skel/.bashrc directly will prevent |
| 16 | +# setup from updating it. |
| 17 | + |
| 18 | +# The copy in your home directory (~/.bashrc) is yours, please |
| 19 | +# feel free to customise it to create a shell |
| 20 | +# environment to your liking. If you feel a change |
| 21 | +# would be benifitial to all, please feel free to send |
| 22 | +# a patch to the cygwin mailing list. |
| 23 | + |
| 24 | +# User dependent .bashrc file |
| 25 | + |
| 26 | +# If not running interactively, don't do anything |
| 27 | +[[ "$-" != *i* ]] && return |
| 28 | + |
| 29 | +# Shell Options |
| 30 | +# |
| 31 | +# See man bash for more options... |
| 32 | +# |
| 33 | +# Don't wait for job termination notification |
| 34 | +# set -o notify |
| 35 | +# |
| 36 | +# Don't use ^D to exit |
| 37 | +# set -o ignoreeof |
| 38 | +# |
| 39 | +# Use case-insensitive filename globbing |
| 40 | +# shopt -s nocaseglob |
| 41 | +# |
| 42 | +# Make bash append rather than overwrite the history on disk |
| 43 | +# shopt -s histappend |
| 44 | +# |
| 45 | +# When changing directory small typos can be ignored by bash |
| 46 | +# for example, cd /vr/lgo/apaache would find /var/log/apache |
| 47 | +# shopt -s cdspell |
| 48 | + |
| 49 | +# Completion options |
| 50 | +# |
| 51 | +# These completion tuning parameters change the default behavior of bash_completion: |
| 52 | +# |
| 53 | +# Define to access remotely checked-out files over passwordless ssh for CVS |
| 54 | +# COMP_CVS_REMOTE=1 |
| 55 | +# |
| 56 | +# Define to avoid stripping description in --option=description of './configure --help' |
| 57 | +# COMP_CONFIGURE_HINTS=1 |
| 58 | +# |
| 59 | +# Define to avoid flattening internal contents of tar files |
| 60 | +# COMP_TAR_INTERNAL_PATHS=1 |
| 61 | +# |
| 62 | +# Uncomment to turn on programmable completion enhancements. |
| 63 | +# Any completions you add in ~/.bash_completion are sourced last. |
| 64 | +# [[ -f /etc/bash_completion ]] && . /etc/bash_completion |
| 65 | + |
| 66 | +# History Options |
| 67 | +# |
| 68 | +# Don't put duplicate lines in the history. |
| 69 | +# export HISTCONTROL=$HISTCONTROL${HISTCONTROL+,}ignoredups |
| 70 | +# |
| 71 | +# Ignore some controlling instructions |
| 72 | +# HISTIGNORE is a colon-delimited list of patterns which should be excluded. |
| 73 | +# The '&' is a special pattern which suppresses duplicate entries. |
| 74 | +# export HISTIGNORE=$'[ \t]*:&:[fb]g:exit' |
| 75 | +# export HISTIGNORE=$'[ \t]*:&:[fb]g:exit:ls' # Ignore the ls command as well |
| 76 | +# |
| 77 | +# Whenever displaying the prompt, write the previous line to disk |
| 78 | +# export PROMPT_COMMAND="history -a" |
| 79 | + |
| 80 | +# Aliases |
| 81 | +# |
| 82 | +# Some people use a different file for aliases |
| 83 | +# if [ -f "${HOME}/.bash_aliases" ]; then |
| 84 | +# source "${HOME}/.bash_aliases" |
| 85 | +# fi |
| 86 | +# |
| 87 | +# Some example alias instructions |
| 88 | +# If these are enabled they will be used instead of any instructions |
| 89 | +# they may mask. For example, alias rm='rm -i' will mask the rm |
| 90 | +# application. To override the alias instruction use a \ before, ie |
| 91 | +# \rm will call the real rm not the alias. |
| 92 | +# |
| 93 | +# Interactive operation... |
| 94 | +# alias rm='rm -i' |
| 95 | +# alias cp='cp -i' |
| 96 | +# alias mv='mv -i' |
| 97 | +# |
| 98 | +# Default to human readable figures |
| 99 | +# alias df='df -h' |
| 100 | +# alias du='du -h' |
| 101 | +# |
| 102 | +# Misc :) |
| 103 | +# alias less='less -r' # raw control characters |
| 104 | +# alias whence='type -a' # where, of a sort |
| 105 | +# alias grep='grep --color' # show differences in colour |
| 106 | +# alias egrep='egrep --color=auto' # show differences in colour |
| 107 | +# alias fgrep='fgrep --color=auto' # show differences in colour |
| 108 | +# |
| 109 | +# Some shortcuts for different directory listings |
| 110 | +# alias ls='ls -hF --color=tty' # classify files in colour |
| 111 | +# alias dir='ls --color=auto --format=vertical' |
| 112 | +# alias vdir='ls --color=auto --format=long' |
| 113 | +# alias ll='ls -l' # long list |
| 114 | +# alias la='ls -A' # all but . and .. |
| 115 | +# alias l='ls -CF' # |
| 116 | + |
| 117 | +# Umask |
| 118 | +# |
| 119 | +# /etc/profile sets 022, removing write perms to group + others. |
| 120 | +# Set a more restrictive umask: i.e. no exec perms for others: |
| 121 | +# umask 027 |
| 122 | +# Paranoid: neither group nor others have any perms: |
| 123 | +# umask 077 |
| 124 | + |
| 125 | +# Functions |
| 126 | +# |
| 127 | +# Some people use a different file for functions |
| 128 | +# if [ -f "${HOME}/.bash_functions" ]; then |
| 129 | +# source "${HOME}/.bash_functions" |
| 130 | +# fi |
| 131 | +# |
| 132 | +# Some example functions: |
| 133 | +# |
| 134 | +# a) function settitle |
| 135 | +# settitle () |
| 136 | +# { |
| 137 | +# echo -ne "\e]2;$@\a\e]1;$@\a"; |
| 138 | +# } |
| 139 | +# |
| 140 | +# b) function cd_func |
| 141 | +# This function defines a 'cd' replacement function capable of keeping, |
| 142 | +# displaying and accessing history of visited directories, up to 10 entries. |
| 143 | +# To use it, uncomment it, source this file and try 'cd --'. |
| 144 | +# acd_func 1.0.5, 10-nov-2004 |
| 145 | +# Petar Marinov, http:/geocities.com/h2428, this is public domain |
| 146 | +# cd_func () |
| 147 | +# { |
| 148 | +# local x2 the_new_dir adir index |
| 149 | +# local -i cnt |
| 150 | +# |
| 151 | +# if [[ $1 == "--" ]]; then |
| 152 | +# dirs -v |
| 153 | +# return 0 |
| 154 | +# fi |
| 155 | +# |
| 156 | +# the_new_dir=$1 |
| 157 | +# [[ -z $1 ]] && the_new_dir=$HOME |
| 158 | +# |
| 159 | +# if [[ ${the_new_dir:0:1} == '-' ]]; then |
| 160 | +# # |
| 161 | +# # Extract dir N from dirs |
| 162 | +# index=${the_new_dir:1} |
| 163 | +# [[ -z $index ]] && index=1 |
| 164 | +# adir=$(dirs +$index) |
| 165 | +# [[ -z $adir ]] && return 1 |
| 166 | +# the_new_dir=$adir |
| 167 | +# fi |
| 168 | +# |
| 169 | +# # |
| 170 | +# # '~' has to be substituted by ${HOME} |
| 171 | +# [[ ${the_new_dir:0:1} == '~' ]] && the_new_dir="${HOME}${the_new_dir:1}" |
| 172 | +# |
| 173 | +# # |
| 174 | +# # Now change to the new dir and add to the top of the stack |
| 175 | +# pushd "${the_new_dir}" > /dev/null |
| 176 | +# [[ $? -ne 0 ]] && return 1 |
| 177 | +# the_new_dir=$(pwd) |
| 178 | +# |
| 179 | +# # |
| 180 | +# # Trim down everything beyond 11th entry |
| 181 | +# popd -n +11 2>/dev/null 1>/dev/null |
| 182 | +# |
| 183 | +# # |
| 184 | +# # Remove any other occurence of this dir, skipping the top of the stack |
| 185 | +# for ((cnt=1; cnt <= 10; cnt++)); do |
| 186 | +# x2=$(dirs +${cnt} 2>/dev/null) |
| 187 | +# [[ $? -ne 0 ]] && return 0 |
| 188 | +# [[ ${x2:0:1} == '~' ]] && x2="${HOME}${x2:1}" |
| 189 | +# if [[ "${x2}" == "${the_new_dir}" ]]; then |
| 190 | +# popd -n +$cnt 2>/dev/null 1>/dev/null |
| 191 | +# cnt=cnt-1 |
| 192 | +# fi |
| 193 | +# done |
| 194 | +# |
| 195 | +# return 0 |
| 196 | +# } |
| 197 | +# |
| 198 | +# alias cd=cd_func |
0 commit comments