Skip to content

Instantly share code, notes, and snippets.

@Fania
Last active August 17, 2022 19:20
Show Gist options
  • Save Fania/ced908cc64de13d7fdc64d096ebe2d68 to your computer and use it in GitHub Desktop.
Save Fania/ced908cc64de13d7fdc64d096ebe2d68 to your computer and use it in GitHub Desktop.
Custom bash colours
# on server (for ssh connection colours)
# replace all lines of PS1 = '...' with the following
# replace `/h` host with 'servername'
HISTCONTROL=ignoreboth:erasedups
shopt -s histappend
alias ls='ls -hal --color'
# USER BASHRC
PS1='${debian_chroot:+($debian_chroot)}\[\e[36;49m\]\u\[\e[37;49m\]@\[\e[32;49m\]SERVERNAME\[\e[37;49m\]: \w\[\e[35;49m\]\n\$ \[\e[37;49m\]'
# ROOT BASHRC
PS1='${debian_chroot:+($debian_chroot)}\[\e[35;49m\]\u\[\e[36;49m\]@\[\e[37;49m\]\h\[\e[36;49m\]:\[\e[32;49m\]\w\[\e[37;49m\]\$ '
# reload bash with `source ~/.bashrc`
# \e[37;49m white
# \e[36;49m cyan
# \e[32;49m green
# \e[35;49m pink
# https://www.nano-editor.org/dist/latest/nano.html
set mouse
set softwrap
set tabsize 4
set autoindent
set linenumbers
set tabstospaces
set constantshow
# %n = username
# %m = macbook model name
# %1 = current working directory
# %# = will show # if root or % if not
# %W = date mm/dd/yy
# %D = yy-mm-dd
# foreground text colours: black, white, yellow, green, red, blue, cyan, and magenta
# use then as such: %F{cyan}%n%f
# or choose any of the 256 8-bit colours as such: %F{51}%n%f
# Bold text = %B%n%b
# Highlight (give background colour) = %S%F{cyan}%n%f%s
# Underline = %U%n%u
# Hide last login details: touch .hushlogin
NEWLINE=$'\n'
PROMPT="${NEWLINE}_________________________${NEWLINE}%F{cyan}%n%f@%F{green}%~%f${NEWLINE}%F{magenta}> %f"
alias ls='ls -hal --color'
# https://www.makeuseof.com/customize-zsh-prompt-macos-terminal/
# on local machine
# don't keep dups in history
export HISTCONTROL=ignoreboth:erasedups
shopt -s histappend
alias ls='ls -hal --color'
PS1='\n_________________________'
PS1="$PS1"'\n' # new line
PS1="$PS1"'\[\e[36;49m\]' # change to cyan
PS1="$PS1"'\u ' # user
PS1="$PS1"'\[\e[37;49m\]' # change to white
PS1="$PS1"'\w' # current working directory
if test -z "$WINELOADERNOEXEC"
then
GIT_EXEC_PATH="$(git --exec-path 2>/dev/null)"
COMPLETION_PATH="${GIT_EXEC_PATH%/libexec/git-core}"
COMPLETION_PATH="${COMPLETION_PATH%/lib/git-core}"
COMPLETION_PATH="$COMPLETION_PATH/share/git/completion"
if test -f "$COMPLETION_PATH/git-prompt.sh"
then
. "$COMPLETION_PATH/git-completion.bash"
. "$COMPLETION_PATH/git-prompt.sh"
PS1="$PS1"'\[\e[32;49m\]' # change color to green
PS1="$PS1"'`__git_ps1`' # bash function
fi
fi
PS1="$PS1"'\n' # new line
PS1="$PS1"'\[\e[35;49m\]' # change to pink
PS1="$PS1"'> ' # >
PS1="$PS1"'\[\e[37;49m\]' # change to white
MSYS2_PS1="$PS1" # for detection by MSYS2 SDK's bash.basrc
// This file was initially generated by Windows Terminal 0.11.1191.0
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{00000000-0000-0000-ba54-000000000002}",
"copyOnSelect": false,
"copyFormatting": false,
"confirmCloseAllTabs": false,
"profiles":
{
"defaults":
{
// Put settings here that you want to apply to all profiles.
"useAcrylic": true,
"acrylicOpacity": 0.8,
"fontFace": "Input Mono",
"fontSize": 12,
"colorScheme": "Fania",
"startingDirectory": "...",
"hidden": false
},
"list":
[
{
"guid": "{00000000-0000-0000-ba54-000000000002}",
"name": "Bash",
"tabTitle": "Bash",
"suppressApplicationTitle": true,
"commandline": "\"%PROGRAMFILES%\\git\\usr\\bin\\bash.exe\" -i -l",
"icon" : "..."
},
{
"guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
"name": "PowerShell",
"source": "Windows.Terminal.PowershellCore"
},
{
"guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
"name": "Command Prompt",
"commandline": "cmd.exe"
},
{
"guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
"name": "Azure Cloud Shell",
"source": "Windows.Terminal.Azure",
"hidden": true
},
{
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"name": "Old PowerShell",
"commandline": "powershell.exe",
"hidden": true
}
]
},
"schemes" :
[
{
"name" : "Fania",
"background": "#22212b",
"selectionBackground": "#1ad1f1",
"black" : "#282C34",
"blue" : "#61AFEF",
"brightBlack" : "#5A6374",
"brightBlue" : "#61AFEF",
"brightCyan" : "#56B6C2",
"brightGreen" : "#98C379",
"brightPurple" : "#C678DD",
"brightRed" : "#E06C75",
"brightWhite" : "#FFFFFF",
"brightYellow" : "#e5d57b",
"cyan" : "#61AFEF",
"foreground" : "#DCDFE4",
"green" : "#98C379",
"purple" : "#C678DD",
"red" : "#E06C75",
"white" : "#DCDFE4",
"yellow" : "#E5C07B"
}
],
"keybindings":
[
// Copy and paste are bound to Ctrl+Shift+C and Ctrl+Shift+V in your defaults.json.
// These two lines additionally bind them to Ctrl+C and Ctrl+V.
{ "command": {"action": "copy", "singleLine": false }, "keys": "ctrl+c" },
{ "command": "paste", "keys": "ctrl+v" },
{ "command": "find", "keys": "ctrl+shift+f" },
{ "command": { "action": "splitPane", "split": "auto", "splitMode": "duplicate" }, "keys": "alt+shift+d" }
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment