Refactoring in Vim

前端 未结 15 1949
醉梦人生
醉梦人生 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:12

    Plugin YouCompleteMe (YCM) (20k stars on github)

    http://ycm-core.github.io/YouCompleteMe/#the-refactorrename-new-name-subcommand

    :h RefactorRename-new-name

    In supported file types, this command attempts to perform a semantic rename of the identifier under the cursor. This includes renaming declarations, definitions and usages of the identifier, or any other language-appropriate action. The specific behavior is defined by the semantic engine in use.

    Similar to FixIt, this command applies automatic modifications to your source files. Rename operations may involve changes to multiple files, which may or may not be open in Vim buffers at the time. YouCompleteMe handles all of this for you. The behavior is described in the following section.

    Supported in filetypes: c, cpp, objc, objcpp, cuda, java, javascript, typescript, rust, cs

    By default there is no mapping.

提交回复
热议问题