You can determine the current post type using get_post_type()
inside the callback function hooked to wp_default_editor
:
add_filter( 'wp_default_editor', 'wpse242896_wp_default_editor' );
function wpse242896_wp_default_editor( $editor ) {
$post_type = get_post_type();
if ( 'custom_post_type' === $post_type ) {
return 'html';
} else if ( 'other_post_type' === $post_type ) {
return 'tinymce';
}
return $editor;
}
Also, anonymous functions are generally discouraged because they can’t be unhooked very easily.