2024-07-08

Vim Learnings

  • Executing commands using :!<command-name> - used to execute the command for example !ls will 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 file hellohello.txt and you execute the command :w hello1.txt will copy the same contents onto another new file called hello1.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 file hello1.txt is created with the selected content.