From 5705cb59c8c06f203135c7467422e185addb8dfe Mon Sep 17 00:00:00 2001 From: David Tomaschik Date: Sat, 7 Apr 2018 14:46:27 +0200 Subject: [PATCH] Use $EDITOR for editing. --- dotfiles/zprezto_custom/jekyll/init.zsh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dotfiles/zprezto_custom/jekyll/init.zsh b/dotfiles/zprezto_custom/jekyll/init.zsh index a3c68d2..08b2c42 100644 --- a/dotfiles/zprezto_custom/jekyll/init.zsh +++ b/dotfiles/zprezto_custom/jekyll/init.zsh @@ -60,6 +60,7 @@ function jekyll { local DATE local NEWNAME local JEKYLL_DIR + local EDITOR=${EDITOR:-vim} JEKYLL_DIR=`_jekyll_locate_dir` @@ -93,7 +94,7 @@ function jekyll { mkdir -p "${JEKYLL_DIR}/_drafts" FILENAME="${JEKYLL_DIR}/_drafts/${SLUG}.md" printf -- "${JTEMPLATE}" "${TITLE}" > "${FILENAME}" - vim "${FILENAME}" '+$' '+startinsert' + ${EDITOR} "${FILENAME}" '+$' '+startinsert' ;; post) if [ -z "${SLUG}" ] ; then @@ -103,7 +104,7 @@ function jekyll { FILENAME="${JEKYLL_DIR}/_posts/${DATE}-${SLUG}.md" printf -- "${JTEMPLATE}" "${TITLE}" > "${FILENAME}" _jekyll_set_date "${FILENAME}" "${DATE}" - vim "${FILENAME}" '+$' '+startinsert' + ${EDITOR} "${FILENAME}" '+$' '+startinsert' ;; publish) if [ -z "${SLUG}" ] ; then @@ -131,7 +132,7 @@ function jekyll { if [ $? -ne 0 ] ; then return fi - vim "${FILENAME}" + ${EDITOR} "${FILENAME}" ;; *) command jekyll "$@"