Add fmt function, add ssh-agent
This commit is contained in:
parent
7bdeaae78c
commit
d61996c98c
1 changed files with 17 additions and 0 deletions
17
bash/.bashrc
17
bash/.bashrc
|
@ -20,6 +20,18 @@ t() {
|
|||
esac
|
||||
}
|
||||
|
||||
fmt() {
|
||||
[ -f .clang-format ] && {
|
||||
find src -type f -name '*.[ch]' -print | xargs -d '\n' clang-format -i
|
||||
return
|
||||
}
|
||||
|
||||
[ -f Cargo.toml ] && {
|
||||
cargo fmt
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
__prompt() {
|
||||
case $? in
|
||||
0) PS1='\[\e[34m\]' ;;
|
||||
|
@ -40,3 +52,8 @@ PROMPT_COMMAND="__prompt;$PROMPT_COMMAND"
|
|||
. "$HOME/.cargo/env"
|
||||
|
||||
eval "$(direnv hook bash)"
|
||||
|
||||
pgrep -u "$USER" -x ssh-agent >/dev/null || ssh-agent -t 5m >"$XDG_RUNTIME_DIR/ssh-agent.env"
|
||||
[[ "$SSH_AUTH_SOCK" ]] || . "$XDG_RUNTIME_DIR/ssh-agent.env" >/dev/null
|
||||
|
||||
head -n 10 ~/todo/todo
|
||||
|
|
Loading…
Reference in a new issue