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

Drop redundant g] and g[ mappings #39

Merged
merged 1 commit into from
Jan 8, 2017

Conversation

goodboy
Copy link
Contributor

@goodboy goodboy commented Jan 4, 2017

These motions are redundant (since [[ and ]] are already used) and
also mask other standard mappings (eg. g] normally is shorthand for
:tselect). Adjust the docs to match.

Fixes #37

Copy link
Owner

@tweekmonster tweekmonster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also add a quick note about this change in the braceless-news section?

@@ -54,16 +54,12 @@ function! s:enable(...)

if !empty(g:braceless#key#jump_prev)
execute 'map <buffer> ['.g:braceless#key#jump_prev.' <Plug>(braceless-jump-prev-n)'
execute 'map <buffer> g'.g:braceless#key#jump_prev.' <Plug>(braceless-jump-prev-n-indent)'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you turn this into an option that's disabled by default instead? There might be people who want to retain this feature and I don't want to blindside anyone without an option to get it back.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about this quite a bit and I honestly think it should just be dropped.
If anyone misses it they can always remap it and g] was never documented as the primary key binding.

That being said I'll do as you wish.

*g]* Move forward to an increased indent level
*g[* Move backward to a decreased indent level
By default you can move between block heads using the |[[| and |]]| motions.
This fits better with VIM's traditional notion of a |section|.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could read:

By default you can move between block heads using the |[[| and |]]| motions.
This fits better with VIM's traditional notion of a |section|.  If you want
motions for moving between block indent levels ... etc

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So you want that trailing off at the end or are you expecting me to fill that in?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh and I'm assuming for now you want the new option documented as well?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah just fill it in. I guess a boolean variable like braceless_jump_indent would be good. I'll leave it to your best judgement on how to word the doc text.

The use of `g]` masks the standard mapping for `:tselect`.
Disable the indent jumping feature by default.
Indicate how to re-enable it in the docs.

Fixes tweekmonster#37
@goodboy
Copy link
Contributor Author

goodboy commented Jan 8, 2017

@tweekmonster hopefully that's closer to what you want.
Let me know if any further changes are needed :)

@tweekmonster
Copy link
Owner

@tgoodlet Yes it is! Sorry I didn't reply sooner. I became ill on Friday and didn't want to make comments that my healthy self wouldn't agree with.

To elaborate on why I want to retain this as an option: you mentioned that it's redundant, but it's not. [[ and ]] moves to the next found block. [g and g] moves to the previous and next block by decreasing and increasing indent. It's not obvious this is happening if your code only increases in levels. I'm only now realizing that I worded the doc poorly regarding this.

The project I was working on had complex if...else blocks and it helped with jumping to the top of the block or moving inward to another nested if...else or try...except block. I thought this was a "good enough" generic solution to that opposed to having a say, [i maps for if...else and [t for try...except.

Though, it still might be nicer to have [d, [c, [i for def, class, and if respectively.

@tweekmonster tweekmonster merged commit 6a71b2b into tweekmonster:master Jan 8, 2017
@goodboy
Copy link
Contributor Author

goodboy commented Jan 8, 2017

@tweekmonster no worries I just got the requested changes pushed this afternoon.

Yes, I realized after looking more thoroughly at the source that I was wrong about saying it was "redundant* (didn't notice the braceless-jump-prev-n-indent part).

Yeah I for sure like the idea of separate controls for def, class; other blocks too.
Maybe we can flush out something in #38 ;)

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

Successfully merging this pull request may close these issues.

2 participants