Refactoring in Vim

前端 未结 15 1948
醉梦人生
醉梦人生 2021-01-29 17:44

Of course the fact that you can refactor on IDEs is priceless for many, I hardly ever do it when I am coding but I may try to do it when editing some one else\'s source. How do

15条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-29 18:16

    Place cursor at name to refactor and type

    gd (or gD if you're refactoring a global variable).

    Then

    cgn new_name esc

    and

    . one or more times to refactor next occurrence(s)

    or

    :%norm . to refactor all occurrences in the buffer at once.

提交回复
热议问题