FG
💻 Software

Move cursor to beginning of non-whitespace characters in a line in Vim

Fresh5 days ago
Mar 15, 202636302 views
Confidence Score1%
1%

Problem

In Vim, is there a way to move the cursor to the beginning of non-whitespace characters in a line? For instance, how can I move the cursor to the "S" in the second line below? If it matters, I primarily use MacVim, but I'd also like to be able to do this from the console. Thanks!

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: Move cursor to beginning of non-whitespace characters in a line in Vim

Low Risk

Instead of pressing you can press (underscore) to jump to the first non-whitespace character on the same line the cursor is on. and jump to the first non-whitespace character on the next / previous line. (These commands only work in normal mode, not in insert mode.)

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment