One second saved per minute = 1.666% better living
- Sublime Text
- Git Editor
- Editor Config
- Eclipse IDE install
- Microsoft Code
- More on front-end styling
- More on OSX
This is a random collection of notes on text editors for the Mac.
There is not shortage to the number of programs available to edit code.
- Atom from GitHub (free)
- Code from Microsoft (free)
- http://brackets.io - Adobe Brackets is on Windows too
- http://barebones.com/products/textwrangler is the little brother to BBEdit.
- mvim ? for Mac
- $89 Sublime Text
- There is no equivalent of Notepad++ on Windows
- Aptana Studio
- Spyder (for Python pyflakes and pylint code analysis)
- Visual Studio Express from Microsoft
- IntelliJ and WebStorm and PhpStorm from JetBrains
- Visual Studio from Microsoft
- Markdown display
- Code completion
- Pre-compile on the fly
- Static code scan on the fly
- Full project navigation
- Refactoring (renaming) support
To edit the file executed upon opening a command-line Terminal:
To get out of VIM, type:
:q to quit (short for :quit) :q! to quit without saving (short for :quit!) :wq to write and quit (think write and quit) :x to write and quit (shorter than :wq) :qa to quit all (short for :quitall)
According to Wikipedia, pico stands for “pine composer”.
The ^ character means hold down the control key while you press the character.
Many tutorials make use of this tool.
There are two simultaneous production versions of Sublime Text: 2 and 3.
Download and Install Sublime Text
https://www.sublimetext.com/3 is recommended even though it’s labeled “beta” because desirable packages are being written for it.
Expanded explanations for various platforms:
On Linux: https://github.com/TCattd/sublime-text-linux-installer
Configure for command-line invocation
To use the Sublime Text text editor from the command line, make a symlink to subl.
If you don’t have a folder /usr/local/bin/, create it.
mkdir /usr/local/bin/ ls
Assuming you’ve placed Sublime Text in the Applications folder:
sudo ln -s "/Applications/Sublime Text 3.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl
To use Sublime Text as the editor for many commands that prompt for input, set your EDITOR environment variable:
export EDITOR='subl -w'
Specifying -w causes the subl command to not exit until the file is closed.
Use the Sublime text editor to open the profile file:
Install Package Control
One advantage of Sublime Text is its plug-ins.
- Switch to an internet browser to visit Package Control home page.
Click Browse at the upper right for the most popular:
- Emmet for keyboard shortcuts
- SublimeLinter to find typos
- Theme - Soda to look better
- SFTP to transfer files from within the editor UI.
Click the Popular heading for a list with more detail.
Visit Package Control home page.
- Open SublimeText 3.
- If not already installed, see https://packagecontrol.io/installation#st3
- Select your version of Sublime you have open.
- Double-click on the command text to select it.
- Press Ctrl+C to copy the command into the operating system’s invisible clipboard.
Switch back to SublimeText (press Command+Tab).
Bring up Sublime’s command-line Console by using the control+` (back-tick) shortcut or click menu View > Show Console.
NOTE: The Console recognizes Python code.
Paste the command and press Enter.
This creates the Installed Packages/ folder.
If you get
IndentationError: unexpected indent???
control+again to remove the Console.
- Restart Sublime Text.
Use Package Control
Press Cmd+Shift+P to bring command palette in front.
The position from the previous action is remembered.
- Type pac for Package Control. (Press Esc to dismiss it)
Select Install Package.
NOTE: This may take a few seconds to bring up a list from a website visited above.
Type in a package name and press Enter to install it:
(This is similar in operation to the Vim Tutor.)
Read more about SublimeText:
Use Sublime Text on Retina? for crisp, readable text, to Settings add
"font_options" : ["gray_antialias"]
Install spell check
Recommended spelling from the geniuses at Google. Install ST v3 https://github.com/noahcoad/google-spell-check/tree/st3 by https://github.com/noahcoad/google-spell-check/
If Git finds conflicts, it needs a way to show the differences in a text editor.
Git uses the default vim editor. To quit the page, press :q! (colon to specify a command, q to specify quit, exclamation point for immediate).
Sublime Text is a popular text editor.
Advantage of using the intelliJ IDE:
- Simple keystrokes wraps statements in a try-catch or if-else block.
- It generates getter and setter methods for object attributes.
- Inbuilt packaging tools like gradle, SBT, grunt, bower, etc.
- Directly access databases such as SQL, ORACLE, PostgreSQL, Microsoft SQL Server
- Editions for different operating systems: Windows, Linux, etc.
IntelliJ Control Key Shortcuts
During initial configuration, specify the Project SDK using the command up-arrow to the secret portal:
- Click New button
- Select JDK
- Click on the folder list (containing bin, etc.)
- Press command + up arrow to navigate up a folder level from Home to the **MacOS** folder.
- Click Choose to select the Java associated with the system. This is called the "Secret Portal" approach.
|Defaults changeable in Preferences||Keymaps|
command + G to Generate
command + O to go to class
command + ⌫ Delete line
Use an internet browser to atom.io
The site recognizes your operating system (OS X, Windows, or Linux) and presents the appropriate download button.
Follow Twitter @AtomEditor
Atom has package control, themes, auto-completion built-in.
https://github.com/atom/spell-check doesn’t work per http://stackoverflow.com/questions/27731981/use-spell-check-in-code-comments
To enable Spell Check for your current file type: put your cursor in the file, open the Command Palette (cmd-shift-p), and run the Editor: Log Cursor Scope command.
This triggers a notification which will contain a list of scopes. The first scope that’s listed is the one you should add to the list of scopes in the settings for the Spell Check package.
Examples: source.coffee, text.plain, text.html.basic.
Press cmd-shift-: to bring up the list of corrections when your cursor is on a misspelled word.
Put a .EditorConfig file ( from editorconfig.org) in your root folder, and the editor will format your code according to the rules defined in the file for whatever type of file is being edited.
It’s supported by default in the Atom editor.
It may take some effort to memorize the keyboard sequences, but these are the ones I remember because I save time using them:
Eclipse IDE install
brew cask install eclipse-java
Please migrate your Casks to the new location and delete /opt/homebrew-cask/Caskroom, or if you would like to keep your Caskroom at /opt/homebrew-cask/Caskroom, add the following to your HOMEBREW_CASK_OPTS: --caskroom=/opt/homebrew-cask/Caskroom For more details on each of those options, see https://github.com/caskroom/homebrew-cask/issues/21913. ==> Satisfying dependencies complete ==> Downloading https://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/neon/R/eclipse-java-neon-R-macosx-cocoa-x86_64.tar.gz&r=1 ==> Verifying checksum for Cask eclipse-java ==> Moving App 'Eclipse.app' to '/Applications/Eclipse.app' 🍺 eclipse-java staged at '/opt/homebrew-cask/Caskroom/eclipse-java/4.6.0' (0B)
On Mac: To get VS Code to make use of the current working directory, follow these instructions:
In Finder, click on a file using two fingers to select Open with Visual Studio Code (version 1.0+).
Select Code’s menu View, Command Palette at the top of the screen.
Begin typing this until the full command is recognized in the list:
Install ‘Code’ command in PATH
Select the full command that appears in the drop-down.
Exit the Code program.
You can now, in a new Terminal shell window, use the code command to open a file:
BTW, “hello” in the example above can be any file.
More on front-end styling
This is one of several topics:
- Text Editors
- Markdown text for GitHub from HTML
- JAM Stack Website Project Plan
- HTTP/2 Transition Project Plan
- Static websites
- Website styles
- Email from website
- Search within Hyde format Jekyll websites
- Data Visualization using Tableau
More on OSX
This is one of a series on Mac OSX:
- MacOS Hardware and accessories
- MacOS Terminal Tips and Tricks
- MacOS Keyboard tricks
- Text editors and IDEs on MacOS
- MacOS Setup automation with Ansible
- MacOS Configuration dotFiles
- MacOS Homebrew installers
- Applications on MacOS
- Backups on MacOS
- Utilities for MacOS
- Windows on Apple MacOS
- PHP on MacOS
- Java on MacOS
- Maven on MacOS
- Ruby on MacOS
- Python on MacOS
- Node on MacOS installation