-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbashrc.mini
51 lines (45 loc) · 1.26 KB
/
bashrc.mini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# curl pandanoir.net/bashrc -o ~/.bashrc.mini
# echo "source ~/.bashrc.mini >> ~/.bashrc"
command_exists() { type "$1" >/dev/null 2>&1; }
export PATH="$PATH:$HOME/.local/bin:$HOME/local/nvim/bin:/opt/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
alias mv='mv -i'
alias cp='cp -i'
alias ..='cd ../'
alias ...='cd ../../'
alias ekill="emacsclient -e '(kill-emacs)'"
alias erestart="ekill && estart"
alias copy='xsel --clipboard --input'
alias cl='clear'
alias cle='clear'
alias clea='clear'
alias tmux="tmux -f $XDG_CONFIG_HOME/tmux/tmux.conf"
alias g='git'
alias ga='git add'
alias gd='git diff'
alias gdc='git diff --cached'
alias gs='git status'
alias gp='git push'
alias gc='git commit'
if command_exists nvim; then
alias vi="\\vim"
alias vim="nvim"
fi
alias less=$VIM'/runtime/macros/less.sh'
if [ "$(uname)" = 'Darwin' ]; then
export LSCOLORS=egfxcxdxbxegedabagacad
alias ls='ls -G'
alias ll='ls -laG'
else
[ -f $HOME/.colorrc ] && eval `dircolors $HOME/.colorrc`
alias ls='ls --color=auto'
alias ll='ls -la --color=auto'
fi
function set_bash_prompt {
# 左プロンプト
PS1="\$ "
# 右プロンプト
PS1="${PS1}\[\e[s\033[${COLUMNS}C\033[15D\]"
PS1="${PS1}\W"
PS1="${PS1}\[\e[u\] "
}
PROMPT_COMMAND=set_bash_prompt