From 6dd0179645326ff59cb2268bd5aab99f2c403443 Mon Sep 17 00:00:00 2001 From: gregstallings Date: Sat, 21 Sep 2013 16:24:33 +0200 Subject: [PATCH] .functions: Add `s` to open stuff in Sublime Text Closes #252. --- .aliases | 1 - .functions | 9 +++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.aliases b/.aliases index 336bc0b6d82..2539d30109b 100644 --- a/.aliases +++ b/.aliases @@ -15,7 +15,6 @@ alias g="git" alias h="history" alias j="jobs" alias v="vim" -alias s="subl ." alias o="open" alias oo="open ." diff --git a/.functions b/.functions index cf64dc6a38a..40ef656e8e7 100644 --- a/.functions +++ b/.functions @@ -261,3 +261,12 @@ function m() { mate "$@" fi } +# `s` with no arguments opens the current directory in Sublime, otherwise opens +# the given location +function s() { + if [ $# -eq 0 ]; then + subl . + else + subl "$@" + fi +}