dot

packages and services management
Log | Files | Refs | README

commit 5cf7324f4846f06ea8d9a8933342bd812f17dbf9
parent bef9f3dd7900862f350cee4ef144f78f0089c6d7
Author: sshbio <jd@ssh.bio>
Date:   Wed, 10 Aug 2016 21:26:19 +0200

Added a few formatting options

Diffstat:
Abin/.irc.swp | 0
Mbin/irc | 21+++++++++++++++------
Mvim/.vimrc | 2+-
Avim/.vimrc.swp | 0
4 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/bin/.irc.swp b/bin/.irc.swp Binary files differ. diff --git a/bin/irc b/bin/irc @@ -29,7 +29,7 @@ commands_help=' NICK="${NICK-$USER}" FULLNAME='With netcat and a script as a client' IRC_DIR="$HOME/.cache/irc" -FORMAT='%14s %1s %s\n' +NICK_WIDTH=14 LINES="$(stty size | cut -d ' ' -f 2)" NL=' ' @@ -154,12 +154,12 @@ output() while read message do local prefix='' nick='' command='' params='' middle='' - local trailing='' channel='' + local trailing='' trail='' channel='' message="${message% }" case "$message" in PING* ) write "PONG${message#PING}" "$SERVER" ;; - *'VERSION'* ) printf 'VERSION!\n' 1>&2 ;; + *'VERSION'* ) printf 'VERSION!\n' 1>&2 ;; * ) if [ -z "${message##:*}" ] then @@ -199,15 +199,24 @@ output() ;; esac - printf "$FORMAT" "$nick" "$command" "$trailing" \ - >> "$IRC_DIR/$SERVER/$channel" + while [ "${trailing}" -gt 80 ] + do + trail="$(printf %s "$trail" \ + | cut -c 1-$((80 - $NICK_WIDTH)))" + + printf "%${NICK_WIDTH}s %1s %s\n" \ + "$nick" "$command" "${trail% *}" \ + >> "$IRC_DIR/$SERVER/$channel" + nick='' + done + ;; esac done } -# Algorythm +# Algorythm #------------------------------------------------------------------------------- # Prepare the irc log directory diff --git a/vim/.vimrc b/vim/.vimrc @@ -14,7 +14,7 @@ set nocompatible " Appearance colorscheme default set list listchars=tab:\|\ ,trail:_,extends:>,precedes:<,nbsp:_ -set fillchars=vert:\|,fold:_ +set fillchars=vert:\|,fold:- " Interface set wildmenu wildmode=longest:full,full " Wild diff --git a/vim/.vimrc.swp b/vim/.vimrc.swp Binary files differ.