From feb280c794321f0a7ab11450e8f0392b5f471759 Mon Sep 17 00:00:00 2001 From: Wryn Wagner Date: Wed, 26 Jun 2019 11:37:29 -0600 Subject: [PATCH] Update to homework function and lisp formatting --- bashrc | 10 +++++++++- vimrc | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/bashrc b/bashrc index 433bcf6..b799f04 100644 --- a/bashrc +++ b/bashrc @@ -24,4 +24,12 @@ function notes() { NOTE="$NOTE_PATH/$1$NOTE_EXTENSION"; [ -f $NOTE ] && vim $NOT # --- Homework facilitated ------------------------------------ HW_TEMPLATE="$RC_DIR/latex/homework_template.tex" -function hw() { [ $# -ne 0 ] && cp $HW_TEMPLATE ./$1.tex || echo "Homework filename required"; } +function hw() { + [ $# -ne 0 ] \ + && NEW_HW="./$1.tex" \ + || echo "Homework filename required" \ + && return; + + [ ! -f $NEW_HW ] && cp $HW_TEMPLATE $NEW_HW; + vim $NEW_HW || echo "Something went wrong :c"; +} diff --git a/vimrc b/vimrc index 28e96b6..f81a00e 100644 --- a/vimrc +++ b/vimrc @@ -40,6 +40,7 @@ augroup filetype_specific_formatting autocmd FileType javascript setlocal tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab foldmethod=indent foldlevel=99 autocmd FileType vim setlocal tabstop=4 softtabstop=4 shiftwidth=4 noexpandtab foldmethod=marker foldlevel=1 autocmd FileType sh setlocal tabstop=4 softtabstop=4 shiftwidth=4 noexpandtab foldmethod=indent foldlevel=99 + autocmd FileType lisp setlocal tabstop=2 softtabstop=2 shiftwidth=2 expandtab foldmethod=manual foldlevel=99 augroup END " }}}