Public Access
lsp refactor
This commit is contained in:
+26
-26
@@ -15,32 +15,32 @@ vim.keymap.set("n", "k", "gk", { noremap = true, silent = true })
|
||||
vim.keymap.set("v", "j", "gj", { noremap = true, silent = true })
|
||||
vim.keymap.set("v", "k", "gk", { noremap = true, silent = true })
|
||||
|
||||
-- Spellchecker
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
callback = function()
|
||||
local buftype = vim.api.nvim_buf_get_option(0, "buftype")
|
||||
local filetype = vim.api.nvim_buf_get_option(0, "filetype")
|
||||
|
||||
local skip_buftypes = { "nofile", "prompt", "terminal" }
|
||||
local skip_filetypes = { "cmp_menu", "cmp_doc", "TelescopePrompt", "NvimTree" }
|
||||
|
||||
-- If current buffer is in skip list, do nothing
|
||||
for _, bt in ipairs(skip_buftypes) do
|
||||
if buftype == bt then
|
||||
return
|
||||
end
|
||||
end
|
||||
for _, ft in ipairs(skip_filetypes) do
|
||||
if filetype == ft then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
-- Else, enable spellcheck
|
||||
vim.opt_local.spell = true
|
||||
vim.opt_local.spelllang = "en"
|
||||
end,
|
||||
})
|
||||
-- -- Spellchecker
|
||||
-- vim.api.nvim_create_autocmd("FileType", {
|
||||
-- callback = function()
|
||||
-- local buftype = vim.api.nvim_buf_get_option(0, "buftype")
|
||||
-- local filetype = vim.api.nvim_buf_get_option(0, "filetype")
|
||||
--
|
||||
-- local skip_buftypes = { "nofile", "prompt", "terminal" }
|
||||
-- local skip_filetypes = { "cmp_menu", "cmp_doc", "TelescopePrompt", "NvimTree" }
|
||||
--
|
||||
-- -- If current buffer is in skip list, do nothing
|
||||
-- for _, bt in ipairs(skip_buftypes) do
|
||||
-- if buftype == bt then
|
||||
-- return
|
||||
-- end
|
||||
-- end
|
||||
-- for _, ft in ipairs(skip_filetypes) do
|
||||
-- if filetype == ft then
|
||||
-- return
|
||||
-- end
|
||||
-- end
|
||||
--
|
||||
-- -- Else, enable spellcheck
|
||||
-- vim.opt_local.spell = true
|
||||
-- vim.opt_local.spelllang = "en"
|
||||
-- end,
|
||||
-- })
|
||||
|
||||
-- Toggle spell check with <leader>sc
|
||||
vim.keymap.set("n", "<leader>sc", function()
|
||||
|
||||
Reference in New Issue
Block a user