Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird cursor behaviour when typing brackets or parenthesis #120

Closed
noncototient opened this issue Mar 29, 2017 · 9 comments
Closed

Weird cursor behaviour when typing brackets or parenthesis #120

noncototient opened this issue Mar 29, 2017 · 9 comments

Comments

@noncototient
Copy link

Environment

  • OS: macOS Sierra 10.12.3 (16D32)
  • vim: space-vim 0.5.0 @ 800

Problem Description

Typing brackets or parenthesis results in a strange cursor behaviour.

Whenever brackets or parenthesis are closed, the cursor jumps back to the first bracket and then jumps in front after the closing bracket.

I was not able to figure out which plugin results in this behaviour.

Also, weird cursor behaviour with lexima.vim (bracket/parenthesis autoclosing) plugin installed, where the cursor flicks between being a line and a block when deleting in insert mode.

@liuchengxu
Copy link
Owner

liuchengxu commented Mar 29, 2017

https://github.com/liuchengxu/space-vim/blob/master/layers/%2Bvim/programming/packages.vim#L13 , space-vim uses auto-pairs to obtain parentheses auto-closing when programming Layer enabled. Both auto-pairs and lexima.vim work well in my case, I can't reproduce your issue. Could you show me an example? And what's your Layers() function?

@noncototient
Copy link
Author

noncototient commented Mar 29, 2017

Thanks for your quick reply!

Not sure what my layer is, I'm just using the default install. Couldn't find any docs on how to enable different layers just now when doing a quick search.

Take a look at this video, you can see how the cursor jumps back and forth: http://recordit.co/6OabGXCvaZ

@noncototient
Copy link
Author

Also quick note. The brackets and parenthesis are not autoclosing. Have to close them manually.

@liuchengxu
Copy link
Owner

liuchengxu commented Mar 29, 2017

Try editing .spacevim in your home directory, use Layer command to enable programming Layer:

function! Layers()
    " Default Layers
    Layer 'fzf'
    Layer 'unite'
    Layer 'better-defaults'
    " Add programming Layer
    Layer 'programming'
endfunction

Then you need to run :so $MYVIMRC and :PlugInstall to install the neccessay plugins. Or you can reopen vim, it should install the missing plugins automatically.

Please refer to layer for more information.

@noncototient
Copy link
Author

Added the programming layer and the issue is now fixed. Thank you so much @liuchengxu!

Loving this vim setup, man!

@zhenjun115
Copy link
Collaborator

auto-pairs will help you to complete bracket when you type the first left symbol, but it won't help you to complete broken bracket. It is not an issue.

@noncototient
Copy link
Author

For anyone who is having the same issue even when using stock Vim, this behaviour is caused by showmatch functionality in Vim.

Check your .vimrc and see if its there, then remove it and the cursor should start acting normally again.

@tyy-x
Copy link

tyy-x commented Jan 7, 2020

For anyone who is having the same issue even when using stock Vim, this behaviour is caused by showmatch functionality in Vim.

Check your .vimrc and see if its there, then remove it and the cursor should start acting normally again.

Thank you, this solved my problem.

@CFryerBrightSign
Copy link

I was experiencing very similar symptoms caused by colorscheme shine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants