nvim/lua/code-completion.lua

33 lines
1.2 KiB
Lua

-- menuone: show also for just one code suggestion
-- noinsert: only insert text when selection confirmed
-- noselect: force to select from suggestion
-- preview: show more details
vim.opt.completeopt = { "menu", "menuone" }
vim.g.easycomplete_cursor_word_hl = 1
vim.g.easycomplete_nerd_font = 1
-- Bind reference and navigation options (using f as primary)
vim.keymap.set("n", "fr", ":EasyCompleteReference<CR>")
vim.keymap.set("n", "fd", ":EasyCompleteGotoDefinition<CR>")
vim.keymap.set("n", "fn", ":EasyCompleteRename<CR>")
vim.keymap.set("n", "fb", ":BackToOriginalBuffer<CR>")
vim.g.easycomplete_pum_format = { "kind", "abbr", "menu" }
vim.cmd([[
hi EasyFuzzyMatch guifg=lightblue
]])
vim.g.easycomplete_directory_enable = 1
vim.g.easycomplete_tab_trigger = "<c-j>"
vim.g.easycomplete_shift_tab_trigger = "<c-k>"
-- Diagnostics
vim.g.easycomplete_diagnostics_next = "<c-n>"
vim.g.easycomplete_diagnostics_prev = "<c-p>"
vim.g.easycomplete_signature_offset = 0
vim.g.easycomplete_diagnostics_enable = 1
vim.g.easycomplete_signature_enable = 1
vim.g.easycomplete_diagnostics_hover = 1
vim.g.easycomplete_lsp_checking = 0 -- suppress warning on startup, must run LSPInstall manually