Join this channel to get access to various perks:
/ @tanztalkstech
Vim (Vi IMproved) is an open-source text editor for Unix and Linux systems. It is a powerful and stable tool for editing and writing text, both in the command-line interface and as an independent application in a GUI.
Take the first step in learning Vim with the basic save and exit commands. Follow this video and learn how to save a file in Vi/Vim and exit the editor.
o Using Vim Modes
When Vim launches, files are opened in command mode by default. This means that you can move around and edit the file, but cannot insert new text.
All alphanumeric keys in this mode are equal to commands, and pressing them will not display their value on the screen. For example, pressing the letter w will move the cursor one word forward.
To type text, you must be in insert mode. To switch to insert mode, press the i key. Now you can type text into a file.
To switch back to command mode, press the Esc button.
o How to Save Changes in Vim
Vim offers different commands to save changes to a file, depending on whether you need to exit the text editor or not.
00:01:15 Start by opening a new text file using Vim:
vim example_file.txt
Next, press i to enter insert mode and add some text.
00:03:00 i) Vim Save and Quit Command
1. Switch to command mode by pressing the Esc key.
2. Press : (colon)
3. Type x after the colon and hit Enter. This will save the changes and exit.
Alternatively, a command that will also save a file and exit the text editor is:
:wq
In which case the w stands for write (save) and q stands for quit.
00:05:19 How to Save a File in Vi / Vim Without Exiting
1. Switch to command mode by pressing the Esc key.
2. Type : (colon)
3. Type w after the colon and hit Enter. This will save in Vim the changes made to the file, without exiting.
00:06:00 You can also rename an existing file by adding the new name after the commands.
:w [newfilename]
00:06:40 Exit Without Saving Changes in Vi / Vim
1. Switch to command mode by pressing the Esc key.
2. Press : (colon)
3. Type q! after the colon and hit Enter to exit without saving the changes.
The q! quits the text editor.
----------
VirtualBox playlist:
• VirtualBox Tutorial
Install Ubuntu 22.04 LTS in VirtualBox running on Windows: • How to Install Ubuntu 22.04 LTS on Vi...
Install macOS Monterey in VirtualBox running on Windows: • How to Install Apple macOS 12 Montere...
Install Oracle Java (JDK) On Ubuntu 22.04 LTS, Debian Linux: • How To Install Oracle Java (JDK) On U...
Install Node.js on Ubuntu 22.04 LTS | Install NodeJS and npm: • How To Install Node.js on Ubuntu 22.0...
Install and Use Visual Studio Code on Ubuntu 22.04 LTS Linux (VS Code): • How to Install and Use Visual Studio ...
Install Microsoft Windows 11 on VirtualBox: • How to Install Microsoft Windows 11 i...
Install Oracle VM VirtualBox 7 on Windows 11: • How to Install VirtualBox on Windows ...
Install Linux Mint 21 "Vanessa" Cinnamon on VirtualBox | Compute Hash using SHA256 and Verify ISO: • Install Linux Mint 21 "Vanessa" Cinna...
Install Ubuntu 23.04 on VirtualBox in Windows: • How to Install Ubuntu 23.04 on Virtua...
----------
More Tutorials for VMWare Player:
• VMware Workstation Tutorials
Install Microsoft Windows 11 on VMware Player: • How to Install Microsoft Windows 11 o...
Install macOS 12 Monterey on VMware Player: • How to Install macOS 12 Monterey🔥on V...
Install macOS 13 Ventura on VMware Player: • How to Install macOS 13 Ventura in VM...
Install Ubuntu 23.04 on VMware Player On Windows 11: • What is Virtual Machine? How to Insta...
----------
Ubuntu Tutorials: • Ubuntu Linux Tutorials
Install Android Studio on Ubuntu 22.04 LTS | Android Studio on Ubuntu 22.04 LTS: • How to Install Android Studio on Ubun...
Install Ubuntu on Windows 11 (WSL) | Windows Subsystem for Linux with GUI Support: • How to Install Ubuntu on Windows 11 (...
Reset Forgotten Ubuntu Linux Password on WSL | Debian, Kali, Linux Password Reset on WSL | Windows 11: • Reset Forgotten Ubuntu Linux Password...
Install Vim (Vi Improved) Text Editor on Ubuntu | Debian Linux: • How to Install Vim (Vi Improved) Text...
Edit Hosts file in Ubuntu | How to Block Websites in Linux using /etc/hosts file: • How to edit Hosts file in Ubuntu | Ho...
Bash Shell Scripting Tutorial: • Bash Shell Scripting Tutorial
What is a Bash Script? Write a simple Bash Script in 5minutes: • What is a Bash Script? Write a simple...
Docker Tutorial for Beginners | Install and Learn Docker in 20minutes! Docker Ubuntu: • Docker Tutorial for Beginners | Insta...
----------
Create State-District Dependent (Nested) Spinner | DropDown List | Multiple Spinners | Java Android: • Complete Tutorial | Create State-Dist...
Create Login and Register Android App with Firebase Authentication using Java in Android Studio: • Login and Register Android App using ...
Login and Register Android App with Firebase Authentication using Java: • Create Login and Registration App for...