config.yml 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ###
  2. # config.yml
  3. #
  4. # Docs:
  5. # * https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md
  6. ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ###
  7. gui:
  8. scrollPastBottom: false
  9. mouseEvents: false
  10. nerdFontsVersion: "3"
  11. border: "single"
  12. theme:
  13. inactiveBorderColor:
  14. - white
  15. activeBorderColor:
  16. - yellow
  17. - bold
  18. searchingActiveBorderColor:
  19. - cyan
  20. - bold
  21. selectedLineBgColor:
  22. - yellow
  23. git:
  24. autoFetch: true
  25. autoRefresh: false
  26. overrideGpg: true
  27. commit:
  28. autoWrapCommitMessage: true
  29. autoWrapWidth: 72
  30. os:
  31. edit: "$DOTFILES_DIR/.scripts/lazygit_nvim_editor.zsh {{filename}}"
  32. editAtLine: "$DOTFILES_DIR/.scripts/lazygit_nvim_editor.zsh {{filename}} {{line}}"
  33. editAtLineAndWait: "$DOTFILES_DIR/.scripts/lazygit_nvim_editor.zsh {{filename}} {{line}}"
  34. editInTerminal: false
  35. update:
  36. method: never
  37. refresher:
  38. fetchInterval: 3600
  39. customCommands:
  40. - key: "<c-c>"
  41. context: "files"
  42. description: "Create a conventional commit"
  43. command: /usr/bin/env python3 $DOTFILES_DIR/.scripts/lazygit_add_conventional_commit.py '{{.Form.Type}}' '{{.Form.Scope}}' '{{.Form.Breaking}}' '{{.Form.Subject}}' '{{.Form.Breaking}}'
  44. prompts:
  45. - type: "menu"
  46. key: "Type"
  47. title: "Type"
  48. options:
  49. - name: "feat"
  50. description: "A new feature"
  51. value: "feat"
  52. - name: "fix"
  53. description: "A bug fix"
  54. value: "fix"
  55. - name: "test"
  56. description: "Adding missing tests or correcting existing tests"
  57. value: "test"
  58. - name: "chore"
  59. description:
  60. "Changes that do not modify the source code or test files"
  61. value: "chore"
  62. - name: " "
  63. description: ""
  64. value: "chore" # This line is just here for aesthetics, but should still have a valid value
  65. - name: "build"
  66. description:
  67. "Changes that affect the build system or external dependencies"
  68. value: "build"
  69. - name: "ci"
  70. description: "Changes to CI configuration files and scripts"
  71. value: "ci"
  72. - name: "docs"
  73. description: "Documentation changes"
  74. value: "docs"
  75. - name: "perf"
  76. description: "A code change that improves performance"
  77. value: "perf"
  78. - name: "refactor"
  79. description:
  80. "A code change that neither fixes a bug nor adds a feature"
  81. value: "refactor"
  82. - name: "revert"
  83. description: "Reverts a previous commit"
  84. value: "revert"
  85. - name: "style"
  86. description: "Changes that do not affect the meaning of the code"
  87. value: "style"
  88. - type: "input"
  89. key: "Scope"
  90. title: "Scope (optional)"
  91. suggestions:
  92. command: |
  93. git log --pretty='format:%s' | \
  94. rg '^\S+\((.*?)\)' -or '$1' | \
  95. cat -n | \
  96. sort -uk2 | \
  97. sort -n | \
  98. cut -f2-
  99. - type: "input"
  100. title: "Breaking Change (`no`, `yes`, or custom description)"
  101. key: "Breaking"
  102. initialValue: "no"
  103. suggestions:
  104. command: "echo yes"
  105. - type: "input"
  106. key: "Subject"
  107. # Did you know? The preference for the imperative mood is included in the Pro Git book!
  108. # https://git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project
  109. title: "Description (<= 50 characters, in imperative mood)"
  110. - type: "confirm"
  111. title: "Confirm"
  112. body: |
  113. {{.Form.Type}}: {{.Form.Subject}}
  114. Scope: {{.Form.Scope}}
  115. Breaking Change: {{.Form.Breaking}}
  116. - key: "<c-r>"
  117. context: "commits"
  118. description: "Set commit dates to author dates"
  119. command: git rebase "{{ .SelectedCommit.Sha }}^" --committer-date-is-author-date
  120. prompts:
  121. - type: "confirm"
  122. title: "Set commit dates to author dates"
  123. body: "Are you sure you want to set commit dates equal to author dates?"
  124. - key: "<c-a>"
  125. context: "commits"
  126. description: "Modify author date and commit date"
  127. command: /usr/bin/env python3 $DOTFILES_DIR/.scripts/lazygit_modify_commit_date.py commit "{{.SelectedLocalCommit.Sha}}" "{{.Form.Commit}}" "{{.Form.Timestamp}}"
  128. prompts:
  129. - type: "menu"
  130. title: "Commit"
  131. key: "Commit"
  132. options:
  133. - name: "Selected"
  134. description: "The selected commit"
  135. value: "selected"
  136. - name: "Following"
  137. description: "Selected and subsequent commits"
  138. value: "following"
  139. - type: "menuFromCommand"
  140. title: "Select Timestamp"
  141. key: "InitialValue"
  142. command: |
  143. bash -c "\
  144. date \"+%Y-%m-%d %H:%M:%S %z\";
  145. date \"+%Y-%m-%d %H:00:00 %z\";
  146. date \"+%Y-%m-%d 00:00:00 %z\";
  147. date \"+%Y-%m-01 00:00:00 +0000\";
  148. git log --pretty=format:%ad --date=iso | uniq | head -1;
  149. echo \"- Past author dates:\";
  150. git log --pretty=format:%ad --date=iso | uniq | head -5;
  151. echo \"- Dummy timestamps:\";
  152. echo 2005-04-07 15:13:13 -0700;
  153. echo 0000-00-00 00:00:00 +0000;"
  154. - type: "input"
  155. title: "Edit Timestamp"
  156. key: "Timestamp"
  157. initialValue: "{{.Form.InitialValue}}"
  158. - type: "confirm"
  159. title: "Confirm"
  160. body: |
  161. Set author and commit dates for {{.Form.Commit}} commit "{{.SelectedLocalCommit.Name}}" ({{.SelectedLocalCommit.Sha}}) to "{{.Form.Timestamp}}"?'
  162. - key: "<c-d>"
  163. context: "localBranches"
  164. description: "Clean up a local merged branch"
  165. command: git branch -D {{ .Form.Branch }}
  166. prompts:
  167. - type: "menuFromCommand"
  168. title: "Select Local Branch"
  169. key: "Branch"
  170. command: /usr/bin/env zsh -c "/bin/zsh $DOTFILES_DIR/.scripts/lazygit_branch_pruner.zsh print"
  171. filter: '^(\S+)( .*)$'
  172. valueFormat: '{{ .group_1 }}'
  173. labelFormat: '{{ .group_1 }}{{ .group_2 }}'
  174. - key: "<c-x>"
  175. context: "localBranches"
  176. description: "Clean up all local merged branches after pruning"
  177. command: /usr/bin/env zsh -c "/bin/zsh $DOTFILES_DIR/.scripts/lazygit_branch_pruner.zsh {{ .Form.Confirmation }} true"
  178. prompts:
  179. - type: "menuFromCommand"
  180. title: "Review Branches to be Nuked"
  181. key: "Confirmation"
  182. command: /usr/bin/env zsh -c "/bin/zsh $DOTFILES_DIR/.scripts/lazygit_branch_pruner.zsh print true && echo nuke"