I'm a Vim user trying out spacemacs for the first time. In Vim, I have a keybind that when I press L (jump to bottom of screen), it also centers the screen on the cursor. In my .vimrc, this is done with nnoremap L L<bar>zz <CR>
, but I'm unsure of how to chain two keypresses like this in emacs.
-
1The Emacs way is to write a custom command instead of coming up with a sequence of keystrokes. Therefore there's no general answer to this type of question as every situation requires its own special command.– wasamasaCommented Mar 4, 2018 at 18:46
Add a comment
|
1 Answer
In Emacs the standard practice is to write an elisp function to do this sort of thing. For instance, you could implement your command and bind it like this:
(defun center-last-line ()
(interactive)
(goto-char (point-max))
(beginning-of-line)
(recenter))
(global-set-key (kbd "C-c l") #'center-last-line)
-
Thanks! I'll look more into elisp functions. This worked function worked as well.– AquovaCommented Mar 5, 2018 at 22:48