The execute command lets you parse and execute a string as a Vim command. For example, the two following statements will produce equivalent results:
echo animal . ' says hello'
execute 'echo ' . animal . ' says hello'
You can use normal to execute keys just like the user would in normal mode. For instance, if you wanted to search for a word cat and delete it, you could do this:
normal /cat<cr>dw
Running normal like this will respect the user's mappings, so if you want to ignore custom mappings, you could use normal!:
normal! /cat<cr>dw
Another command can suppress output from other commands (such as execute): silent. Neither of these will produce any output:
silent echo animal . ' says hello'
silent execute 'echo ' . animal . ' says hello'
Furthermore, silent can suppress the output from external commands and ignore prompts:
silent !echo 'this is running in a shell'
You can also check if the Vim you're running in has a particular feature enabled:
if has('python3')
echom 'Your Vim was compiled with Python 3 support!'
endif
You can view the full list of features via :help feature-list, but something worth noting is OS indicators: win32/win64, darwin (macOS), or unix. These are extremely helpful if you're planning to build a cross-platform script.