From 5b90092555dc13c7577f1cad93857a859be02711 Mon Sep 17 00:00:00 2001 From: CkEsc Date: Sun, 11 Jan 2015 17:52:08 +0300 Subject: Sublime Text plugin: added sst alias for sudo run sublime --- plugins/sublime/sublime.plugin.zsh | 2 ++ 1 file changed, 2 insertions(+) (limited to 'plugins/sublime') diff --git a/plugins/sublime/sublime.plugin.zsh b/plugins/sublime/sublime.plugin.zsh index 5acc75cc7..38a7596fd 100644 --- a/plugins/sublime/sublime.plugin.zsh +++ b/plugins/sublime/sublime.plugin.zsh @@ -12,6 +12,8 @@ if [[ $('uname') == 'Linux' ]]; then for _sublime_path in $_sublime_linux_paths; do if [[ -a $_sublime_path ]]; then st_run() { $_sublime_path $@ >/dev/null 2>&1 &| } + st_run_sudo() {sudo $_sublime_path $@ >/dev/null 2>&1} + alias sst=st_run_sudo alias st=st_run break fi -- cgit v1.2.3-70-g09d2 From 2e1b964c002aa193fef733d52da252e2e11ca2ef Mon Sep 17 00:00:00 2001 From: wyldphyre Date: Tue, 24 Feb 2015 20:58:50 +0800 Subject: Add README.md file --- plugins/sublime/README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 plugins/sublime/README.md (limited to 'plugins/sublime') diff --git a/plugins/sublime/README.md b/plugins/sublime/README.md new file mode 100644 index 000000000..75b2d9dc1 --- /dev/null +++ b/plugins/sublime/README.md @@ -0,0 +1,15 @@ +## sublime + +Plugin for Sublime Text, a cross platform text and code editor, available for Linux, Mac OS X, and Windows. + +### Requirements + + * [Sublime Text](http://www.sublimetext.com/) + +### Usage + + * If `st` command is called without an argument, launch Sublime Text + + * If `st` is passed a directory, `cd` to it and open it in Sublime Text + + * If `st` is passed a file, open it in Sublime Text \ No newline at end of file -- cgit v1.2.3-70-g09d2 From 01ec37e5f87281e91b174d068a43d0ce6e43944e Mon Sep 17 00:00:00 2001 From: wyldphyre Date: Tue, 24 Feb 2015 21:05:58 +0800 Subject: Added missing 'stt' command alias --- plugins/sublime/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'plugins/sublime') diff --git a/plugins/sublime/README.md b/plugins/sublime/README.md index 75b2d9dc1..e38cf66dc 100644 --- a/plugins/sublime/README.md +++ b/plugins/sublime/README.md @@ -12,4 +12,6 @@ Plugin for Sublime Text, a cross platform text and code editor, available for Li * If `st` is passed a directory, `cd` to it and open it in Sublime Text - * If `st` is passed a file, open it in Sublime Text \ No newline at end of file + * If `st` is passed a file, open it in Sublime Text + + * if `stt` command is called, it is equivalent to `st .`, opening the current folder in Sublime Text \ No newline at end of file -- cgit v1.2.3-70-g09d2 From 0c8cb11d44d4ed4f458907cc19a0896416590587 Mon Sep 17 00:00:00 2001 From: GunfighterJ Date: Mon, 25 May 2015 16:02:26 -0500 Subject: Add sublime text 3 paths to check list --- plugins/sublime/sublime.plugin.zsh | 2 ++ 1 file changed, 2 insertions(+) (limited to 'plugins/sublime') diff --git a/plugins/sublime/sublime.plugin.zsh b/plugins/sublime/sublime.plugin.zsh index 38a7596fd..ef76826cf 100644 --- a/plugins/sublime/sublime.plugin.zsh +++ b/plugins/sublime/sublime.plugin.zsh @@ -8,6 +8,8 @@ if [[ $('uname') == 'Linux' ]]; then "/usr/bin/sublime_text" "/usr/local/bin/sublime_text" "/usr/bin/subl" + "/opt/sublime_text_3/sublime_text" + "/usr/bin/subl3" ) for _sublime_path in $_sublime_linux_paths; do if [[ -a $_sublime_path ]]; then -- cgit v1.2.3-70-g09d2 From e8ac8b9b5f82369635d719408f8b4adc5d97bcf9 Mon Sep 17 00:00:00 2001 From: Jonathan Roemer Date: Fri, 1 May 2015 17:44:50 -0400 Subject: Added support for detecting Sublime Text 3 on Arch Linux --- plugins/sublime/sublime.plugin.zsh | 1 + 1 file changed, 1 insertion(+) (limited to 'plugins/sublime') diff --git a/plugins/sublime/sublime.plugin.zsh b/plugins/sublime/sublime.plugin.zsh index 38a7596fd..4d9979960 100644 --- a/plugins/sublime/sublime.plugin.zsh +++ b/plugins/sublime/sublime.plugin.zsh @@ -5,6 +5,7 @@ if [[ $('uname') == 'Linux' ]]; then _sublime_linux_paths=( "$HOME/bin/sublime_text" "/opt/sublime_text/sublime_text" + "/opt/sublime_text_3/sublime_text" "/usr/bin/sublime_text" "/usr/local/bin/sublime_text" "/usr/bin/subl" -- cgit v1.2.3-70-g09d2 From 4c409b0de918e62f9354cbc604c6ae65da611caf Mon Sep 17 00:00:00 2001 From: Paul Melnikow Date: Mon, 29 Dec 2014 14:48:24 -0500 Subject: sublime: Make subl a function so it can be called from functions in other modules Without this change, whether a function can invoke 'subl' depends on the order in which modules are loaded. With this change, the order doesn't matter. zsh resolves aliases at parse time not run time, which means if you invoke an alias from a function, the alias must be defined before the function. See http://stackoverflow.com/a/25532276/893113 which refers to an explanation of this limitation. For code which may be used non-interactively, the recommend workaround is to use functions instead of aliases. --- plugins/sublime/sublime.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/sublime') diff --git a/plugins/sublime/sublime.plugin.zsh b/plugins/sublime/sublime.plugin.zsh index 4d9979960..3e338e4d3 100644 --- a/plugins/sublime/sublime.plugin.zsh +++ b/plugins/sublime/sublime.plugin.zsh @@ -34,7 +34,7 @@ elif [[ "$OSTYPE" = darwin* ]]; then for _sublime_path in $_sublime_darwin_paths; do if [[ -a $_sublime_path ]]; then - alias subl="'$_sublime_path'" + subl () { "$_sublime_path" $* } alias st=subl break fi -- cgit v1.2.3-70-g09d2 From c28b226af2dc0843ab0f05ea4abc54c4bdfd7012 Mon Sep 17 00:00:00 2001 From: CkEsc Date: Tue, 3 Mar 2015 23:03:44 +0300 Subject: Fix README.md for sst command --- plugins/sublime/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'plugins/sublime') diff --git a/plugins/sublime/README.md b/plugins/sublime/README.md index e38cf66dc..e1e666f05 100644 --- a/plugins/sublime/README.md +++ b/plugins/sublime/README.md @@ -14,4 +14,6 @@ Plugin for Sublime Text, a cross platform text and code editor, available for Li * If `st` is passed a file, open it in Sublime Text - * if `stt` command is called, it is equivalent to `st .`, opening the current folder in Sublime Text \ No newline at end of file + * If `stt` command is called, it is equivalent to `st .`, opening the current folder in Sublime Text + + * If `sst` command is called, it is like `sudo st`, opening the file or folder in Sublime Text. Useful for editing system protected files. \ No newline at end of file -- cgit v1.2.3-70-g09d2