def __line_move(self, direction): vim.current.line = ' ' + vim.current.line[1:] vim.normal(direction) vim.current.line = '>' + vim.current.line[1:]
def transform_selection(f): cr = anything.range new_text = [ f(line) for line in cr[:]] cr[:] = None vim.insert(cr.start, new_text) vim.normal("V%dj" % (len(new_text) - 1) )