mirror of
https://github.com/itme-brain/nixos.git
synced 2026-03-24 08:39:42 -04:00
Formatted
This commit is contained in:
parent
419cc52ade
commit
902175dfa8
1 changed files with 25 additions and 18 deletions
|
|
@ -1,22 +1,30 @@
|
||||||
# Function to check if the current shell is an SSH session
|
##
|
||||||
is_ssh_session() {
|
## My Bash Configs
|
||||||
|
##
|
||||||
|
|
||||||
|
# Set EDITOR to nvim
|
||||||
|
export EDITOR=nvim
|
||||||
|
|
||||||
|
|
||||||
|
# Check if the current shell is an SSH session
|
||||||
|
is_ssh_session() {
|
||||||
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
|
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# PS1 Config
|
# PS1 Config
|
||||||
if [ -n "${IN_NIX_SHELL:+x}" ]; then
|
if [ -n "${IN_NIX_SHELL:+x}" ]; then
|
||||||
PS1="\[\033[01;34m\]\w\[\033[00m\]\n\[\033[01;32m\]nixShell > \[\033[00m\]"
|
PS1="\[\033[01;34m\]\w\[\033[00m\]\n\[\033[01;32m\]nixShell > \[\033[00m\]"
|
||||||
else
|
else
|
||||||
if ! is_ssh_session; then
|
if ! is_ssh_session; then
|
||||||
PS1="\n\[\033[01;34m\]\w\[\033[00m\]\n\[\033[01;32m\]> \[\033[00m\]"
|
PS1="\n\[\033[01;34m\]\w\[\033[00m\]\n\[\033[01;32m\]> \[\033[00m\]"
|
||||||
else
|
else
|
||||||
PS1="\n\[\033[01;34m\]\w\[\033[00m\]\n\[\033[01;32m\]\u@\h:\[\033[00m\] "
|
PS1="\n\[\033[01;34m\]\w\[\033[00m\]\n\[\033[01;32m\]\u@\h:\[\033[00m\] "
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Locate and source the bash-completion scripts
|
# Locate and source the bash-completion scripts
|
||||||
bash_completion_dir="$HOME/.nix-profiles/share/bash-completion/completions"
|
bash_completion_dir="$HOME/.nix-profiles/share/bash-completion/completions"
|
||||||
|
|
@ -26,7 +34,6 @@ if [ -d "$bash_completion_dir" ]; then
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set EDITOR to nvim
|
|
||||||
export EDITOR=nvim
|
|
||||||
|
|
||||||
|
# Alias List
|
||||||
alias ls='lsd'
|
alias ls='lsd'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue