Skip to content

Commit

Permalink
fix(nvim): disable diagnostics on .env files
Browse files Browse the repository at this point in the history
  • Loading branch information
minusfive committed Oct 2, 2024
1 parent 6447adf commit 1ea64c3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
9 changes: 9 additions & 0 deletions .config/nvim/lua/config/autocmds.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,12 @@ vim.diagnostic.open_float = (function(original_fn)
return original_fn(opts)
end
end)(vim.diagnostic.open_float)

-- Disable diagnostics on .env files
vim.api.nvim_create_autocmd("BufReadPost", {
pattern = { "*.env", "*.env.*" },
desc = "Disable diagnostics on .env files",
callback = function(ev)
vim.diagnostic.enable(false, { bufnr = ev.buf })
end,
})
6 changes: 0 additions & 6 deletions .config/nvim/lua/config/options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,7 @@ vim.g.minipairs_disable = true

-- additional filetypes
vim.filetype.add({
extension = {
env = "conf",
},
filename = {
Brewfile = "ruby",
},
pattern = {
["%.env%.[%w_.-]+"] = "conf",
},
})

0 comments on commit 1ea64c3

Please sign in to comment.