add function for pandoc

master
Michael Ochmann 3 years ago
parent 7af9a293c8
commit bfe11a6017
  1. 28
      .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"

Loading…
Cancel
Save