From 3c02975ccc93d33ebf65827b76f0b2d20dbca3ea Mon Sep 17 00:00:00 2001 From: Andrew Coleman Date: Tue, 1 Dec 2020 14:19:14 -0500 Subject: [PATCH] add freebsd compatibility --- .bash_aliases | 9 --------- .bashrc | 21 +++++++++++++++++---- 2 files changed, 17 insertions(+), 13 deletions(-) delete mode 100644 .bash_aliases diff --git a/.bash_aliases b/.bash_aliases deleted file mode 100644 index bc27c67..0000000 --- a/.bash_aliases +++ /dev/null @@ -1,9 +0,0 @@ -alias dotfiles='git --git-dir=$HOME/dotfiles.git/ --work-tree=$HOME' -alias nokeyssh="ssh -o PubkeyAuthentication=no" -UNAME_S=`uname -s` -if [[ "$UNAME_S" == "Linux" || "$UNAME_S" == "CYGWIN_NT-10.0" ]] ; then - alias ls="ls --color=auto" -fi -if [[ "$UNAME_S" == "BSD" || "$UNAME_S" == "Darwin" ]] ; then - alias ls="ls -G" -fi diff --git a/.bashrc b/.bashrc index 010928d..70e4756 100644 --- a/.bashrc +++ b/.bashrc @@ -4,15 +4,20 @@ case $- in *) return;; esac +if [ -d "/usr$HOME" ] ; then export HOME=/usr$HOME ; cd ; fi +if [ -x /usr/bin/resizewin ] ; then /usr/bin/resizewin -z ; fi + test -f /etc/bashrc && . /etc/bashrc || true test -f /etc/bash.bashrc && . /etc/bash.bashrc || true test -f /etc/bash_completion && . /etc/bash_completion || true [[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh" -test -f $HOME/.bash_aliases && . $HOME/.bash_aliases || true test -f $HOME/.cargo/env && . $HOME/.cargo/env || true if [ -e $HOME/.nix-profile/etc/profile.d/nix.sh ]; then . $HOME/.nix-profile/etc/profile.d/nix.sh; fi -EDITOR=vim +alias dotfiles='git --git-dir=$HOME/dotfiles.git/ --work-tree=$HOME' + +EDITOR=vim; export EDITOR +PAGER=less; export PAGER PATH=$PATH:$HOME/.local/bin:$HOME/bin GIT_MERGE_AUTOEDIT=no @@ -55,9 +60,9 @@ PROMPT_COMMAND="history -a" shopt -s histappend function _update_ps1() { - PS1="$(powerline-go -error $?)" + PS1="$(powerline-rs --modules user,host,ssh,cwd,git,gitstage,root --shell bash $?)" } -if [[ $(which powerline-go 2>/dev/null) && "$TERM" != "linux" && "$TERM_PROGRAM" != "vscode" ]]; then +if [[ $(which powerline-rs 2>/dev/null) && "$TERM" != "linux" && "$TERM_PROGRAM" != "vscode" ]]; then PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND" else PS1='[\[\033[01;32m\]\u@\h\[\033[00m\] \[\033[01;34m\]\w$(__git_ps1 " (%s)")\[\033[00m\]]\$ ' @@ -67,5 +72,13 @@ for i in $HOME/bin/*.bash ; do . $i done +if which lsd > /dev/null 2>&1 ; then + if [ "$TERM" = "xterm-256color" ] ; then + alias ls="lsd" + else + alias ls="lsd --icon=never" + fi +fi + # Set up direnv eval "$(direnv hook bash)"