Skip to content

Instantly share code, notes, and snippets.

@kessler
Last active September 14, 2017 21:42
Show Gist options
  • Save kessler/fc194f8581a6f4ac3f16 to your computer and use it in GitHub Desktop.
Save kessler/fc194f8581a6f4ac3f16 to your computer and use it in GitHub Desktop.
launch sublime text from terminal with current directory or with argument
#!/bin/sh
sub="/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"
target=$1
if [[ -z $target ]]
then
target=$(pwd)
fi
"$sub" "$target"
@kessler
Copy link
Author

kessler commented Jan 26, 2016

SET target=%1

"c:\program files\sublime text 3\subl.exe" %target%

@Mosquid
Copy link

Mosquid commented Feb 10, 2016

SET target=%1

if '%target%' equ '' (
set target=%cd%
)

"c:\program files\sublime text 2\sublime_text.exe" %target%

@kessler
Copy link
Author

kessler commented Sep 14, 2017

@echo off
SET target=%1

if '%target%' equ '' (
set target=%cd%
)

start "" /b "C:\Program Files\Sublime Text 3\sublime_text.exe" %target%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment