Skip to content

Commit

Permalink
✨ use project local spell file if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
ianhomer committed Oct 14, 2024
1 parent 1a39615 commit 463cf91
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions dotfiles/nvim/.config/nvim/lua/config/autocmds.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,15 @@ vim.api.nvim_create_autocmd({ "FileType" }, {
-- l don't break long lines (once they'r long)
vim.opt_local.formatoptions = "jcqln"
vim.opt_local.formatexpr = ""

-- Use project local spellfile if it exists
local dot_git_path = vim.fn.finddir(".git", ".;")
if vim.fn.isdirectory(dot_git_path) ~= 0 then
local project_spelling_file = vim.fn.fnamemodify(dot_git_path, ":h") .. "/.vim/local.utf-8.add"
if vim.fn.filereadable(project_spelling_file) ~= 0 then
local spelling_files = project_spelling_file
vim.opt_local.spellfile = spelling_files
end
end
end,
})

0 comments on commit 463cf91

Please sign in to comment.