Last active
February 22, 2019 15:56
-
-
Save borisschapira/b41ea13e6922d0b4792df934372ff892 to your computer and use it in GitHub Desktop.
Revisions
-
borisschapira revised this gist
Feb 22, 2019 . 1 changed file with 9 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,11 +1,16 @@ # A function to replace the `code` command # # With args: does what's intended. # ``` # > code ~/.bash_history # ``` # # With no args, opens the first workspace it founds # in the current folder, or a new workspace based # on the current folder if none exists. # ``` # > code # ``` function code-ws() { if [ ! $# -eq 0 ]; then -
borisschapira revised this gist
Feb 22, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,7 +9,7 @@ function code-ws() { if [ ! $# -eq 0 ]; then code "$@" else files=$(find . -maxdepth 1 -type f -name "*.code-workspace" | wc -l) if [ $files -eq 0 ]; then -
borisschapira revised this gist
Feb 22, 2019 . 1 changed file with 10 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,12 @@ # A function to replace the `code` command # # Open a file # > code code ~/.bash_history # # Open the first workspace it founds, or a new # workspace on the current folder # > code function code-ws() { if [ ! $# -eq 0 ]; then code $1; @@ -6,7 +15,7 @@ function code-ws() { if [ $files -eq 0 ]; then code -n . else code *.code-workspace fi fi } -
borisschapira created this gist
Feb 22, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ function code-ws() { if [ ! $# -eq 0 ]; then code $1; else files=$(find . -maxdepth 1 -type f -name "*.code-workspace" | wc -l) if [ $files -eq 0 ]; then code -n . else code *.code-workspace fi fi } alias code=code-ws