0

In Vim, you can use Command + Delete to delete all texts before the current cursor on the line (on insert-mode).

However, this functionality doesn't seem to exist in Neovim. I tried moving my ~/.config/nvim/init.vim to somewhere else temporarily but only found it is persistent.

Why does this useful key combination not work in Neovim? Or is it only me?

2

Cmd + Delete is (obviously) a macOS only shortcut. I may be wrong but I think Neovim removed the runtime files that provided OS specific shortcuts. Anyway you can achieve the same using the standard Ctrl + U. I say standard because you can try this shortcut on most Unix terminal applications (try it directly in Bash!) and it does the same regardless of the operating system (that means Ctrl + U does the same in macOS, any Linux distribution, FreeBSD, Windows Subsystem for Linux, etc.)

Vim and of course Neovim make heavy use of standard terminal shortcuts, for example you can suspend them and go back to your command line with Ctrl + Z, or delete the word before the cursor with Ctrl + W. :h CTRL- and then Tab will allow you to see all the shortcuts with the Ctrl modifier.

  • Thanks. Am I the only one who sees the Ctrl + u on Terminal delete all the characters on the line, not only the characters before the current cursor? I use Zsh, though. – Blaszard Mar 3 '18 at 8:50
  • I haven't use Zsh before but this seems to be the problem and solution stackoverflow.com/questions/3483604/… – Tae Mar 5 '18 at 21:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.