Skip to content

Commit

Permalink
Disable coc-nav in HTML files
Browse files Browse the repository at this point in the history
Workaround for neoclide/coc-html#57
  • Loading branch information
samhed committed Jan 8, 2024
1 parent becc9db commit 0217217
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions config/nvim/lua/setup/coc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -272,4 +272,19 @@ return function ()
pattern = "CocStatusChange",
callback = function() StatusNotify() end,
})

-- Workaround for https://github.com/neoclide/coc-html/issues/57 --
api.nvim_create_augroup("CocNavToggle", { clear = true })
api.nvim_create_autocmd("BufEnter", {
group = "CocNavToggle",
pattern = "*.html",
command = "call CocActionAsync('deactivateExtension', 'coc-nav')",
desc = "Turn off coc-nav for html"
})
api.nvim_create_autocmd("BufLeave", {
group = "CocNavToggle",
pattern = "*.html",
command = "call CocActionAsync('activeExtension', 'coc-nav')",
desc = "Turn on coc-nav for other files"
})
end

0 comments on commit 0217217

Please sign in to comment.