Hacker News new | ask | show | jobs
by saulpw 6 days ago
I have been using vi/vim for 30 years and I had no idea about using ^K-M to insert an em-dash.
2 comments

Same here, and to anyone trying it out for the first time and confused why it's not working:

    - insert mode
    - that is a (typed) dash between Ctrl+K and M
    - uppercase M (aside: the K can be upper or lower case)
Yep: https://vimdoc.sourceforge.net/htmldoc/digraph.html

I started using them a long time ago to type Greek characters, but then I switched to vscode with a vim extension and it didn't support that keybinding so I lost the habit. Might work with the neovim extension now.

edit: Yep, but you have to add "k" to the list of "control characters handled by neovim" in the extension's settings.