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

Default mapping [% / ]% conflicts with matchit.vim plugin #6

Open
inkarkat opened this issue Apr 17, 2015 · 4 comments
Open

Default mapping [% / ]% conflicts with matchit.vim plugin #6

inkarkat opened this issue Apr 17, 2015 · 4 comments

Comments

@inkarkat
Copy link
Contributor

I like the added [% / ]% motions to move to the beginning / end of the current block, but unfortunately, they conflict with the matchit.vim plugin that ships with Vim (cp. :help [%). As many users associate % with matching braces, I'd suggest a different default mapping, maybe [; / ];, as these are close together (on a US-English keyboard, anyhow), close to the other keys used by the plugin, and ; (the command separator in many programming languages) at least somewhat suggest current coding block.

PS: While submitting my patches, I noticed that you've actually based your plugin (with proper attribution, thanks!) on the code I've once posted on the Vim Tips Wiki. In fact, I had used the code I've posted there for years, and only recently discovered and then switched to your plugin (as it looked more advanced). Keep up the good work!

@jeetsukumaran
Copy link
Owner

Strangely enough, it seems that matchit.vim is not installed for me (I am using MacVim). Hence I missed this mapping. You are right about avoiding conflict. I wonder if [0 and ]$ might be better mnemonically? Or [^ and ]^ to preserve the symmetry?

@inkarkat
Copy link
Contributor Author

I had considered all of those, too. I don't like the asymmetry of the first, and [^ has been in use by me personally. In the end, it's a tough decision, as so many keys are already taken.

@jeetsukumaran
Copy link
Owner

Another possibility is [<BS> and [<BS], but I suspect people will not not like the difficulty of typing this.

By the way, thank YOU for posting the code on the Vim Tips Wiki that this plugin is based on!

@blueyed
Copy link

blueyed commented Oct 14, 2015

Came here to report the same conflict.

My 2 cents: I like [<BS> and ]<BS>, given that it is near [ / ] on a German keyboard, which I've mapped to ü/+, and that's right next/below <BS>.

Apart from that, I would find it more useful if it ([%) would jump to
print(1) (the first line of the function body) with the cursor on the last
line.

def some_long_method_name(foobarbaz1, foobarbaz2, foobarbaz3, foobarbaz4,
                          foobarbaz5):
    print(1)

    foo = another_long_method_name()

Currently it is described as follows:

move to the line just after the previous line of lesser indent

Maybe that could be made to stop before lines with more indent?!

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

3 participants