18.01.2020 Views

Working with Linux

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

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:

cat > ~/.vimrc << EOF

...

<vimrc content>

...

EOF

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!