How do I duplicate a whole line in Vim in a similar way to Ctrl+D in IntelliJ IDEA/ Resharper or Ctrl+Alt+↑/↓ in Eclipse?
Eclipse – How to duplicate a whole line in Vim
eclipseeditorkeyboard shortcutsvivim
Related Topic
- Vim clear last search highlighting
- Your most productive shortcut with Vim
- Visual-studio – Visual Studio : short cut Key : Duplicate Line
- Turning off auto indent when pasting text into vim
- Git – How to make Git use the editor of the choice for commits
- How to exit the Vim editor
- Android-studio – the shortcut to Auto import all in Android Studio
- C++ – Redirect std::cout to newly created console
Best Answer
yy or Y to copy the line (mnemonic: yank)
or
dd to delete the line (Vim copies what you deleted into a clipboard-like "register", like a cut operation)
then
p to paste the copied or deleted text after the current line
or
P to paste the copied or deleted text before the current line