check for illegal -n values
simplify vim search code
remove redundant checks for maintenance op
reset terms if maintenance op