Startup fixes and add cmp-tabnine
This commit is contained in:
parent
4a4a4a74c6
commit
1e36116761
@ -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',
|
||||||
|
15
lua/plugins/cmp-tabnine.lua
Normal file
15
lua/plugins/cmp-tabnine.lua
Normal 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
|
||||||
|
})
|
@ -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,
|
||||||
})
|
})
|
||||||
|
@ -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,18 +110,17 @@ 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")
|
||||||
|
|
||||||
-- Enable some language servers with the additional completion capabilities offered by nvim-cmp
|
-- Enable some language servers with the additional completion capabilities offered by nvim-cmp
|
||||||
local servers = { 'pyright', 'tsserver', 'html', 'cssls' }
|
local servers = { 'pyright', 'tsserver', 'html', 'cssls' }
|
||||||
for _, lsp in ipairs(servers) do
|
for _, lsp in ipairs(servers) do
|
||||||
lspconfig[lsp].setup({
|
lspconfig[lsp].setup({
|
||||||
-- on_attach = my_custom_on_attach,
|
-- on_attach = my_custom_on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
Loading…
Reference in New Issue
Block a user