1
0
Fork 0

set up and disable tabnine

This commit is contained in:
Luca Bilke 2024-03-06 15:34:12 +01:00
parent 285e208952
commit 6b11c3e946
4 changed files with 48 additions and 19 deletions

View file

@ -64,6 +64,7 @@ M.opts = function()
completion = cmp.config.window.bordered(border_opts),
documentation = cmp.config.window.bordered(border_opts),
},
-- TODO: Move to config.keymaps
mapping = {
["<Up>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Select }),
["<Down>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Select }),

View file

@ -25,4 +25,5 @@ return {
require("plugins.misc.ufo"),
require("plugins.misc.vimtex"),
require("plugins.misc.which-key"),
-- require("plugins.misc.tabnine"),
}

View file

@ -17,17 +17,17 @@ M.opts = function()
end,
}
local function search_result()
if vim.v.hlsearch == 0 then
return ""
end
local last_search = vim.fn.getreg("/")
if not last_search or last_search == "" then
return ""
end
local searchcount = vim.fn.searchcount({ maxcount = 9999 })
return last_search .. "(" .. searchcount.current .. "/" .. searchcount.total .. ")"
end
-- local function search_result()
-- if vim.v.hlsearch == 0 then
-- return ""
-- end
-- local last_search = vim.fn.getreg("/")
-- if not last_search or last_search == "" then
-- return ""
-- end
-- local searchcount = vim.fn.searchcount({ maxcount = 9999 })
-- return last_search .. "(" .. searchcount.current .. "/" .. searchcount.total .. ")"
-- end
local config = {
options = {
@ -82,8 +82,8 @@ M.opts = function()
S = colors.orange,
[string.char(19)] = colors.orange,
ic = colors.yellow,
R = colors.violet,
Rv = colors.violet,
R = colors.purple,
Rv = colors.purple,
cv = colors.red,
ce = colors.red,
r = colors.cyan,
@ -150,11 +150,16 @@ M.opts = function()
-- color = { fg = colors.yellow }
-- }
ins_right({
search_result,
color = { fg = colors.white },
padding = { left = 1 },
})
-- ins_right({
-- search_result,
-- color = { fg = colors.fg },
-- padding = { left = 1 },
-- })
-- ins_right({
-- 'tabnine',
-- color = { fg = colors.green1, gui = "bold" },
-- })
ins_right({
function()
@ -172,7 +177,7 @@ M.opts = function()
end
return msg:sub(3)
end,
color = { fg = colors.blue, gui = "bold" },
color = { fg = colors.green2, gui = "bold" },
})
ins_right({

View file

@ -0,0 +1,22 @@
local M = { "codota/tabnine-nvim" }
M.build = "./dl_binaries.sh"
M.event = { "BufReadPost", "BufNewFile", "BufNew" }
M.main = "tabnine"
M.opts = function()
local colors = require("tokyonight.colors").setup({ transform = true })
return {
disable_auto_comment = true,
accept_keymap = "<Tab>",
dismiss_keymap = "<C-]>",
debounce_ms = 800,
suggestion_color = { gui = colors.fg_gutter, cterm = 244 },
exclude_filetypes = { "TelescopePrompt", "NvimTree" },
log_file_path = nil, -- absolute path to Tabnine log file
}
end
return M