dot

packages and services management
Log | Files | Refs | README

commit 2b37e7d124892d92385d84ad33a5ed23bd68a12c
parent 18dac73a3bd54e9ebc15c964e2b216c07f15152b
Author: josuah <mail@josuah.net>
Date:   Tue,  6 Sep 2016 11:24:25 +0200

Great and simple prompt

Diffstat:
Mbin/buffers | 1-
Mshell/.profile | 38+++++++++++++++++---------------------
Mvim/.vimrc | 2+-
3 files changed, 18 insertions(+), 23 deletions(-)

diff --git a/bin/buffers b/bin/buffers @@ -30,7 +30,6 @@ TAB=' ' case "$1" in r | run ) shift; for arg in $@; do cmd="$cmd $arg"; done; cmd="${cmd# }" - printf '%s\n' "$cmd" > ~/log # Get or create the cache file cache="${XDG_CACHE_HOME:-"$HOME/.cache"}" diff --git a/shell/.profile b/shell/.profile @@ -62,7 +62,7 @@ export PS2='| ' # ALIAS #------------------------------------------------------------------------------- -alias l='ls -F --color' +alias l='ls -F -w 80 --color' alias ll='l -lh' alias la='l -A' alias lla='l -Alh' @@ -83,34 +83,30 @@ alias c='cd "$(d)"' ps1() { - local code="$?" size="$(stty size)" color='1;31' - [ "$code" -eq 0 ] && code='' color='1' - local abduco="$(($(abduco 2>/dev/null | wc -l) - 1))" - local pwd="$PWD" date="$(date +'%H:%M')" - [ -z "${PWD##$HOME**}" ] && pwd="~${PWD#$HOME}" - local p='─────────────────────────────────────────────────────────────' - printf '\033[30;1m' - printf '%s\n' "$p$p$p$p$p$p" | cut -c -"$((${size#* } * 3))" - printf '\033[0m' + local code="$?" - # Fill with color - printf '\033[%sm\033[K' "$color" + printf '\n' - # PWD with $HOME replaced by ~ - printf ' %s' "$pwd" + # Line separator + local p='────────────────────────────────────────' + printf '\033[30;1m%s\033[0m\r' "$p$p" - # Last error code if non-zero - printf '\r\033[%sC%s' "$((${size#* } / 2 - 1))" "$code" + # Date + printf "\033[74C %s\r" "$(date +'%H:%M')" - # Date in right corner - printf '\r\033[%sC%s' "$((${size#* } - ${#date} - 1))" "$date" - printf '\033[0m' + # PWD with $HOME replaced by ~ + [ "${pwd##$HOME**}" ] && local pwd="$PWD" || local pwd="~${PWD#$HOME}" + printf '\033[1m%s\033[0m \r' "$pwd" + + # Error code + [ "$code" -eq 0 ] || printf '\033[38C\033[31;1m %s \033[0m' "$code" # Non printable: terminal status, bell - #printf '\a\033]0;%s\007' "$pwd" + printf '\a\033]0;%s\007' "$pwd" # Last line fo prompt - printf "\n%s$ " "${abduco#0}" + local abduco="$(($(abduco 2>/dev/null | wc -l) - 1))" + printf '\n\033[33m%s\033[0m$ ' "${abduco#0}" } h() diff --git a/vim/.vimrc b/vim/.vimrc @@ -16,7 +16,7 @@ set autoindent copyindent laststatus=1 ruler set showmatch list listchars=tab:>\ ,eol:$ hlsearch " Interface -set ruler number colorcolumn=80 +set ruler number numberwidth=8 colorcolumn=80 " FUNCTIONS