vimtricks.wiki Concise Vim tricks, one at a time.

How do I uppercase just the current paragraph without visual selection?

Answer

gUip

Explanation

gUip is a compact operator-plus-text-object pattern that uppercases exactly the paragraph your cursor is in. For long-form writing, commit messages, or quick structural edits, this is faster and safer than starting visual mode and manually expanding the selection. You get precise scope with one command and avoid accidental spillover into adjacent paragraphs.

How it works

  • gU is the uppercase operator
  • ip is the inner paragraph text object
  • Combined as gUip, Vim applies uppercase to the paragraph boundaries around the cursor

Because this uses a text object, it adapts to where the cursor is, not where a visual selection starts. That makes it predictable in repeat edits and easy to compose with other operator workflows.

Example

Before:

first line of paragraph
second line stays with paragraph

next paragraph stays lower

Run:

gUip

After:

FIRST LINE OF PARAGRAPH
SECOND LINE STAYS WITH PARAGRAPH

next paragraph stays lower

Tips

  • Use guip for lowercase and g~ip for case toggling with the same paragraph scope.
  • This pattern generalizes well: operator + text object is one of Vim's strongest editing primitives.

Next

How do I launch a GDB session in Vim with the built-in termdebug plugin?