mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-17 00:18:05 +02:00
Docs for EditCommand.
This commit is contained in:
committed by
Jesse Duffield
parent
60468d2e17
commit
e7c657fba0
@ -61,6 +61,9 @@ git:
|
|||||||
allBranchesLogCmd: 'git log --graph --all --color=always --abbrev-commit --decorate --date=relative --pretty=medium'
|
allBranchesLogCmd: 'git log --graph --all --color=always --abbrev-commit --decorate --date=relative --pretty=medium'
|
||||||
overrideGpg: false # prevents lazygit from spawning a separate process when using GPG
|
overrideGpg: false # prevents lazygit from spawning a separate process when using GPG
|
||||||
disableForcePushing: false
|
disableForcePushing: false
|
||||||
|
os:
|
||||||
|
editCommand: '' # see EditCommand section
|
||||||
|
openCommand: # see OpenCommand section
|
||||||
refresher:
|
refresher:
|
||||||
refreshInterval: 10 # file/submodule refresh interval in seconds
|
refreshInterval: 10 # file/submodule refresh interval in seconds
|
||||||
fetchInterval: 60 # re-fetch interval in seconds
|
fetchInterval: 60 # re-fetch interval in seconds
|
||||||
@ -214,6 +217,21 @@ os:
|
|||||||
openCommand: 'open {{filename}}'
|
openCommand: 'open {{filename}}'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### EditCommand
|
||||||
|
Lazygit will run edit with the first non-empty command:
|
||||||
|
1. config.yaml
|
||||||
|
```yaml
|
||||||
|
os:
|
||||||
|
editCommand:
|
||||||
|
```
|
||||||
|
2. $(git config core.editor)
|
||||||
|
3. $GIT_EDITOR
|
||||||
|
4. $VISUAL
|
||||||
|
5. $EDITOR
|
||||||
|
6. vi (if found through `which vi`)
|
||||||
|
|
||||||
|
Lazygit will log an error if none of these commands are non-empty.
|
||||||
|
|
||||||
### Recommended Config Values
|
### Recommended Config Values
|
||||||
|
|
||||||
for users of VSCode
|
for users of VSCode
|
||||||
|
@ -339,7 +339,7 @@ func (c *GitCommand) EditFileCmdStr(filename string) (string, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if editor == "" {
|
if editor == "" {
|
||||||
return "", errors.New("No editor defined in $GIT_EDITOR, $VISUAL, $EDITOR, or git config")
|
return "", errors.New("No editor defined in config file, $GIT_EDITOR, $VISUAL, $EDITOR, or git config")
|
||||||
}
|
}
|
||||||
|
|
||||||
return fmt.Sprintf("%s %s", editor, c.OSCommand.Quote(filename)), nil
|
return fmt.Sprintf("%s %s", editor, c.OSCommand.Quote(filename)), nil
|
||||||
|
Reference in New Issue
Block a user