Skip to content

Commit

Permalink
feat(commitMsg): spellcheck of commit msg (opt-in)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisgrieser committed Oct 27, 2023
1 parent 4da8fe9 commit e94f77a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,10 @@ local defaultConfig = {
"style", "revert", "ci", "docs", "break", "improv",
},
},

-- enable vim's builtin spellcheck for the commit message input field
-- (configured to ignore capitalization and correctly consider camelCase)
spellcheck = false,
},
asyncOpConfirmationSound = true, -- currently macOS only
issueIcons = {
Expand Down
7 changes: 7 additions & 0 deletions lua/tinygit/commit-and-amend.lua
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,13 @@ local function setGitCommitAppearance()

-- activate styling of statusline plugins
vim.api.nvim_buf_set_name(0, "COMMIT_EDITMSG")

-- spellcheck
if conf.spellcheck then
vim.opt_local.spell = true
vim.opt_local.spelloptions = "camel"
vim.opt_local.spellcapcheck = ""
end
end,
})
end
Expand Down
11 changes: 6 additions & 5 deletions lua/tinygit/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@ local M = {}
---@field maxLen number
---@field mediumLen number
---@field emptyFillIn string
---@field enforceConvCommits enforceConvCommitsConfig

---@class enforceConvCommitsConfig
---@field enabled boolean
---@field keywords string[]
---@field enforceConvCommits {enabled: boolean, keywords: string[]}
---@field spellcheck boolean

---@class searchFileHistoryConfig
---@field diffPopupWidth number
Expand Down Expand Up @@ -50,6 +47,10 @@ local defaultConfig = {
"style", "revert", "ci", "docs", "break", "improv",
},
},

-- enable vim's builtin spellcheck for the commit message input field.
-- (configured to ignore capitalization and correctly consider camelCase)
spellcheck = false,
},
asyncOpConfirmationSound = true, -- currently macOS only
issueIcons = {
Expand Down

0 comments on commit e94f77a

Please sign in to comment.