Instant configuration restoring

The configuration we have seen in this chapter might take some time to set up manually, but, once everything is configured, we can create a script that will restore the Vim configuration instantly.

For this, we paste all the commands issued up to now into a bash script that can be run to bring Vim to the exact same configuration. All that is missing from this script is the vimrc file from the home folder, which we can also restore through a technique called heredocs. Just type cat, redirect the output to vimrc, and use heredoc as input, delimited by eof:

Instant configuration restoring
cat > ~/.vimrc << EOF
...
<vimrc content>
...
EOF

Using heredocs ...

Get Working with Linux – Quick Hacks for the Command Line now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.