Skip to content

Instantly share code, notes, and snippets.

@kotashiratsuka
Last active May 1, 2021 21:28
Show Gist options
  • Save kotashiratsuka/9bc60430fb46d586a86806626f0793cc to your computer and use it in GitHub Desktop.
Save kotashiratsuka/9bc60430fb46d586a86806626f0793cc to your computer and use it in GitHub Desktop.
# vim: set ff=unix tabstop=4 shiftwidth=0 softtabstop=-1 noexpandtab fileencoding=utf-8 fileformat=unix filetype=sh :
# https://gist.github.com/kotashiratsuka/9bc60430fb46d586a86806626f0793cc
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
#ヒストリを追記にする(上書きしない)
shopt -s histappend
#実行するまえに必ず展開結果を確認できるようにする
shopt -s histverify
#端末の画面サイズを自動認識
shopt -s checkwinsize
#パターンマッチングで正規表現を利用可能にする
shopt -s extglob
#rmは履歴に入れない
HISTIGNORE=rm
#重複する履歴、スペースから始まるものは履歴に入れない
HISTCONTROL=ignoreboth
#ヒストリを無制限にする
HISTSIZE=
#コマンドプロンプト定義
PS1='[\u@\h \w]\$ '
PS2='>'
#Manとかに色付け
man() {
LESS_TERMCAP_md=$'\e[01;31m' \
LESS_TERMCAP_me=$'\e[0m' \
LESS_TERMCAP_us=$'\e[01;32m' \
LESS_TERMCAP_ue=$'\e[0m' \
LESS_TERMCAP_so=$'\e[45;93m' \
LESS_TERMCAP_se=$'\e[0m' \
command man "$@"
}
#vim,lessを標準にする
PAGER=$(which less)
EDITOR=$(which vim)
#LESSオプション定義
LESS="--follow-name MRiP ?n?f%f .?m(file %i of %m) ..?e(END) ?x- Next\: %x..%t"
#Alias
alias ll='ls -lFhG'
alias vi=$EDITOR
alias grep='grep --color=auto'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment