Skip to content

Commit

Permalink
fix: set --quiet if running from vim (#200)
Browse files Browse the repository at this point in the history
* fix: set --quiet if running from vim

Signed-off-by: Carlos Alexandro Becker <[email protected]>

* docs: document vim usage

---------

Signed-off-by: Carlos Alexandro Becker <[email protected]>
  • Loading branch information
caarlos0 committed Jan 25, 2024
1 parent 8684176 commit db3a762
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,15 @@ Wrap formatted output at specific width (default is 80)

Use the HTTP proxy to the connect the API endpoints.

## Using within Vim/neovim

You can use mods as an assistant inside Vim.
Here are some examples:

1. `:'<,'>w !mods explain this`
1. `:.!mods -f write a copyright footer for mycompany, 2024`
1. `:'<,'>.!mods improve this code`

## Whatcha Think?

We’d love to hear your thoughts on this project. Feel free to drop us a note.
Expand Down
3 changes: 3 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ var (
if !isOutputTTY() {
opts = append(opts, tea.WithoutRenderer())
}
if os.Getenv("VIMRUNTIME") != "" {
config.Quiet = true
}

if isNoArgs() && isInputTTY() {
err := huh.NewForm(
Expand Down

0 comments on commit db3a762

Please sign in to comment.