Skip to content

Instantly share code, notes, and snippets.

@Verurteilt
Created April 21, 2013 06:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Verurteilt/5428655 to your computer and use it in GitHub Desktop.
Save Verurteilt/5428655 to your computer and use it in GitHub Desktop.
import sublime
import sublime_plugin
import time
class ExampleCommand(sublime_plugin.TextCommand):
def run(self, edit):
the_sels = self.view.sel()
the_sels_begin = the_sels[0].begin()
the_sels_end = the_sels[0].end()
lista = []
for i in range(the_sels_begin, the_sels_end):
lista.append(self.view.substr(i))
lista_unida = "".join(lista)
nombre_del_archivo = self.view.file_name()
tiempo_de_envio = time.strftime("%Y-%m-%d %H:%M")
return lista_unida, nombre_del_archivo, tiempo_de_envio
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment