Skip to content

Instantly share code, notes, and snippets.

ruv

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
ruv / atom-editor-user-command.coffee
Created Mar 21, 2019
Wrap selected text with common formatting tags
View atom-editor-user-command.coffee
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.