Go to the end of the C++ function in Vim

后端 未结 5 1712
无人共我
无人共我 2021-02-12 18:09

If I am in the middle of the function, I would like go to the very end of it in vim. I run into this problem as we sometimes have function of 500+ lines long (don\'t ask why).

相关标签:
5条回答
  • 2021-02-12 18:17

    ][ or [] will do this for you.

    0 讨论(0)
  • 2021-02-12 18:22

    Make sure you're using :split and code folding to your advantage - keep a folded view at the top of the screen, unfold a function, split, edit the function, close the split window, collapse the fold.

    0 讨论(0)
  • 2021-02-12 18:31

    You can use the "]}" command. You may have to repeat it depending on how nested you are.

    0 讨论(0)
  • 2021-02-12 18:34

    SHIFT+5 toggles between { and }. You can use it to identify the top most block of code.

    0 讨论(0)
  • 2021-02-12 18:37

    ][ goes to the next '}' in the first column.

    Read :help 29.3 to find out more about moving through a program.

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