Skip to content

Add ai text object #2

Description

@mawkler

Thanks for making a great plugin! I just switched to this one from vim-indent-object, and I noticed that this plugin doesn't support the ai text-object like vim-indent-object does. It is very useful when in visual mode and you've selected an indentation with ii, because then you can keep hitting ai to select the next indentation level. The mnemonic for ai is "around indendation", just like how (at least to me) ii reads "inside indendation".

For example, pressing vii with the cursor on the line with the comment "cursor here", and then pressing ai expands your selection to the next indendation level:

table.insert(active_right, {
  provider = 'filetype' -- 3. Pressing `ai` a second time selects this indendation level
  left_sep = left_sep,
  right_sep = right_sep,
  hl = { bg = 'line_bg' },
  enabled = has_file_type,
  icon = function()
    return {            -- 2. Pressing `ai` selects this indendation level
      str = get_icon(), -- 1. Put cursor here and press `vii`
      always_visible = true,
    }
  end,
  truncate_hide = true,
  priority = 1
})

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions