Posts

Showing posts from 2017

Rename refactor in VIM

Image
Rename refactor using VIM O ne of the most useful features when it comes to refactor is the ability to change a variable/class/namespace name through all or a subset of the files in your project.  VIM does not have any direct way of doing this, which is really very upsetting if you want to use VIM as your main IDE . But there are solutions… TL;DR :set hidden :argadd “Your files” :argdo silent! %s/old_variable_name/new_variable_name/ge :argdo update Argument list in VIM The argument list feature is the way that VIM gives you to manipulate and group multiples files at once. You can visualize it as the next set of files that you will work with. Using this argument list for renaming words start to make sense since you want to apply an action (renaming) among multiple files (Argument list). In this article I will expose how to achieve rename refactor using the commands  argdo, argadd, and args. Lets first see what each of those command does argadd [file]  : Adds the file to