auto-pair, restore cursor position in the vim way