Skip to content

Instantly share code, notes, and snippets.

@saulpw
Created October 13, 2021 19:04
Show Gist options
  • Save saulpw/2c293d8963b66a87d443c07af2b4314a to your computer and use it in GitHub Desktop.
Save saulpw/2c293d8963b66a87d443c07af2b4314a to your computer and use it in GitHub Desktop.
visidata command to slide current row to the right
TableSheet.addCommand('zL', 'slide-cells-right', '''
for oldcol, newcol in reversed(list(zip(visibleCols[cursorVisibleColIndex:], visibleCols[cursorVisibleColIndex+1:]))):
newcol.setValue(cursorRow, oldcol.getValue(cursorRow))
visibleCols[cursorVisibleColIndex].setValue(cursorRow, None)
''', 'slide cells in current row one column to the right')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment