added some logic to deal with degrading vim features gracefully