After all this time with Visidata, I still can't keep straight in my head all the variations of y/gy/gzy/zp etc. In the past, we've talked about trimming these commands to a manageable subset.
Instead, maybe we could keep the commands, but make them more intuitive and memorable. I'd like to suggest some ideas, to open up the possibilities.
Here's one idea, make y and p a vim-style "operator-pending" command, that takes a second letter to decide what shape to apply the yank/paste to. This is a prototype to test out in .visidatarc: y or p is applied to a shape that suggests the shape of the sheet elements it is applied to: . for cell, - for row, | for column:
Sheet.bindkey('y', None)
Sheet.bindkey('p', None)
vd.allPrefixes += ['y', 'p']
#Existing binding
Sheet.bindkey('y.', 'copy-cell') # zy
Sheet.bindkey('y-', 'copy-row') # y
Sheet.bindkey('ys-', 'copy-selected') # gy # selected rows
Sheet.bindkey('ys|', 'copy-cells') #gzy # selected cells in current column
Sheet.bindkey('p.', 'paste-cell') # zp
Sheet.bindkey('p,', 'paste-after') # p #maybe p- or p_ instead?
Sheet.bindkey('p', 'paste-before') # P
## the paste equivalent of 'ys-' does not exist; b/c there is no gp command, perhaps it would be:
## Sheet.bindkey('ps-', 'paste-selected') #none
Sheet.bindkey('ps|', 'setcol-clipboard') #gzp # selected cells in current column
The syscopy- and syspaste- equivalents could use the prefixes Y or P, perhaps. Or gy and gp.
Some other ideas:
## letter based mnemonics
yc copy-cell
yr copy-row
ys copy-selected
yC copy-cells
## motion based mnemonics
yh/yl copy-cell
yy copy-row (maybe also yj/yk)
ys copy-selected
y| copy-cells (maybe also y, )
After all this time with Visidata, I still can't keep straight in my head all the variations of
y/gy/gzy/zpetc. In the past, we've talked about trimming these commands to a manageable subset.Instead, maybe we could keep the commands, but make them more intuitive and memorable. I'd like to suggest some ideas, to open up the possibilities.
Here's one idea, make
yandpa vim-style "operator-pending" command, that takes a second letter to decide what shape to apply the yank/paste to. This is a prototype to test out in .visidatarc:yorpis applied to a shape that suggests the shape of the sheet elements it is applied to:.for cell,-for row,|for column:The
syscopy-andsyspaste-equivalents could use the prefixesYorP, perhaps. Orgyandgp.Some other ideas: