Skip to main content
edited title
Link
cdnszip
  • 357
  • 1
  • 8

emacs set Setting key problem: save and close just like vim

Source Link
cdnszip
  • 357
  • 1
  • 8

emacs set key problem: save and close just like vim

I'm trying to use global-set-key to bind commands ":x" as save and close, just like the way vim do. Right now I'm doing:

(global-set-key (kbd "S-; x") (lambda() (kbd "C-x C-s") (kill-emacs)))

But when I type Shift+: and then x, it just write :x in the documents instead of really doing save and close. Wondering what should be the right form?