Skip to content

Instantly share code, notes, and snippets.

@elimirks
Created February 8, 2016 22:57
Show Gist options
  • Save elimirks/b70e6611e3b1c6a27f60 to your computer and use it in GitHub Desktop.
Save elimirks/b70e6611e3b1c6a27f60 to your computer and use it in GitHub Desktop.
:s/></>\r</g Substitute >< with a newline between. g flag means all occurances
=gg Auto-format (=) everything from the current line to the top (gg)
dd Delete (d) the current line (d)
qb Record macro (q) with name 'b'
dd
C-v Visual block mode (C-v)
l l j j d Move right twice, down twice, then delete all in selection
w Move one word right (w)
C ,<esc> Change until end of line (C) insert ','
j . Go down (j), repeat last command (.)
j .
V k k Visual line mode (V), move up twice (k)
J Join all selected lines
j
^ Jump to the beginning of the line, excluding whitespace
cf> Change (c) until (f), inclusively, the character '>'
spriteIndex = <esc>
f< D Jump on top of the '<' character then delete to EOL (D)
k J I Join (J) and insert at beginning of line, exlcuding whitespace (I)
new Tile(<esc>
A ),<esc> Append (A) the text '),'
j dd
q Finish recording the macro
9@b Run the macro (@) named 'b' 9 times
dd
V gg Visual line move (V) select up to the top of the file (gg)
2< Decrease the indent count (<) twice on selected lines
<map><tile><x>5</x><y>1</y><z>1</z><type>48</type></tile><tile><x>4</x><y>2</y><z>0</z><type>3</type></tile><tile><x>5</x><y>1</y><z>0</z><type>28</type></tile><tile><x>5</x><y>2</y><z>0</z><type>31</type></tile><tile><x>4</x><y>2</y><z>1</z><type>0</type></tile><tile><x>6</x><y>1</y><z>0</z><type>0</type></tile><tile><x>6</x><y>2</y><z>0</z><type>0</type></tile><tile><x>4</x><y>1</y><z>0</z><type>23</type></tile><tile><x>6</x><y>1</y><z>1</z><type>44</type></tile><tile><x>6</x><y>2</y><z>1</z><type>54</type></tile></map>
@purnimamehta
Copy link

Yoooooo

thanks <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment