1

I'm using spacemacs with vim-bindings, but I only mention it so you don't scratch your head too long at the keystrokes of the macro. A regular emacs solution will work just the same.

I've read through the naming and saving section of the manual. This is nice but it's a lot of steps and the output is verbose and unpleasing to the eye:

(fset 'insert-code-block (kmacro-lambda-form [?o ?\{ return ?\} escape ?O escape] 0 "%d")) 

I've also read this post with similar naming.

I would like to use something like kbd syntax:

(kbd "o { RET } <escape> O") 

For reference, this was the keychord binding I used with regular emacs:

(key-chord-define-global "xb" (kbd "RET { RET RET } C-p TAB")) 

1 Answer 1

1

Turns out you can just use the kbd function:

(fset 'insert-code-block (kbd "o { RET } <escape> O")) 
2
  • FYI - you can accept your own answer (you may need to wait some period first; dunno). Commented Feb 28, 2022 at 2:33
  • Yes, was in the waiting period. Thank you for the reminder though! Commented Mar 3, 2022 at 2:06

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.