Changed appInit to htmlReady to apply settings so that settings are applied when the setting are available and before code mirror is loaded