🎥 PodcastsDesigned in California Makes Its Official Debut(03.09.2026 um 17:59 Uhr)
🔧 AI Nachrichten Major AI platforms go down in unprecedented simultaneous outage(03.09.2026 um 17:34 Uhr)
🍏 iOS / Mac OSWill Siri AI Speak Hindi? What Apple Has Published for India(11.09.2026 um 05:15 Uhr)
🍏 iOS / Mac OSiPhone Duo Apps Could Make or Break Apple’s Foldable iPhone(11.09.2026 um 05:16 Uhr)
🎥 PodcastsDesigned in California Makes Its Official Debut(03.09.2026 um 17:59 Uhr)
🔧 AI Nachrichten Major AI platforms go down in unprecedented simultaneous outage(03.09.2026 um 17:34 Uhr)
🍏 iOS / Mac OSWill Siri AI Speak Hindi? What Apple Has Published for India(11.09.2026 um 05:15 Uhr)
🍏 iOS / Mac OSiPhone Duo Apps Could Make or Break Apple’s Foldable iPhone(11.09.2026 um 05:16 Uhr)

🔧 Programmierung 🕛 vor 1 Jahr 2 Min Lesezeit
0

Mastering Surrounds in Vim: Add, Remove, and Modify Like a Pro

↗ Quelle (dev.to)
🗣️ Stimme:

If you're working in Vim and frequently need to add, delete, or modify surrounding characters like parentheses, quotes, or tags, the vim-surround plugin is a must-have. Here's a quick guide to get you started.



What is vim-surround?

vim-surround, developed by Tim Pope, is a plugin that simplifies working with surrounding characters in Vim. Whether you're wrapping a word in quotes, removing parentheses, or changing tags, vim-surround makes it effortless.




  1. Adding Surroundings
    To add surrounding characters to text:



Install vim-surround using a plugin manager like vim-plug:

vim

Copy code

Plug 'tpope/vim-surround'

Use the command ys (yank surround) in normal mode:

ys wraps the specified motion with the given character.

Examples:

ysiw) → Wraps the inner word with parentheses: (word)

ysiw" → Wraps the inner word with double quotes: "word"




  1. Deleting Surroundings
    To remove surrounding characters:



Place the cursor inside the surrounding.

Use the ds command followed by the surrounding character:

ds" → Removes surrounding double quotes: "word" → word

ds) → Removes surrounding parentheses: (word) → word




  1. Changing Surroundings
    To change one type of surrounding to another:



Place the cursor inside the current surrounding.

Use the cs command followed by the current and desired surrounding characters:

cs"' → Changes double quotes to single quotes: "word" → 'word'

cs)( → Changes parentheses to curly braces: (word) → {word}

For Vim Without Plugins

If you don't have vim-surround installed, you can still manually add or remove surroundings:



Add: Use i (insert) or a (append) to type the surrounding characters manually.

Remove: Use x to delete characters or visual mode (v) to select and remove.

Why Use vim-surround?

This plugin saves time and keystrokes, especially for repetitive editing tasks. It's simple, powerful, and enhances productivity in Vim.



Try it out and watch your Vim workflow transform!

Vollständiger Original-Bericht
Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
↗ Original-Artikel auf dev.to lesen
Wie bewertest du diesen Beitrag?
1 Klick Feedback
Teilen mit Netzwerk & Team:

Community-Analysen & Experten-Meinungen 0

Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
Community Pulse: Relevanz-Einschätzung
1 Klick Experten-Votum
🔴 Akute Relevanz 0%
🟡 In Evaluierung 0%
🟢 Keine Auswirkung 0%
Spannende Innovation 0%
Verwandte Story-Cluster & Quellen (Vektor-KI)
Port 8095 Engine
1 Quelle
Samsung Taps Mistral AI for On-Premises Chip Manufacturing
1 Quelle
CISA’s ChatGPT Incident Exposes a Bigger AI Governance Problem
1 Quelle
Beware — these new phishing attacks use a convincing fake Adobe Reader pages to trick victims into installing malware
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Mastering Surrounds in Vim: Add, Remove, and Modify Like a Pro

Thematisch verwandte Begriffe: Mastering, Surrounds, Remove, Modify · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...