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

Add ability to move cursor after closing bracket in new line #48

Closed
vitorf7 opened this issue Feb 9, 2016 · 3 comments
Closed

Add ability to move cursor after closing bracket in new line #48

vitorf7 opened this issue Feb 9, 2016 · 3 comments

Comments

@vitorf7
Copy link

vitorf7 commented Feb 9, 2016

When you are writing for example a function like so:

public function helloWorld() {|}

When you press it will be like so:

public function helloWorld() {
    |
}

Which is all ok but once you finish everything it would be ideal to be able to press } and then the cursor move to the position after the closing parentheses like so:

public function helloWorld() {
    return "hello world";
}|

The same would apply to () and [] as those can be used in many languages (I am a PHP dev) to denote things like arrays, and function parameters etc.

Thanks.

@cohama
Copy link
Owner

cohama commented Feb 9, 2016

You can do this by adding following rules to your vimrc.

call lexima#add_rule({'char': '}', 'at': '\%#\n\s*}', 'leave': '}'})
call lexima#add_rule({'char': ']', 'at': '\%#\n\s*]', 'leave': ']'})
call lexima#add_rule({'char': ')', 'at': '\%#\n\s*)', 'leave': ')'})

@cohama
Copy link
Owner

cohama commented Feb 21, 2016

any updates?

@vitorf7
Copy link
Author

vitorf7 commented Feb 24, 2016

@cohama I have tried it and it worked. Sorry for the delay in responding

@cohama cohama closed this as completed Mar 23, 2016
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

2 participants