datamash tool : transposition rows->columns and inversely - Shortcut with vim

Viewed 101

I have just discovered the tool datamash to swap between transposition of rows/columns or columns/rows.

How can I define a shortcut in ~/.vimrc to automatically transpose in the 2 senses ?

I tried to set (delimiter is whitespace) : noremap <C-T><C-T> :% !datamash transpose -W

I don't know how to specify the current opened file on which I want to toggle between the rows/columns ans inversely columns/rows.

Anyone could see how to perform this transposition by a simple shortcut on vim ?

EDIT: everyting works fine by setting into ~/.vimrc:

noremap <C-T><C-T> :% !datamash --no-strict transpose -W<CR>
1 Answers

Try including <CR> by the end of the noremap line.

Related