Remove all arbitary spaces before a line in Vim

前端 未结 9 2253
感动是毒
感动是毒 2020-12-01 02:56

I\'v written a plugin where it comes to parsing a XML tag. The content inside the tag is indented and when i copy the parsed string into the file it\'s gettting like:

<
相关标签:
9条回答
  • 2020-12-01 03:25

    How about this:

    :%s/^ *//
    

    Or are you looking for a vim-script solution?

    0 讨论(0)
  • 2020-12-01 03:26

    Personally I would visually select the lines with V, then use 99< to push the text as far left as it could go.

    0 讨论(0)
  • 2020-12-01 03:27

    A simple search/replace s/^\s*// should do the trick, but it's probably not the minimal version.

    0 讨论(0)
提交回复
热议问题