Skip to content
This repository was archived by the owner on Oct 13, 2021. It is now read-only.

Commit a77458f

Browse files
committed
feat: add disable filetype
1 parent 8aecb23 commit a77458f

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

lua/completion.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,13 @@ end
204204
M.on_attach = function(option)
205205
-- setup completion_option tables
206206
opt.set_option_table(option)
207+
local disable_filetypes = opt.get_option("disable_filetypes")
208+
local ft = vim.bo.filetype
209+
for _, disable_ft in ipairs(disable_filetypes) do
210+
if ft == disable_ft then
211+
return
212+
end
213+
end
207214
-- setup autocommand
208215
-- TODO: Modified this if lua callbacks for autocmd is merged
209216
api.nvim_command("augroup CompletionCommand")

plugin/completion.vim

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ if ! exists('g:completion_matching_ignore_case')
8585
let g:completion_matching_ignore_case = 0
8686
endif
8787

88+
if ! exists('g:completion_disable_filetypes')
89+
let g:completion_disable_filetypes = []
90+
endif
91+
8892
if ! exists('g:completion_matching_strategy_list')
8993
let g:completion_matching_strategy_list = ['exact']
9094
endif

0 commit comments

Comments
 (0)