Skip to content

Instantly share code, notes, and snippets.

@JoshCheek
Last active February 17, 2016 08:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JoshCheek/ff2a4e82587b68f3b190 to your computer and use it in GitHub Desktop.
Save JoshCheek/ff2a4e82587b68f3b190 to your computer and use it in GitHub Desktop.
My Atom editor configuration for Seeing Is Believing

Explanation

This is my configuration for Atom, I figured an example would help make it clearer.

Configuration location depends on Atom Version

I am using Atom 0.138.0, in older versions, the configuration went at the root-level of the document instead of under 'global'

Chruby vs Rvm vs Rbenv

I am using chruby, which is why I have a separate executable to wire up the environment. If I made the package better, you could just provide it with this information and wouldn't need a separate executable.

Rvm

This separate executable is the same way that rvm works if you type rvm wrapper 2.1 sib, it will make you a program that does this same thing as the one I wrote, but for rvm. You can then do which sib_ruby to get the path, and set that as the global.seeing-is-believing.ruby-command

Rbenv

If you're using rbenv, you don't need a binary, you can use the output of which ruby, but you need to set the RBENV_VERSION environment variable by setting the configuraiton global.seeing-is-believing.add-to-env.RBENV_VERSION, I recently set it to 2.1.1 for someone, and set their ruby command to /Users/username/.rbenv/shims/ruby, which worked correctly. You can see a list of options wiht rbenv versions, and can play around in the shell to see if it is correct by doing env RBENV_VERSION=1.9.3-p327 ruby --version and making sure that chruby selects the one you want. Once you're sure the env var is good, you'll know which value to add to the configuration.

Why is my config so minimal compared to the example?

I only set the global.seeing-is-believing.ruby-command because SiB's defaults are sufficient for all other configuration.

'global':
'exception-reporting':
'userId': '533e7e23-c8b7-fbfb-dca1-01f97d1b92f0'
'release-notes':
'viewedVersion': '0.92.0'
'welcome':
'showOnStartup': false
'metrics':
'userId': '8a833cc8f0c5ce341b88d5e0f425e16503b9629e'
'editor':
'invisibles': {}
'fontSize': 14
'core':
'themes': [
'atom-dark-ui'
'solarized-dark-syntax'
]
'ignoredNames': [
'.git'
'.svn'
'.DS_Store'
]
'seeing-is-believing':
'ruby-command': '/Users/josh/code/dotfiles/bin/sib_ruby'
#!/bin/sh
# This file is: /Users/josh/code/dotfiles/bin/sib_ruby
/usr/local/bin/chruby-exec 2.1.2 -- ruby "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment