/vim-insert-point

vim-insert-point.

Primary LanguageVim Script

vim-insert-point

cursor move on insert mode!

example

.vimrc

imap <Tab> <Plug>(insert_point_next_point)
imap <S-Tab> <Plug>(insert_point_prev_point)
smap <Tab> <Plug>(inserst_point_next_point_select)
smap <S-Tab> <Plug>(inserst_point_prev_point_select)

case1: default settings.

your cursor on |. (language is javascript)

var func = function (arg1, arg2|) {
  return { key1: 'value1', key2: 'value2' }
}

you type <Tab>. move cursor at the next point.

var func = function (arg1, arg2)| {
  return { key1: 'value1', key2: 'value2' }
}

you type <Tab> again.

var func = function (arg1, arg2) {|
  return { key1: 'value1', key2: 'value2' }
}

you type <Tab> again. move cursor and selection value1.

var func = function (arg1, arg2) {
  return { key1: '|value1', key2: 'value2' }
}

case2: html settings.

your cursor on |. (language is html)

<d|iv id="id-value1">
    <a class="class-value1" href="https://github.com/hrsh7th/vim-insert-point">
        <span>text1</span>
    </a>
</div>

you type <Tab>. move cursor and selection id.

<div |id="id-value1">
    <a class="class-value1" href="https://github.com/hrsh7th/vim-insert-point">
        <span>text1</span>
    </a>
</div>

you type <Tab>. move cursor and selection id-value1.

<div id="|id-value1">
    <a class="class-value1" href="https://github.com/hrsh7th/vim-insert-point">
        <span>text1</span>
    </a>
</div>

you type <Tab>.

<div id="id-value1">|
    <a class="class-value1" href="https://github.com/hrsh7th/vim-insert-point">
        <span>text1</span>
    </a>
</div>

you type <Tab>. move cursor and selection class.

<div id="id-value1">
    <a |class="class-value1" href="https://github.com/hrsh7th/vim-insert-point">
        <span>text1</span>
    </a>
</div>