An open API service indexing awesome lists of open source software.

https://github.com/spacewander/vim-textobj-lua


https://github.com/spacewander/vim-textobj-lua

Last synced: 5 months ago
JSON representation

Awesome Lists containing this project

README

          

# vim-textobj-lua - Provide text objects for Lua code

[![Build Status](https://travis-ci.org/spacewander/vim-textobj-lua.png)](https://travis-ci.org/spacewander/vim-textobj-lua)

## Requirement

[vim-textobj-user](https://github.com/kana/vim-textobj-user)

## Usage

This plugin add following key mappings defined in Visual mode and Operator-pending mode.

#### \(textobj-lua-block-a)
Default:
```
omap al (textobj-lua-block-a)
xmap al (textobj-lua-block-a)
```

Select a Lua block. More precisely, it selects lines
belong to:
- for...do...end block
- if...then...end block
- while...do...end block
- repeat...until... block
- function...end block

#### \(textobj-lua-block-i)
Default:
```
omap il (textobj-lua-block-i)
xmap il (textobj-lua-block-i)
```

Like `(textobj-lua-block-a)`, but it doesn't
include start and end marks.

#### \(textobj-lua-function-a)
Default:
```
omap af (textobj-lua-function-a)
xmap af (textobj-lua-function-a)
```

Select a Lua function.

#### \(textobj-lua-function-i)
Default:
```
omap if (textobj-lua-function-i)
xmap if (textobj-lua-function-i)
```

Like `(textobj-lua-function-a)`, but it doesn't
include function definition and end mark.

#### \(textobj-lua-condition-a)
Default:
```
omap ac (textobj-lua-condition-a)
xmap ac (textobj-lua-condition-a)
```

Select a Lua condition region. More precisely, it selects
words contains:
- for...do
- if...then
- while...do

#### \(textobj-lua-condition-i)
Default:
```
omap ic (textobj-lua-condition-i)
xmap ic (textobj-lua-condition-i)
```

Like `(textobj-lua-condition-a)`, but it doesn't
include start and end marks like 'for', 'if' and so on.

For further reading, please `:vert help textobj-lua`.