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

Mimic fugitive default mappings #101

Closed
jreybert opened this issue Nov 2, 2016 · 9 comments
Closed

Mimic fugitive default mappings #101

jreybert opened this issue Nov 2, 2016 · 9 comments

Comments

@jreybert
Copy link
Owner

jreybert commented Nov 2, 2016

@justinmk input:

fwiw, i think vimagit would gain a bit more traction if it used fugitive-like mappings where possible
e.g., ca in fugitive is like CA in vimagit. but it's different for no reason
better for users if the same mappings are used for analogous concepts
and CC is cc in fugitive
vimagit's N is analogous to in fugitive

@jreybert
Copy link
Owner Author

jreybert commented Jan 30, 2017

@khalidchawtany @yevhen-m could you please give a try to branch dev/mapping and tell me if you like new mappings?

@alok
Copy link

alok commented Jan 31, 2017

I wouldn't change CC to cc since cc is pretty handy for writing the commit message, since it clears the line.

Also, mapping over l, r, e, m, and (maybe) f isn't a great idea since often I want to:

  • move the cursor right (l)
  • change a letter in a commit message (r)
  • move by word (e)
  • set marks (m)
  • jump to a letter (usually in a commit message) (f)

If you could find a way to make those mappings only work outside the commit message region (maybe with a try/except block, though that's really hacky), I'm in favor. The other mappings are fine.

@yevhen-m
Copy link

Absolutely agree, @alok. It's a bad idea to change native mappings to something else. I don't like that M & L are remapped for this reason as well.

@jreybert
Copy link
Owner Author

@justinmk remarks about actual mapping (which are almost all caps mappings) are close to fugitive mappings, but could be the same (which would ease the usage of vimagit for fugitive users). Also, use non caps mappings for usual action like staging frees a finger :)

There is a trade off to find. vimagit is a little bit more than a usual vim plugin, it is a git UI embedded in vim. Then, it needs to use a lot of "easy to type" single key mappings to perform git actions efficiently.

@alok good point for the "out of commit section" idea. I will look how ugly it could be. Another solution would be to open a new window to write the commit message, but I like the idea to stay in the same window.

@yevhen-m these mappings are applied in the vimagit buffer only. You seem to dislike caps mappings too with L and M. Did you remap these mappings? What would you suggest? As there is a lot of mapping to remember, they must be mnemonic.

@khalidchawtany
Copy link

It is 1:00 am. I would be more than happy to try them tomorrow :)

@jreybert
Copy link
Owner Author

No no no, I want an anwser now! Get up!! 😄

Have a nice night, and thanks for the upcoming review.

@khalidchawtany
Copy link

No no no, I want an anwser now! Get up!!

Ha ha. I was long gone to 😴

Although sometimes I use the previous mappings accidentally, I would definitely would like to have the new ones 👍

@jreybert I am not able to stage visually selected lines vs, marked lines ms, or just a line l; unless there is a new line at the end of my file.
Maybe this is the same as before. However, I haven't noticed as I always have a blank line at the end of my files.

I get the following:

Error detected while processing function magit#stage_vselect[9]..<SNR>54_mg_create_diff_from_select:
line   42:
E605: Exception not caught: visual selection error: \ No newline at end of file

@jreybert
Copy link
Owner Author

jreybert commented Feb 2, 2017

Crap. Could you please try on branch next and check if there is the same behavior? Whatever the result, could you open an issue, precising the branch, your [n]vim version, your git version and a step by step way to reproduce this bug.

Thanks for your review!

@jreybert
Copy link
Owner Author

Actually, use small case s f m r... mappings is a bad idea, as it conflicts with very standard mappings.

The only change made in 488b619 is to map <C-n> <C-p> instead of N P to jump around the hunks

@jreybert jreybert added this to the Release 1.7.0 milestone Feb 23, 2017
jreybert added a commit that referenced this issue Aug 11, 2017
it mainly allows the user to get all vim mapping in commit editing mode
ref #106 #101
jreybert added a commit that referenced this issue Oct 2, 2017
it mainly allows the user to get all vim mapping in commit editing mode
ref #106 #101
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants