VS Code Extensions
S

Smart Quote Select

by Gwen0x4c3

Select inside the nearest single or double quotes on the current line.

Downloads

13

Rating

— (0)

Version

0.1.1

Last updated

May 19, 2026

A tiny VSCode extension command for VSCodeVim users.

It provides smart quote text-object-like commands for single quotes (') and double quotes ("). The extension automatically decides whether the current cursor is inside single quotes or double quotes, then applies the corresponding operation.

Commands

Command Description
smartQuoteSelect.selectInside Select inside the nearest quote pair
smartQuoteSelect.selectAround Select around the nearest quote pair, including quotes
smartQuoteSelect.deleteInside Delete inside the nearest quote pair
smartQuoteSelect.deleteAround Delete around the nearest quote pair, including quotes
smartQuoteSelect.changeInside Delete inside the nearest quote pair and enter insert mode
smartQuoteSelect.changeAround Delete around the nearest quote pair, including quotes, and enter insert mode

Behavior

For double quotes:

const a = "hello world"

When the cursor is inside hello world:

Key Result
vii Selects hello world
vai Selects "hello world"
dii Deletes hello world, keeps the quotes
dai Deletes "hello world"
cii Deletes hello world, keeps the quotes, then enters insert mode
cai Deletes "hello world", then enters insert mode

For single quotes:

const a = 'hello world'

The same keys work automatically. You do not need to choose between vi" and vi' manually.

Escaped quotes are ignored:

const a = "hello \"world\""

Nested quotes prefer the innermost quote pair:

const a = "outer 'inner'"

When the cursor is inside inner, vii selects inner.

Use with VSCodeVim

Install the VSCodeVim extension first:

  • Extension name: Vim
  • Extension id: vscodevim.vim

Then add the following mappings to your VSCode settings.json.

Minimal config

{
  "vim.normalModeKeyBindingsNonRecursive": [
    {
      "before": ["v", "i", "i"],
      "commands": ["smartQuoteSelect.selectInside"]
    },
    {
      "before": ["v", "a", "i"],
      "commands": ["smartQuoteSelect.selectAround"]
    },
    {
      "before": ["d", "i", "i"],
      "commands": ["smartQuoteSelect.deleteInside"]
    },
    {
      "before": ["d", "a", "i"],
      "commands": ["smartQuoteSelect.deleteAround"]
    },
    {
      "before": ["c", "i", "i"],
      "commands": ["smartQuoteSelect.changeInside"]
    },
    {
      "before": ["c", "a", "i"],
      "commands": ["smartQuoteSelect.changeAround"]
    }
  ]
}

Related extensions