How to transpose the contents of lines and columns in a file in Vim?

前端 未结 6 638
既然无缘
既然无缘 2021-02-02 16:49

I know I can use Awk, but I am on a Windows box, and I am making a function for others that may not have Awk. I also know I can write a C program, but I would love not to have s

6条回答
  •  一生所求
    2021-02-02 17:49

    Vim support for a number of scripting languages built in -- see the Python interface as an example.

    Just modify vim.current.buffer appropriately and you're set.

    To be a little more specific:

    function! Rotate()
    python <

提交回复
热议问题