My First File in Vim
My First File in Vim
For this exercise, I used Vim on Ubuntu through UserLAnd to create and edit my first text file named contents.txt.
Steps I Followed
1. Opened Vim
I used the command vim contents.txt to open the file in Vim.
2. Entered Insert Mode
I pressed i to enter Insert Mode, which allowed me to type and add text to the file.
3. Wrote My Content
I entered multiple lines of text about software programming, coding, and my learning experience.
4. Saved and Exited
I returned to Command Mode by pressing Esc and used :wq to save the file and exit Vim.
5. Confirmed the Content
I used cat contents.txt to display the saved content and confirm that my changes were preserved.
What I Learned
I learned that Vim has different modes for editing and executing commands. Insert Mode allows me to write text, while Command Mode allows me to perform actions such as saving and exiting.
I also learned that pressing Esc takes me back to Command Mode.
Although Vim initially felt unfamiliar, practising with it helped me understand how to create, edit, save, and verify files directly from the terminal.
