elisp - How to customize Emacs key bindings for going to specific line / end of buffer -
I want to customize the Macs have to press
ESC: < n
and
n
Kbd> ESC:
$ REET
takes me to the last line (similarly how the Vi editor works). < / P>
How can I get it into my AMACS configuration file? Currently I have
.emacs :
(global-set-key (kbd "M-9") 'back-window' (global-set-key ( Kbd "M-0") 'other window) I do not want to use any off-shelf solution (eg evil) because they are bloated and messed up with their existing shortcuts can do.
Put it in a file and load (execute the meaning of load): < pre> (defun vi-goto-line (arg) (interactive "Seline:") (message args) (if (string = "$" args) (end-of-buffer) (Goto-the-line (string to Entry Arg)))) (Global-set-key (KBD "M-:") 'V-goto-line)
You can do this to load Use the MX load-file and then enter the file interactively. Note
key combo M -: < (which ESC : the same ) already Imaks There is a meaning in it, so it has become tight now.
Of course you can also load the file with your .emacs by entering (load-file "/ path / in .emacs < / Code> or directly insert these lines into your .emacs file (or any other configuration file that loads) / P>
Comments
Post a Comment