Sorry to ask such a novice question but I am looking for a way to handle multiple files. I dont want to type huge file paths to open every file using :tabnew and :e commands
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Usually, vim supports buffers for that. Use
:baddto add buffer,:bdeleteto remove it and:ls(or:buffers) to list all opened buffers. I believe, GVim supports these features too.For example, if you wanna edit all
.rbfiles in yourapp/controllers/pagesdir (in the case of Rails project), you typevim app/controllers/pages/*.rbin your terminal and then edit the first file (buffer) in the vim window. When you’ve done with all changes, save changes as usual with:w(note: do not useq!option – this will close all your buffers you’ve opened) and then use:bn<tab>(or fully,:bnext) or:bpreviousto switch to the next file (buffer). When you run:bnexton the last buffer, you’ll be dropped to the first one.