2024-07-08
Vim Learnings
- Executing commands using
:!<command-name>- used to execute the command for example!lswill list the files in the current working directory and press ENTER to continue.
Writing to New files
-
Writing more files, copying the same contents of the existing file to another file using
:w <new-file-name>, say for example working on the filehellohello.txtand you execute the command:w hello1.txtwill copy the same contents onto another new file calledhello1.txt. -
Copying the selected content onto a new file: Enter visual mode by pressing
v, and in the below prompt:'<,'>and then follow the above similar step to save the copied contents onto new file.:'<,'> w hello1.txt, the new filehello1.txtis created with the selected content.