sublimetext2 - Option to copy lines with carets NOT separated with empty lines -
sublime text 2 (windows 7) has such feature: several lines carets (no selections made,only carets) copied clipboard separated empty lines. can disable these empty line separators, copy w/o them?
detail:
- open few lines text file
- place 3-4 carets using ctrl+click on few lines
- press ctrl+c copy clibboard
- paste new file-- u see empty line separators copied text
think need plugin it. didn't test this, should work. it's pretty straight forward.
import sublime import sublime_plugin class emptylinecopycommand(sublime_plugin.textcommand): def run(self, edit): view = self.view lines = [] cursor in view.sel(): lines.append(view.substr(view.line(cursor))) sublime.set_clipboard("\n".join(lines))
put following in user key bindings.
{"keys": ["ctrl+c"], "command": "empty_line_copy", "context": [ { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true } ]},
Comments
Post a Comment