↧
vim replace text in files
To replace the text in multiple files, use the arg commands. First, set the files you’ll be working on, example: :args app/views/**/*.erb Then, run this command: :argdo...
View Articleworking with file encodings
To read a file with a specific encoding: :e ++enc=windows-1250 path/to/file To write with a specific encoding: :w ++enc=utf-8 path/to/file
View Articleexample of using vim captures
This replaces strings such as: :src => "images/student2.jpg" with: :src => asset_path("student2.jpg") The vim command is: :%s/\v"images\/(.*)"/asset_path("\1")/gc
View Article