config.cson:
editor:
softWrap: false
softWrapAtPreferredLineLength: false
keymap.cson:
# PC
'atom-text-editor:not([mini])':
'alt': 'placeRuler'
'^alt': 'hideRuler'
# Mac
'.platform-darwin atom-text-editor:not([mini])':
'alt': 'placeRuler'
'^alt': 'hideRuler'
init.coffee:
# if RULER_TIMEOUT > 0 then comment out the ^alt keybind in keymap.cson:
# ruler will disappear after this many seconds
RULER_TIMEOUT = 0
if RULER_TIMEOUT == 0
atom.commands.add 'atom-text-editor', 'placeRuler': (event) ->
return unless _editor = atom.workspace.getActiveTextEditor()
_position = _editor.getCursorScreenPosition()
atom.config.set('editor.preferredLineLength', _position.column)
else
RULER_TIMEOUT *= 1000
atom.commands.add 'atom-text-editor', 'placeRuler': (event) ->
return unless _editor = atom.workspace.getActiveTextEditor()
_position = _editor.getCursorScreenPosition()
atom.config.set('editor.preferredLineLength', _position.column)
f = () ->
atom.config.set('editor.preferredLineLength', 800)
setTimeout f, RULER_TIMEOUT
event.abortKeyBinding()
atom.commands.add 'atom-text-editor', 'hideRuler': (event) ->
return unless _editor = atom.workspace.getActiveTextEditor()
atom.config.set('editor.preferredLineLength', 800)
event.abortKeyBinding()
atom.getCurrentWindow().on 'blur', ->
atom.config.set('editor.preferredLineLength', 800)
styles.less:
atom-text-editor .wrap-guide {
width: 1px;
opacity: 0.3;
background-color: #83a598;
}