AutoFoV is a plugin for the X-Plane flight simulator, automatically setting the field of view based on the currently loaded aircraft. AutoFoV is open source; you can find its source code and more detailed instructions at its public GitHub repository.
AutoFoV comes in X-Plane's fat plugin format. Simply extract the directory AutoFoV from the zip file and place it as a sub-folder into the Resources/plugins folder of your X-Plane installation.
AutoFoV allows to define a custom field of view for each aircraft model (i.e. for each .acf file in your X-Plane's aircraft folder and its subfolders). To define a custom field of view, simply create an empty file in the same folder and with the same name as the .acf file, but suffixed with .fov instead of .acf, and populate it with the numeric FoV value you want to use with this aircraft (only digits 0-9 and the decimal dot are allowed).