FG

How to add a new line with the same indentation

Fresh3 days ago
Mar 15, 202627590 views
Confidence Score0%
0%

Problem

Then I press Enter in Insert mode, a new line is created, but the cursor is placed at the beginning of the line. How do I create a new line with the same indentation as the current one?

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: How to add a new line with the same indentation

Low Risk

Adding to your ~/.vimrc can do that for you automagically.

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment