Editing Text Files with VIM
In life, there are many ways that we can crack an egg. In Linux, there are many ways that we can edit text files. You have the choice of the text editor that suits you. In this series of videos we want to help you master editing text files using vim. We are not dictating that you have to use vim or that it is any better than other editors. Quite simply, vim is my preferred editor and it is what I use. Including it within the programming and scripting section of the site also has been thought out and is intentional. Firstly, we have to think that the more code you create the more text files you will edit making text editors of interest. Secondly, vim has many powerful features that you can use to speed your code writing and can become a mini IDE in itself.
VIM is not Easy
When you first start editing text files with VIM you will not find the editor easy. There is a learning curve but I highly recommend sticking with it and persevering in those early stages. If you work a lot with text files in Linux you will benefit from the speed at which you can carry out your tasks, especially repetitive edits. Work slowly through the early tutorials and practice what you learn regularly.
VIM is Worthwhile
Working your way through the videos we provide here you will soon learn why I like using VIM so much
- Simplify Multiple Repetitive Edits Using the Dot Command: Learn how the power of the dot in normal mode can act as a powerful macro tool.
- Select Text in VIM Using the Visual Editor: You may not want to select the whole line to cut and paste. Maybe you need to select a few words or parts of lines. This is where the Visual Editor is perfect.
- Substitute Text in VIM: We can replace text through the document in VIM or we can select using * and use the dot key to repeat edit.