Renaming the current file in Vim

前端 未结 21 697
轻奢々
轻奢々 2021-01-29 17:15

How should I rename my current file in Vim?

For example:

  • I am editing person.html_erb_spec.rb
  • I would like it renamed to person
21条回答
  •  日久生厌
    2021-01-29 17:44

    You can also do it using netrw

    The explore command opens up netrw in the directory of the open file

    :E
    

    Move the cursor over the file you want to rename:

    R
    

    Type in the new name, press enter, press y.

提交回复
热议问题