diff options
| -rw-r--r-- | .bashrc | 26 | ||||
| -rw-r--r-- | .env | 9 | ||||
| -rw-r--r-- | .inputrc | 8 | ||||
| -rwxr-xr-x | .local/bin/prompt | 8 | ||||
| -rw-r--r-- | .profile | 23 | ||||
| -rw-r--r-- | .zshrc | 2 |
6 files changed, 72 insertions, 4 deletions
@@ -0,0 +1,26 @@ +PS1="[\u@\h:\W]> " + +if [ -z "${SSH_AGENT_PID}" ]; then + if ! [ -e /tmp/ssh-agent-$USER ] + then + ssh-agent 2>/dev/null >/tmp/ssh-agent-$USER + fi + . /tmp/ssh-agent-$USER >/dev/null +fi + +# Aliases +# `githome` alias is a trick to avoid having git prompt when working +# in different directories of my home folder. I simply rename `.git` +# folder to `.githome` and use the following alias to interact with it. +# On new systems I only need to do the following: +# cd ~ +# git init +# git remote add origin git@git.sr.ht:~mehdix/dotfiles +# or +# git remote add origin https://git.sr.ht/~mehdix/dotfiles +# git fetch +# git checkout -f master +# mv .git .githome +alias githome='git --git-dir ~/.githome --work-tree ~' + +[ -f ~/.fzf.bash ] && source ~/.fzf.bash
\ No newline at end of file @@ -0,0 +1,9 @@ +PS1='$(prompt)' + +if [ -z "${SSH_AGENT_PID}" ]; then + if ! [ -e /tmp/ssh-agent-$USER ] + then + ssh-agent 2>/dev/null >/tmp/ssh-agent-$USER + fi + . /tmp/ssh-agent-$USER >/dev/null +fi
\ No newline at end of file @@ -1,5 +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 +"\e[A": history-subscring-search-backward +"\e[B": history-subscring-search-forward +"\eOA": history-subscring-search-backward +"\eOB": history-subscring-search-forward diff --git a/.local/bin/prompt b/.local/bin/prompt new file mode 100755 index 0000000..90e3a17 --- /dev/null +++ b/.local/bin/prompt @@ -0,0 +1,8 @@ +#!/bin/sh +BRANCH=$(git branch --show-current 2>/dev/null) +BRANCH=$(test -d .git && test -n $BRANCH && echo "($BRANCH)") +PROMPT="[$(hostname):$(basename "$PWD")$BRANCH]" +case $(id -u) in +0) echo "$PROMPT# " ;; +*) echo "$PROMPT$ " ;; +esac diff --git a/.profile b/.profile new file mode 100644 index 0000000..25b457c --- /dev/null +++ b/.profile @@ -0,0 +1,23 @@ +export ENV=~/.env +export LANG=en_US.UTF-8 +export LC_TIME=de_DE.UTF-8 +export EDITOR=vim +export TERM=xterm +export HISTSIZE=65535 +# autojump needs this +export PROMPT_COMMAND="history -a" + +export PATH=$HOME/.local/bin:$PATH +export PATH=$HOME/.local/bin/`hostname`:$PATH +export PATH=$HOME/.local/bin/`uname -m`:$PATH +export PATH=$HOME/.cargo/bin:$PATH +export GOPATH="$HOME/.local/share/go" +export PATH=$GOPATH/bin:$PATH +export MAKEFLAGS=-j`lscpu | grep '^CPU(s):' | awk -F' ' '{ print $2 }'` +export CFLAGS="-O2 -pipe -march=native" +export CXXFLAGS="${CFLAGS}" +# Sway compatiblity https://github.com/swaywm/sway/issues/595 +export _JAVA_AWT_WM_NONREPARENTING=1 + +[ $SHELL = "/bin/bash" ] && [ -f ~/.bashrc ] && . ~/.bashrc +[ -e .config/$(hostname).profile ] && . .config/$(hostname).profile
\ No newline at end of file @@ -65,3 +65,5 @@ fi # mv .git .githome alias githome='git --git-dir ~/.githome --work-tree ~' + +[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh |
