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

How to set auto-format command? #2139

Closed
marlonmp opened this issue Apr 16, 2022 · 2 comments
Closed

How to set auto-format command? #2139

marlonmp opened this issue Apr 16, 2022 · 2 comments

Comments

@marlonmp
Copy link

Hi 👋

I'm new using helix, and I would like know if I can do something like this:

image

gopls works perfectly, but the gopls format command doesn't remove the unused packages like goimporst does.

@kirawi
Copy link
Member

kirawi commented Apr 16, 2022

auto-format is just a true/false key for using LSP formatting. External formatters would depend upon #122 and/or #1396. For now you can try following this to use an external formatter: https://github.com/helix-editor/helix/wiki/FAQ#strip-whitespace-or-format-the-buffer

@kirawi kirawi closed this as completed Apr 16, 2022
@tmke8
Copy link

tmke8 commented Apr 17, 2022

Now with #1972 merged, you can map :pipe goimports to some keyboard shortcut. It won't be format-on-save but still better than typing out the command every time.

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