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

Edit command as user OS config option #1324

Merged
merged 4 commits into from
Jun 5, 2021
Merged

Edit command as user OS config option #1324

merged 4 commits into from
Jun 5, 2021

Conversation

caojoshua
Copy link
Contributor

Adding os.editCommand as an optional user config, similar to os.openCommand. If omitted in the config, falls back to the previous options. If included in the config, run {{os.openCommand}} {{filename}}.

Testing

  • Fedora Linux
  • Empty config / config without os.editCommand
  • config including os.editCommand = nano, vim, etc.

Caveats

  • New to go programming language, so not sure about code quality, especially the testing code
  • I added empty default configurations for non-Linux, but only have a Linux machine to test on

Docs

I haven't wrote any docs, but if the maintainers decide this is a desired feature, I can draft something up. To my knowledge, there currently is not any sections that describes how lazygit chooses the text editor for editCommand, so maybe I could add a section on that in Config.md.

Copy link
Owner

@jesseduffield jesseduffield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good :) Just one thing, could we update config.md accordingly?

@caojoshua
Copy link
Contributor Author

Looks good :) Just one thing, could we update config.md accordingly?

done in most recent commit.

docs/Config.md Outdated
@@ -213,6 +216,21 @@ os:
openCommand: 'open {{filename}}'
```

### EditCommand
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### EditCommand
### Configuring File Editing

Slightly more domain-specific title

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made the change, along with some better English in that section.

Copy link
Owner

@jesseduffield jesseduffield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one more thing!

Copy link
Owner

@jesseduffield jesseduffield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Made a couple minor changes to the wording, but otherwise all good

@jesseduffield jesseduffield merged commit 0df02da into jesseduffield:master Jun 5, 2021
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

Successfully merging this pull request may close these issues.

None yet

2 participants