-
-
Notifications
You must be signed in to change notification settings - Fork 61
Detect go.mod as a 'gomod' filetype; add syntax and indent #620
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
Conversation
|
Thanks. Did you intend for this to also do something with respect to auto indenting in For example, starting with: (which is typically a position I find myself in because I use |
|
Sure, I can write an indent file. I agree it would be nice to have. Looks like vim-go doesn't have one, though. |
9ba5982 to
2a8e571
Compare
|
@myitcv I wrote a simple indent file for go.mod. I've never written an indent file before but this seems like a pretty basic filetype so hopefully this will cover all the important cases for now. PTAL. |
e1e7999 to
d7cf27b
Compare
myitcv
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great, thanks. Tried it locally and all is 👍. We can follow up with a test some other time.
Just one comment/question about the position of the autocmd.
Then if you don't mind squashing the commits and providing a helpful commit message in the mould of previous commits https://github.com/govim/govim/commits/master. Use a prefix of cmd/govim to indicate this relates to the plugin.
First, add ftdetect configuration to detect go.mod files as the 'gomod' filetype. Then add syntax and indent files for this filetype. The gomod syntax file is reused from the vim-go project under the terms of its 3-clause BSD license. The indent file is new work.
Done, though it seems like a strange convention to use |
There is some attempt at logic behind this rather strange approach.
Using the Go project convention here of using package paths for issue/PR prefixes, because this change relates to Not ideal when mixing repos like this, but that's the current logic FWIW. |
myitcv
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks very much for this contribution.
|
I'm going to merge this once #653 has landed. |
First, add ftdetect configuration to detect go.mod files as the 'gomod' filetype.
Then add syntax and indent files for this filetype.
The gomod syntax file is reused from the vim-go project under the terms of its 3-clause BSD license. The indent file is new work.