-
-
Save mcoduti/0cd2794ca9bbc19074ca to your computer and use it in GitHub Desktop.
Revisions
-
rbetina revised this gist
Aug 3, 2015 . 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 @@ -32,7 +32,7 @@ You should now have Package Manager installed. Let's test it out by installing a Now, a second, slightly different looking search box should pop open. This is a list of all the plugins available. Start typing "soda", and you should see a result "Theme - Soda". Select it and hit return, or click it. The theme will then be installed (we'll turn it on in just a moment). There are a few other packages that will be helpful to us. For each one, you first need to do `Tools` > `Command Palette`, then start typing "install", select "Package Control: Install Package", and then search for it in the second box that appears. Here are the packages for you to install: - SublimeERB - ERB Snippets -
rbetina revised this gist
Aug 3, 2015 . 1 changed file with 0 additions and 2 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 @@ -34,7 +34,6 @@ Now, a second, slightly different looking search box should pop open. This is a There's two other packages that will be helpful to us. For each one, you first need to do `Tools` > `Command Palette`, then start typing "install", select "Package Control: Install Package", and then search for it in the second box that appears. Here are the packages for you to install: - SublimeERB - ERB Snippets - BracketHighlighter @@ -69,7 +68,6 @@ Highlight the entire contents of this file and delete them; then, paste in the f "show_full_path": true, "soda_folder_icons": false, "tab_size": 2, "translate_tabs_to_spaces": true, "trim_trailing_white_space_on_save": true, "word_wrap": true -
rbetina revised this gist
Apr 14, 2015 . 1 changed file with 1 addition and 0 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 @@ -34,6 +34,7 @@ Now, a second, slightly different looking search box should pop open. This is a There's two other packages that will be helpful to us. For each one, you first need to do `Tools` > `Command Palette`, then start typing "install", select "Package Control: Install Package", and then search for it in the second box that appears. Here are the packages for you to install: - Theme - Soda - SublimeERB - ERB Snippets - BracketHighlighter -
rbetina revised this gist
Apr 14, 2015 . 1 changed file with 1 addition and 0 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 @@ -36,6 +36,7 @@ There's two other packages that will be helpful to us. For each one, you first n - SublimeERB - ERB Snippets - BracketHighlighter ## Configure Preferences -
rbetina revised this gist
Apr 7, 2015 . 1 changed file with 4 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 @@ -90,9 +90,12 @@ In your Preferences menu, find "Key Bindings - User". A file will open up -- del [ { "keys": ["ctrl+shift+."], "command": "erb" }, { "keys": ["ctrl+shift+r"], "command": "reindent" , "args": { "single_line": false } }, { "keys": ["ctrl+shift+["], "command": "select_lines", "args": { "forward": false } }, { "keys": ["ctrl+shift+]"], "command": "select_lines", "args": { "forward": true } } ] Don't forget to save the file afterwards. Re-indent your code often; you no longer have any excuse to not have neatly indented code at all times! ## Mac Only: Add The `subl` Command Line Shortcut -
rbetina revised this gist
Apr 6, 2015 . 1 changed file with 2 additions and 2 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 @@ -22,9 +22,9 @@ Sublime is paid software, but you can evaluate it for free forever -- it will ju Tens and hundreds of thousands of developers use Sublime, and many of them write plugins to make it more useful to them in their daily work. Package Manager is a tool that will make it easy for us to add 3rd party plugins to our installation. In the `View` menu, select `Show Console`. The console, a blank text field, will appear at the very bottom of your Sublime window. Go to the following page and copy the code block provided, then paste it into the console: https://packagecontrol.io/installation#st3 Wait a second, and then **quit** Sublime and relaunch it (actually `Quit` the app from the `Sublime` (Mac) or `File` (Windows) menu -- don't just close the open windows). -
rbetina revised this gist
Mar 31, 2015 . 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 @@ -24,7 +24,7 @@ Tens and hundreds of thousands of developers use Sublime, and many of them write In the `View` menu, select `Show Console`. A blank text field will appear at the very bottom of your Sublime window. Paste the following text in and hit Return (it's a long line of code, keep dragging to the right until you get it all): import urllib.request,os,hashlib; h = 'eb2297e1a458f27d836c04bb0cbaf282' + 'd0e7a3098092775ccb37ca9d6b2e4b7d'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by) Wait a second, and then **quit** Sublime and relaunch it (actually `Quit` the app from the `Sublime` (Mac) or `File` (Windows) menu -- don't just close the open windows). -
rbetina revised this gist
Mar 31, 2015 . 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 @@ -22,7 +22,7 @@ Sublime is paid software, but you can evaluate it for free forever -- it will ju Tens and hundreds of thousands of developers use Sublime, and many of them write plugins to make it more useful to them in their daily work. Package Manager is a tool that will make it easy for us to add 3rd party plugins to our installation. In the `View` menu, select `Show Console`. A blank text field will appear at the very bottom of your Sublime window. Paste the following text in and hit Return (it's a long line of code, keep dragging to the right until you get it all): import urllib.request,os,hashlib; h = '2deb499853c4371624f5a07e27c334aa' + 'bf8c4e67d14fb0525ba4f89698a6d7e1'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by) -
rbetina revised this gist
Jan 14, 2015 . 1 changed file with 2 additions and 0 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 @@ -105,6 +105,8 @@ Terminal is something we're going to talk a lot about, but for now, just paste t sudo ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /bin/subl It will ask you to enter your login password; type it carefully. It won't look like anything is happening, but it is just hiding your typing. You should now be set; you can quit the Terminal app. I'll explain what this did in class. ## All Done! -
rbetina revised this gist
Jan 14, 2015 . 1 changed file with 2 additions and 2 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 @@ -84,7 +84,7 @@ This comes in very handy when we are working on Rails projects, which involves e What if you mess up? You can use Undo if necessary (Sublime keeps an extremely long Undo history for every file), and we'll also be using GitHub eventually to save previous versions of everything. ## Add ERB Tag and Reindent Keyboard Shortcuts In your Preferences menu, find "Key Bindings - User". A file will open up -- delete its contents and replace with the following: @@ -93,7 +93,7 @@ In your Preferences menu, find "Key Bindings - User". A file will open up -- del { "keys": ["ctrl+shift+r"], "command": "reindent" , "args": { "single_line": false } } ] Don't forget to save the file afterwards. Re-indent your code often; you no longer have any excuse to not have neatly indented code at all times! ## Mac Only: Add The `subl` Command Line Shortcut -
rbetina revised this gist
Jan 14, 2015 . 1 changed file with 12 additions and 6 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 @@ -49,25 +49,31 @@ Highlight the entire contents of this file and delete them; then, paste in the f "auto_complete_commit_on_tab": true, "auto_complete_with_fields": true, "caret_style": "smooth", "color_scheme": "Packages/Color Scheme - Default/Dawn.tmTheme", "create_window_at_startup": false, "drag_text": false, "ensure_newline_at_eof_on_save": true, "fade_fold_buttons": false, "font_face": "Courier New", "font_size": 18.0, "hot_exit": false, "ignored_packages": [ "Vintage" ], "remember_open_files": false, "remember_full_screen": false, "save_on_focus_lost": true, "show_full_path": true, "soda_folder_icons": false, "tab_size": 2, "theme": "Soda Light.sublime-theme", "translate_tabs_to_spaces": true, "trim_trailing_white_space_on_save": true, "word_wrap": true } Save the file after pasting this in. You can probably guess what some of these are doing, but others will be unfamiliar. Feel free in particular to choose whatever you like for `font_face` and `font_size`. However, for `font_face`, be sure to choose a **fixed width** font. For reasons you will see, when writing code, it is very helpful to have every character take up the same amount of horizontal space so that lines above and below one another line up. "Courier New" is a fixed width font that all Windows systems ship with. Monaco and Menlo are both nice options on Mac. -
rbetina revised this gist
Jan 6, 2015 . 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 @@ -24,7 +24,7 @@ Tens and hundreds of thousands of developers use Sublime, and many of them write In the `View` menu, select `Show Console`. A blank text field will appear at the very bottom of your Sublime window. Paste the following text in and hit Return: import urllib.request,os,hashlib; h = '2deb499853c4371624f5a07e27c334aa' + 'bf8c4e67d14fb0525ba4f89698a6d7e1'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by) Wait a second, and then **quit** Sublime and relaunch it (actually `Quit` the app from the `Sublime` (Mac) or `File` (Windows) menu -- don't just close the open windows). -
rbetina created this gist
Jan 6, 2015 .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,108 @@ # One-Time Sublime Configuration We are going to be writing all of our code using the *plain text editor* Sublime Text 3. In this guide, you will customize your installation with shortcuts and other things in order to make your life easier. What follows may seem opaque, but don't worry about it -- we just need to go through this process once, and then we'll be all set for the quarter. You aren't expected to understand exactly how it is all working right now. ## Installation Download Sublime Text 3 **(not 2)** for your platform of choice [here][1], and install it (locate and double-click the file you just downloaded). Sublime is paid software, but you can evaluate it for free forever -- it will just nag you once in a while to purchase it, which you can ignore. ## Tweak View Settings (If you don't see a particular menu option, that means it's already configured.) - Click on `View` > `SideBar` > `Hide Open Files` - Click on `View` > `Hide MiniMap` - Turn on `View` > `Word Wrap` ## Get Package Manager Tens and hundreds of thousands of developers use Sublime, and many of them write plugins to make it more useful to them in their daily work. Package Manager is a tool that will make it easy for us to add 3rd party plugins to our installation. In the `View` menu, select `Show Console`. A blank text field will appear at the very bottom of your Sublime window. Paste the following text in and hit Return: import urllib.request,os,hashlib; h = '7183a2d3e96f11eeadd761d777e62404' + 'e330c659d4bb41d3bdf022e94cab3cd0'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://sublime.wbond.net/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by) Wait a second, and then **quit** Sublime and relaunch it (actually `Quit` the app from the `Sublime` (Mac) or `File` (Windows) menu -- don't just close the open windows). You should now have Package Manager installed. Let's test it out by installing a theme called Soda. Go to `Tools` > `Command Palette`. This should make a search box pop open in the middle of your screen. Start typing "Install" into the box, and the results should get narrowed down until you see "Package Control: Install Package". Select it and hit return, or click it. Now, a second, slightly different looking search box should pop open. This is a list of all the plugins available. Start typing "soda", and you should see a result "Theme - Soda". Select it and hit return, or click it. The theme will then be installed (we'll turn it on in just a moment). There's two other packages that will be helpful to us. For each one, you first need to do `Tools` > `Command Palette`, then start typing "install", select "Package Control: Install Package", and then search for it in the second box that appears. Here are the packages for you to install: - SublimeERB - ERB Snippets ## Configure Preferences Open the User Preferences file. On Mac, this is found in the menu Sublime Text > Preferences > Settings - User. On Windows, there is a top-level Preferences menu within which you'll find User Settings. This will open a text file that describes your Sublime settings. Sublime is a tool for developers, after all, so it doesn't have a more conventional graphical interface to choose your settings. Highlight the entire contents of this file and delete them; then, paste in the following instead: { "auto_complete_commit_on_tab": true, "auto_complete_with_fields": true, "caret_style": "smooth", "create_window_at_startup": false, "draw_indent_guides": false, "ensure_newline_at_eof_on_save": true, "font_face": "Courier New", "font_size": 14.0, "hot_exit": false, "ignored_packages": [ "Vintage" ], "remember_open_files": false, "save_on_focus_lost": true, "tab_size": 2, "theme": "Soda Light.sublime-theme", "soda_folder_icons": false, "translate_tabs_to_spaces": true, "trim_trailing_white_space_on_save": true } Save the file after pasting this in. You can probably guess what some of these are doing, but others will be unfamiliar. Feel free in particular to choose whatever you like for `font_face` and `font_size`. However, for `font_face`, be sure to choose a **fixed width** font. For reasons you will see, when writing code, it is very helpful to have every character take up the same amount of horizontal space so that lines above and below one another line up. "Courier New" is a fixed width font that all Windows systems ship with. Monaco and Menlo are both nice options on Mac. The most important setting is `"save_on_focus_lost": true` -- this setting will make it so that, whenever you switch to a different app, Sublime will save all changes in all open files. This comes in very handy when we are working on Rails projects, which involves editing several files at once. As soon as you switch to Chrome to see the effects of the code you wrote, everything will automatically save. What if you mess up? You can use Undo if necessary (Sublime keeps an extremely long Undo history for every file), and we'll also be using GitHub eventually to save previous versions of everything. ## Add ERB Tag Keyboard Shortcut In your Preferences menu, find "Key Bindings - User". A file will open up -- delete its contents and replace with the following: [ { "keys": ["ctrl+shift+."], "command": "erb" }, { "keys": ["ctrl+shift+r"], "command": "reindent" , "args": { "single_line": false } } ] Don't forget to save the file afterwards. This shortcut will come in very handy once we get to writing Rails projects; remind me to demonstrate it for you once we get there, so you can make sure that it is working on your system. ## Mac Only: Add The `subl` Command Line Shortcut For Mac users, there's one last handy feature. Launch your Terminal app, which can be found in your `Applications` > `Utilities` folder. Better yet, get used to using your Spotlight to launch all apps -- type `Cmd-Space` to bring up the Spotlight search bar, and then start typing "Terminal". The app will appear under your search results after a few characters. Select it to launch. Terminal is something we're going to talk a lot about, but for now, just paste the following text (it's all one line) in at the prompt and hit return: sudo ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /bin/subl You should now be set; you can quit the Terminal app. I'll explain what this did in class. ## All Done! Your Sublime should now be all configured to make programming as painless as possible. If you see me using shortcuts in class that your Sublime isn't able to perform, then something above must have gone wrong; let me know so we can fix it. [1]: http://www.sublimetext.com/3