Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block ruv

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
ruv /
Created Mar 21, 2019
Wrap selected text with common formatting tags
wrap_selection_with = ( tag ) ->
e = atom.workspace.getActiveTextEditor()
m = e.markBufferPosition( e.getCursorBufferPosition() )
s = e.getSelectedBufferRange()
e.setCursorBufferPosition( s.end )
e.insertText('</' + tag + '>')
e.setCursorBufferPosition( s.start )
e.insertText('<' + tag + '>')
e.setCursorBufferPosition( m.getHeadBufferPosition() )
You can’t perform that action at this time.