Startup fixes and add cmp-tabnine

This commit is contained in:
Tyler Hallada 2023-01-06 21:04:31 -05:00
parent af83a14dc1
commit 26446abf36
4 changed files with 34 additions and 7 deletions

View File

@ -312,6 +312,14 @@ return require('packer').startup(function(use)
require('plugins.rust-tools-nvim') require('plugins.rust-tools-nvim')
end, end,
} }
use {
'tzachar/cmp-tabnine',
run = './install.sh',
requires = 'hrsh7th/nvim-cmp',
config = function()
require('plugins.cmp-tabnine')
end,
}
use 'ziglang/zig.vim' use 'ziglang/zig.vim'
use { use {
'akinsho/bufferline.nvim', 'akinsho/bufferline.nvim',

View File

@ -0,0 +1,15 @@
local tabnine = require('cmp_tabnine.config')
tabnine:setup({
max_lines = 1000,
max_num_results = 20,
sort = true,
run_on_every_keystroke = true,
snippet_placeholder = '..',
ignored_file_types = {
-- default is not to ignore
-- uncomment to ignore in lua:
-- lua = true
},
show_prediction_strength = true
})

View File

@ -1,4 +1,4 @@
require('mason-lspconfig').setup({ require('mason-lspconfig').setup({
ensure_installed = { 'sumneko_lua', 'rust_analyzer', 'bashls', 'cssls', 'html', 'jsonls', 'marskman', 'sqls', 'taplo'}, ensure_installed = { 'sumneko_lua', 'rust_analyzer', 'bashls', 'cssls', 'html', 'jsonls', 'sqls', 'taplo'},
automatic_installation = true, automatic_installation = true,
}) })

View File

@ -48,6 +48,11 @@ cmp.setup({
priority = 100, priority = 100,
group_index = 1, group_index = 1,
}, },
{
name = 'cmp_tabnine',
priority = 90,
group_index = 2,
},
{ {
name = 'buffer', name = 'buffer',
priority = 80, priority = 80,
@ -105,8 +110,7 @@ cmp.setup.cmdline(':', {
}) })
-- Add additional capabilities supported by nvim-cmp -- Add additional capabilities supported by nvim-cmp
local capabilities = vim.lsp.protocol.make_client_capabilities() local capabilities = require('cmp_nvim_lsp').default_capabilities()
capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities)
local lspconfig = require("lspconfig") local lspconfig = require("lspconfig")