Skip to content

Instantly share code, notes, and snippets.

@Hammer2900
Created June 26, 2015 19:41
Show Gist options
  • Select an option

  • Save Hammer2900/e4f81ac8f6b7770a6495 to your computer and use it in GitHub Desktop.

Select an option

Save Hammer2900/e4f81ac8f6b7770a6495 to your computer and use it in GitHub Desktop.
medit
def formater(simbol, text):
doc.delete_selected_lines()
doc.insert_text("{n}{t}".format(n=simbol,t=text))
TEXT = doc.get_line_text()
if TEXT[0] == "[":
if TEXT[0:3] == "[ ]":
formater("[+]",TEXT[3:])
elif TEXT[0:3] == "[+]":
formater("[-]",TEXT[3:])
elif TEXT[0:3] == "[-]":
formater("[!]",TEXT[3:])
elif TEXT[0:3] == "[!]":
formater("[ ]",TEXT[3:])
else:
formater("[ ]",TEXT)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment