readline-like motion for command mode