0
Help us understand the problem. What are the problem?

posted at

updated at

bash設定ファイル

bash_profile
# default:cyan / root:red
if [ $UID -eq 0 ]; then
    PS1="\[\033[31m\]\u@\h\[\033[00m\]:\[\033[01m\]\w\[\033[00m\]\\$ "
else
    PS1="\[\033[36m\]\u@\h\[\033[00m\]:\[\033[01m\]\w\[\033[00m\]\\$ "
fi

# "-F":ディレクトリに"/"を表示 / "-G"でディレクトリを色表示
alias ls='ls -FG'
alias ll='ls -alFG'

#ブランチ名表示
source /usr/local/etc/bash_completion.d/git-prompt.sh
source /usr/local/etc/bash_completion.d/git-completion.bash
GIT_PS1_SHOWDIRTYSTATE=true
#export PS1='\[\033[00m\]\u@\h\[\033[00m\]:\[\033[00m\]\w\[\033[33m\]$(__git_ps1)\[\033[00m\]\n\$ '
#export PS1='\[\033[00m\]\u@\h\[\033[00m\]:\[\033[00m\]\w\[\033[33m\]$(__git_ps1)\[\033[00m\] \$ '
export PS1='\[\033[00m\]\u@\A\[\033[00m\]:\[\033[00m\]\w\[\033[33m\]$(__git_ps1)\[\033[00m\] \$ '

# function parse_git_branch {
#     git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ [\1]/'
# }
# function promps {
#     # 色は気分で変えたいかもしれないので変す宣言しておく
#     local  BLUE="\[\e[1;34m\]"
#     local  RED="\[\e[1;31m\]"
#     local  GREEN="\[\e[1;32m\]"
#     local  WHITE="\[\e[00m\]"
#     local  GRAY="\[\e[1;37m\]"
#
#     case $TERM in
#         xterm*) TITLEBAR='\[\e]0;\W\007\]';;
#         *)      TITLEBAR="";;
#     esac
#     local BASE="\u@\h"
#     PS1="${TITLEBAR}${GREEN}${BASE}${WHITE}:${BLUE}\W${GREEN}\$(parse_git_branch)${BLUE}\$${Blue} "
# }
# promps

#git補完機能
source ~/.git-completion.bash

if [ -f ~/.bashrc ]; then
  . ~/.bashrc
fi

bashrc
# 出力の後に改行を入れる
function add_line {
  if [[ -z "${PS1_NEWLINE_LOGIN}" ]]; then
    PS1_NEWLINE_LOGIN=true
  else
    printf '\n'
  fi
}
PROMPT_COMMAND='add_line'


# "-F":ディレクトリに"/"を表示 / "-G"でディレクトリを色表示
alias ls='ls -FG'
alias ll='ls -alFG'
alias rm='rm -i'
alias grep='grep --color=auto'

cd ()
{
    builtin cd "$@" && ls
}

#docker
alias d='docker'
alias dp='docker ps'
alias di='docker images'
alias dc='docker-compose'
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Sign upLogin
0
Help us understand the problem. What are the problem?