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 " }}}