Vim search in C/C++ code lines

前端 未结 4 906
再見小時候
再見小時候 2020-12-24 03:27

Is there any way to search a string in a C/C++ source file while skipping commented lines?

4条回答
  •  难免孤独
    2020-12-24 04:02

    Not sure if this is helpful but when you type :syn it has all the formatting that is used in your file type. Maybe you can refer to that somehow. You could say something like:

    map n betterN
    
    function betterN{
      n keystroke
      while currentLine matches comment class
        do another n keystroke
    }
    

提交回复
热议问题