0
0

config.yml 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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. git:
  13. overrideGpg: true
  14. commit:
  15. autoWrapCommitMessage: true
  16. autoWrapWidth: 72
  17. os:
  18. edit: "floaterm {{filename}}"
  19. editInTerminal: false
  20. refresher:
  21. refreshInterval: 2
  22. customCommands:
  23. - key: "<c-c>"
  24. context: "files"
  25. description: "Create a conventional commit"
  26. command: |
  27. git commit --allow-empty \
  28. -m "$(python3 -c "from sys import argv; output = argv[1]; output += ('(' + argv[2].lower().replace(' ', '-') + ')' if len(argv[2]) > 0 else ''); output += ('' if len(argv[3]) <= 0 or argv[3].lower() == 'no' else '!'); output += ': ' + argv[4]; print(output);" "{{.Form.Type}}" "{{.Form.Scope}}" "{{.Form.Breaking}}" "{{.Form.Subject}}" )" \
  29. -m "$(python3 -c "from sys import argv; print('BREAKING CHANGE: ' + argv[-1] if len(argv[-1]) > 0 and argv[-1].lower() not in ['no', 'yes'] else '');" "{{.Form.Breaking}}")"
  30. prompts:
  31. - type: "menu"
  32. key: "Type"
  33. title: "Type"
  34. options:
  35. - name: "feat"
  36. description: "A new feature"
  37. value: "feat"
  38. - name: "fix"
  39. description: "A bug fix"
  40. value: "fix"
  41. - name: "test"
  42. description: "Adding missing tests or correcting existing tests"
  43. value: "test"
  44. - name: "chore"
  45. description:
  46. "Changes that do not modify the source code or test files"
  47. value: "chore"
  48. - name: " "
  49. description: ""
  50. value: "chore" # This line is just here for aesthetics, but should still have a valid value
  51. - name: "build"
  52. description:
  53. "Changes that affect the build system or external dependencies"
  54. value: "build"
  55. - name: "ci"
  56. description: "Changes to CI configuration files and scripts"
  57. value: "ci"
  58. - name: "docs"
  59. description: "Documentation changes"
  60. value: "docs"
  61. - name: "perf"
  62. description: "A code change that improves performance"
  63. value: "perf"
  64. - name: "refactor"
  65. description:
  66. "A code change that neither fixes a bug nor adds a feature"
  67. value: "refactor"
  68. - name: "revert"
  69. description: "Reverts a previous commit"
  70. value: "revert"
  71. - name: "style"
  72. description: "Changes that do not affect the meaning of the code"
  73. value: "style"
  74. - type: "input"
  75. key: "Scope"
  76. title: "Scope (optional)"
  77. suggestions:
  78. command: |
  79. git log --pretty='format:%s' | \
  80. rg '^\S+\((.*?)\)' -or '$1' | \
  81. cat -n | \
  82. sort -uk2 | \
  83. sort -n | \
  84. cut -f2-
  85. - type: "input"
  86. title: "Breaking Change (`no`, `yes`, or custom description)"
  87. key: "Breaking"
  88. initialValue: "no"
  89. suggestions:
  90. command: "echo yes"
  91. - type: "input"
  92. key: "Subject"
  93. # Did you know? The preference for the imperative mood is included in the Pro Git book!
  94. # https://git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project
  95. title: "Description (<= 50 characters, in imperative mood)"
  96. - type: "confirm"
  97. title: "Confirm"
  98. body: |
  99. {{.Form.Type}}: {{.Form.Subject}}
  100. Scope: {{.Form.Scope}}
  101. Breaking Change: {{.Form.Breaking}}
  102. - key: "<c-a>"
  103. context: "commits"
  104. description: "Modify author date and commit date"
  105. command: |
  106. export GIT_SEQUENCE_EDITOR="python3 -c \"from sys import argv; from re import sub, MULTILINE; path = argv[-1]; file = open(path, 'r'); content = sub('^pick ', 'edit ', file.read(), 1, flags=MULTILINE); file.close(); file = open(path, 'w'); file.write(content); file.close();\"";
  107. git rebase --interactive --autostash --keep-empty --no-autosquash --rebase-merges {{.SelectedLocalCommit.Sha}}~;
  108. export GIT_COMMITTER_DATE="{{.Form.Timestamp}}";
  109. git commit --allow-empty --only --no-edit --amend --date="{{.Form.Timestamp}}";
  110. git rebase --continue
  111. prompts:
  112. - type: "menuFromCommand"
  113. title: "Select Timestamp"
  114. key: "InitialValue"
  115. command: |
  116. bash -c "date \"+%Y-%m-%d %H:%M:%S %z\";
  117. git log --pretty=format:%ad --date=iso | uniq | head -7;
  118. echo;
  119. echo 2005-04-07 15:13:13 -0700;
  120. echo 0000-00-00 00:00:00 +0000;"
  121. - type: "input"
  122. title: "Edit Timestamp"
  123. key: "Timestamp"
  124. initialValue: "{{.Form.InitialValue}}"
  125. - type: "confirm"
  126. title: "Confirm"
  127. body: |
  128. Set author and commit dates for commit "{{.SelectedLocalCommit.Name}}" ({{.SelectedLocalCommit.Sha}}) to "{{.Form.Timestamp}}"?'