在Sublime Text 2中用列表代替

3

我希望替换一组单词 flipInY ,并且每次出现时替换为不同的单词。例如,我有以下内容:

flipInY flipInY flipInY flipInY flipInY flipInY flipInY flipInY flipInY flipInY

我希望它变成这个样子:

bounce flash pulse rubberBand shake headShake swing tada wobble jello

有没有一种方法可以使用Sublime自动完成这个操作?
1个回答

6
你可以通过一系列内置的快捷方式来完成这个操作。
  1. Type your list into the editor, with each item on its own line:

    bounce
    flash
    pulse
    rubberBand
    shake
    headShake
    swing
    tada
    wobble
    jello
    
  2. Select all (Ctrl + A / Super + A).

  3. Split selection into lines (Ctrl + Shift + L / Super + Shift + L). This creates a cursor on each line. In your case, you should have 10 cursors.
  4. Copy.
  5. In the file with all the flipInYs, find and select every instance. You can do this by opening the find panel, typing in flipInY, and clicking Find All (or alt+enter). Note that this won't work unless you have the same number of occurrences of flipInY. In your case, there should be 10.
  6. Paste.

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接