Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I haven't used VIM in any great capacity in quite a while and I need a quick refresher. I know that there is the option to open 2 documents in a single session of VIM, a split screen deal. I can't recall how this is done and I have not found it in the MAN page(I know it is there but I can't find it)nor can I find the instructions in the vimtutor (I didn't expect to find anything there but thought I would check anyway. Would some VIM guru tell me how to 1)open the vertical split screen option and 2) open the same file in both windows, one to edit and one to reference.
To open the same file in two separate views, simply open your file with vim and then type :split.
To open two files in two views, open the first file, then type ":split <2ndfilename>" and you'll have the second file open.
Typing crtl+w and then arrow down switches to the lower split, with arrow up you'll go to the upper one.
one more question and I should be set. I know that there is a search and replace feature in VIM, can I use this to remove any instance of unwanted text from a file. As you can probably guess I have a large file that is very cluttered and for ease of administration I need to clean it out. Problem being that this file is constantly being added too, but no one before me has had the clarity of thought to remove the information that is no longer necessary. In order to get this cleaned up I need to be able to muscle through it in a single shift and to go through line by line could take a very long time.
In this case, from within vim type ":help substitution" and you'll have the complete reference about this topic.
I don't know how to tell vim to substitute in the whole file, but you can type "100 ." to repeat the last command 100 times. Obviously, you can type the number you like...
but if you frequently need such an automated task, you should definitely opt for something like "sed" (very simple and efficient for string substitutions)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.