From abfcee1473ca29a9f0a527d9f11dd31132782739 Mon Sep 17 00:00:00 2001 From: Callum Renwick Date: Tue, 26 Jul 2022 18:53:44 +0100 Subject: [PATCH] Add mkshrc --- mkshrc | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 mkshrc diff --git a/mkshrc b/mkshrc new file mode 100644 index 0000000..accd59b --- /dev/null +++ b/mkshrc @@ -0,0 +1,29 @@ +# Aliases +alias ls="ls --color=auto" +# Show all the things when using gcc +alias gcc="gcc -Wall" + +# Keybinds +# ^L clears screen (by default only ^[^L) +bind ^L=clear-screen + +# Prompt +# Prompt functions +get_username() { + print $(id -un) +} + +get_hostname() { + print $(hostname) +} + +get_cwd() { + # substitute $HOME string in $PWD with ~ + # (so for example /home/cren/config becomes ~/config) + print ${PWD/$HOME/~} +} + +# Prompt colour strings. To save typing them out every time I want to use them! +# TODO + +PS1='$(get_username)@$(get_hostname) $(get_cwd) % '