From ecd3c4050cccfe8d4b97276bc01cae86971f2574 Mon Sep 17 00:00:00 2001 From: Mehdi Sadeghi Date: Sun, 25 Apr 2021 19:04:31 +0200 Subject: Add ssh-agent config. --- .inputrc | 5 +++++ .zprofile | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 .inputrc diff --git a/.inputrc b/.inputrc new file mode 100644 index 0000000..c540473 --- /dev/null +++ b/.inputrc @@ -0,0 +1,5 @@ +# Key bindings, up/down arrow searches through history +"\e[A": history-search-backward +"\e[B": history-search-forward +"\eOA": history-search-backward +"\eOB": history-search-forward diff --git a/.zprofile b/.zprofile index 014cc80..cec8f61 100644 --- a/.zprofile +++ b/.zprofile @@ -2,7 +2,14 @@ # or when running with --shell flag. ## Read bash profile if present. -# emulate sh -c '. ~/.profile' +#emulate sh -c '. ~/.profile' # Clone oh-my-zsh if not present. [[ ! -e .oh-my-zsh ]] && git clone https://github.com/ohmyzsh/ohmyzsh .oh-my-zsh + +# Run and configure ssh-agent +if ! pgrep -u "$USER" ssh-agent > /dev/null; then + ssh-agent -t 1h > "$XDG_RUNTIME_DIR/ssh-agent.env" +fi +source "$XDG_RUNTIME_DIR/ssh-agent.env" >/dev/null + -- cgit v1.2.3