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

Feature request: encourage 72-character lines #140

Closed
duncanjbrown opened this issue Aug 1, 2017 · 4 comments
Closed

Feature request: encourage 72-character lines #140

duncanjbrown opened this issue Aug 1, 2017 · 4 comments

Comments

@duncanjbrown
Copy link

Thank you for this great plugin!

A small feature request.

In vimagit's commit mode, the first line of the commit is highlighted to encourage a 50-character length, but the rest of the commit has a line length of 80 characters. This means that my commit messages don't look quite right on GitHub 🙂 .

I have been manually setting textwidth=72 in the vimagit buffer to make my messages conform. Could Magit set this?

If this is a simple change I'm happy to have a stab at a PR.

@jreybert
Copy link
Owner

jreybert commented Aug 3, 2017

Hi Duncan,
thanks for encouraging!

This is a good idea, but I am not sure I want to set tw for the user (I am still not sure...).

A first step will be a new user command: VimagitLeaveCommit. With this new command, adding following commands in your vimrc will set the textwidth when you are writing a commit message:

autocmd User VimagitEnterCommit setlocal textwidth=72                                                                                                                                                                                                                       
autocmd User VimagitLeaveCommit setlocal textwidth=0

Give a try on next branch, add User autocmd in your vimrc and tell me if it fits your needs.

@duncanjbrown
Copy link
Author

Thank you. I've done as you suggest. Will live with it for a day or two and let you know.

@jreybert
Copy link
Owner

jreybert commented Aug 8, 2017

Merged in master and present in release 1.7.2

@jreybert jreybert closed this as completed Aug 8, 2017
@duncanjbrown
Copy link
Author

duncanjbrown commented Aug 16, 2017

Can confirm that this is working well 👍. Thanks!

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