vi - 如何在vi中交换奇数行和偶数行?

标签 vi

假设我有这样的代码:

__device__ ​ float __cosf (float x);
//Calculate the fast approximate cosine of the input argument.
__device__ ​ float __exp10f (float x);
//Calculate the fast approximate base 10 exponential of the input argument.
__device__ ​ float __expf (float x);
//Calculate the fast approximate base e exponential of the input argument.
__device__ ​ float __fadd_rd (float x, float y);
//Add two floating point values in round-down mode.
__device__ ​ float __fadd_rn (float x, float y);
//Add two floating point values in round-to-nearest-even mode.
__device__ ​ float __fadd_ru (float x, float y);
//Add two floating point values in round-up mode.

我如何在 vi 中交换奇数行和偶数行?

最佳答案

你可以定义一个键来交换 2 行: :map <F2> ddp<Down>

似乎没有太多行,所以按几次'F2'会交换行...

关于vi - 如何在vi中交换奇数行和偶数行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58579964/

相关文章:

vim:基于一个 :global 命令运行多个命令

linux - 如何将 vi 编辑器与 google 文档集成

vim - 普通模式下的 Vi 组独立命令

vim - 卸载 vim vundle 包管理器

regex - 如何在 VIM 中执行存储在文件中的一堆编辑器命令?

vim - 在 GVim 上编辑只读文件

vim - 如何从 `Insert mode` 撤消在此模式下所做的更改?

vi - 转到倒数第二行

vim - 忽略 Vim 脚本中的 'Pattern not found' 错误信息

Vim:改变鼠标点击行为