From bfe11a6017d7b45642e71a52d75897407b2db1af Mon Sep 17 00:00:00 2001 From: Michael Ochmann Date: Tue, 9 Aug 2022 11:36:14 +0200 Subject: [PATCH] add function for pandoc --- .bashrc | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/.bashrc b/.bashrc index fc72da2..d271e27 100644 --- a/.bashrc +++ b/.bashrc @@ -36,8 +36,10 @@ shopt -sq dirspell # Tab comp can fix dir name typos # PATH export PATH="/usr/local/opt/ncurses/bin:$PATH" -export PATH="/usr/local/bin/:/Users/mochmann/.cargo/bin:$PATH" -export PATH="/usr/local/Cellar:$PATH" +export PATH="/usr/local/bin:/Users/mochmann/.cargo/bin:$PATH" +#export PATH="/usr/local/Cellar:$PATH" +export PATH="/usr/local/sbin:$PATH" +export PATH="/usr/texbin:$PATH" export PATH="$PATH:/Users/mochmann/.dotnet/tools" export PATH="/usr/local/opt/mysql@5.7/bin:$PATH" export PATH="/usr/local/opt/libpq/bin:$PATH" @@ -106,8 +108,8 @@ __prompt_command() { else PS1+="${BGre}\u${Mag}" fi - PS1+="${Pur}@\h " - local PSCol="$BBlu" + PS1+="${Red}@\h " + local PSCol="$BPur" PS1+="${PSCol}\w${RCol}" # Current working dir if [ $EXIT != 0 ] @@ -145,7 +147,7 @@ __prompt_command() { local branch=$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/') if [ "$branch" != "" ] then - branch="${Whi}⎇${Cya} $branch" + branch="${Whi}⎇${Blu} $branch" fi PS1+=" ${branch}${Yel} ❯ ${RCol}" } @@ -248,6 +250,21 @@ whichport() { sudo lsof -i -P | grep LISTEN | grep ":$1" } +panpdf() { + folder=$(dirname $1) + file=$(basename $1) + + if [ ! -f "$folder/$file" ] + then + echo "no such file or directory : '$folder/$file'" + return + fi + + name=$(echo $file | cut -d '.' -f 1) + + pandoc -w pdf -o "$folder/$name.pdf" "$folder/$file" +} + # ENVIRONMENT NPM_PACKAGES="${HOME}/.npm-packages" @@ -300,3 +317,4 @@ if [ -z "$TMUX" ] && command -v tmux &> /dev/null && [ -n "$SSH_TTY" ] && [ -z " tmux attach-session -t $USER || tmux new-session -s $USER exit fi +. "$HOME/.cargo/env"