如何使用VIM删除聊天记录中的Skype时间戳?

his*_*eim -1 vim text

我有一些我想要清理的Skype聊天记录.它们看起来像这样:

[12-12-6 ??1:54:53] Xerxes: Bla Bla 
[12-12-6 ??1:55:23] Aron: Bla Bla Bla
[12-12-6 ??1:55:29] Aron: Bla
Run Code Online (Sandbox Code Playgroud)

我可以在VIM中使用什么命令删除括号[]中的所有内容(包括括号本身)?

Pet*_*ker 6

替代的替代方案:

:%norm da]x
Run Code Online (Sandbox Code Playgroud)

说明:

  • :normal {commands}{commands在正常模式下为一条线运行一个}
  • :norm 是的缩写 :normal
  • :%norm:normal在文件的每一行上运行命令
  • da]删除[]行开头的块
  • x 删除后面的空格 ]

有关更多帮助请参阅:

:h range
:h :norm
:h a]
:h d
:h x
Run Code Online (Sandbox Code Playgroud)