From 9b4e145d8e8e40a35f6d93de12fd00c2d5155560 Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Tue, 11 Apr 2023 09:46:08 -0500 Subject: [PATCH] updates to functions --- home/private_dot_config/zsh/functions/md2pdf | 19 +++++++++++++++++++ .../zsh/functions/nvim-plugin-update | 6 ++++++ 2 files changed, 25 insertions(+) create mode 100644 home/private_dot_config/zsh/functions/md2pdf create mode 100644 home/private_dot_config/zsh/functions/nvim-plugin-update diff --git a/home/private_dot_config/zsh/functions/md2pdf b/home/private_dot_config/zsh/functions/md2pdf new file mode 100644 index 0000000..b0e149c --- /dev/null +++ b/home/private_dot_config/zsh/functions/md2pdf @@ -0,0 +1,19 @@ +#!/usr/bin/env zsh +#? quick and dirty script to generate a pdf from markdown with pandoc/latex + +root=$1 +# get extension and root path: https://stackoverflow.com/a/40928328 +fname="${root#.}" +fname="${root%"$fname"}${fname%.*}" +ext="${root#"$fname"}" +echo "converting $root to pdf" + +if [[ $ext != ".md" ]]; then + echo "error! expected a markdown file" + echo "unrecognized extension: $ext" + return 1 +fi + +pandoc -V geometry:a5paper -V geometry:margin=.5in --dpi=300 -o ${fname}.pdf $root + + diff --git a/home/private_dot_config/zsh/functions/nvim-plugin-update b/home/private_dot_config/zsh/functions/nvim-plugin-update new file mode 100644 index 0000000..63ffe7f --- /dev/null +++ b/home/private_dot_config/zsh/functions/nvim-plugin-update @@ -0,0 +1,6 @@ +#!/usr/bin/env zsh + +##? update lazy.vim plugins/lock-file + +nvim --headless "+Lazy! update" +qa +chezmoi add $HOME/.config/nvim/lazy-lock.json