Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Breaks '.' #3

Closed
srushti opened this Issue · 7 comments

5 participants

@srushti

I'm not sure if this is even fixable (and I've faced similar issues with other pairing plugins), but could it possibly be made to work with '.'.
Currently if I type ''i[Hello world]' and then hit '.' I only get the 'Hello World' and not the brackets. I understand they work as different actions, but unfortunately vim users are used to thinking of an insert action as a repeatable command.
This becomes even more tricky if you use this as part of a 'cw' (change word) type command, because it forgets the changing part of the action.

@jiangmiao
Owner

Hello srushti,
i[hello world is be expand to i[]\<LEFT>hello world, and the \<LEFT> break the '.'
Currently I haven't a good solution. maybe you already know, you could use complex repeat(macro) qq to start recording a macro 'q', press q to stop recording then use @q to repeat the macro, and use @@ to repeat it again and again.

@srushti

Yeah, I can use a macro, but I'd really rather not have to do that every time.
After trying out a bunch of different plugins which does what yours does (and each of them failing the '.' test in different ways) I came across AutoClose which seems to use a different approach, but also doesn't have any customisability.

@bartels

It might be worth looking into vim repeat to accomplish this.

@jiangmiao
Owner

vim-repeat doesn't work for me,maybe I didn't configure vim-repeat write.
nmap . shows
n . * :<C-U>call <SNR>65_repeat(v:count)<CR>

@jiangmiao jiangmiao closed this
@nilbus nilbus referenced this issue in tpope/vim-repeat
Closed

Repeating imap commands #21

@dsummersl

I've been experiencing this problem fairly frequently lately - is this not fixed?

@ptrin

@jiangmiao Is it necessary to use <LEFT>? Have you looked at getpos() and setpos() to move the cursor?

e.g.

function! MoveLeft()
    let l:curPos = getpos('.')
    call setpos('.',[curPos[0], curPos[1], curPos[2]-1, curPos[3]])
endfunction
@jiangmiao
Owner

@ptrin I've tested code. But it cannot work. The function action won't be recorded. The code (foo) will be repeated as ()foo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.