Update init.lua

added path and buffer suggestions
This commit is contained in:
Patryk Koreń
2024-04-09 20:34:50 +02:00
committed by GitHub
parent ea9f53e245
commit c97782eab3

View File

@@ -28,19 +28,24 @@ end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
{ "ellisonleao/gruvbox.nvim", priority = 1000 , config = true, opts = ...},
{'mg979/vim-visual-multi'},
{'williamboman/mason.nvim'},
{'williamboman/mason-lspconfig.nvim'},
{'VonHeikemen/lsp-zero.nvim', branch = 'v3.x'},
{'neovim/nvim-lspconfig'},
{'hrsh7th/cmp-nvim-lsp'},
{'hrsh7th/nvim-cmp'},
{'L3MON4D3/LuaSnip'},
{'nvim-treesitter/nvim-treesitter'},
{'mbbill/undotree'},
{'nvim-telescope/telescope.nvim', branch = '0.1.x',
dependencies = { 'nvim-lua/plenary.nvim' }},
{ "ellisonleao/gruvbox.nvim", priority = 1000, config = true, opts = ... },
{ 'mg979/vim-visual-multi' },
{ 'williamboman/mason.nvim' },
{ 'williamboman/mason-lspconfig.nvim' },
{ 'VonHeikemen/lsp-zero.nvim', branch = 'v3.x' },
{ 'neovim/nvim-lspconfig' },
{ 'hrsh7th/cmp-nvim-lsp' },
{ 'hrsh7th/cmp-buffer' },
{ 'hrsh7th/nvim-cmp' },
{ 'hrsh7th/cmp-path' },
{ 'L3MON4D3/LuaSnip' },
{ 'nvim-treesitter/nvim-treesitter' },
{ 'mbbill/undotree' },
{
'nvim-telescope/telescope.nvim',
branch = '0.1.x',
dependencies = { 'nvim-lua/plenary.nvim' }
},
{
"iamcco/markdown-preview.nvim",
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
@@ -55,10 +60,12 @@ vim.cmd([[colorscheme gruvbox]])
local lsp_zero = require('lsp-zero')
lsp_zero.preset('recommended')
lsp_zero.on_attach(function(client, bufnr)
lsp_zero.default_keymaps({buffer = bufnr})
lsp_zero.default_keymaps({ buffer = bufnr })
end)
lsp_zero.setup()
require('mason').setup({})
require('mason-lspconfig').setup({
ensure_installed = {},
handlers = {
@@ -66,10 +73,23 @@ require('mason-lspconfig').setup({
},
})
require'nvim-treesitter.configs'.setup {
local cmp = require('cmp')
local cmp_format = lsp_zero.cmp_format({ details = true })
cmp.setup({
sources = {
{ name = 'nvim_lsp' },
{ name = 'luasnip' },
{ name = 'buffer' },
{ name = 'path' },
},
--- (Optional) Show source name in completion menu
formatting = cmp_format,
})
require 'nvim-treesitter.configs'.setup {
-- A list of parser names, or "all"
ensure_installed = { "javascript", "typescript", "c", "lua", "rust", "python",
"gdscript", "html", "css", "sql", "markdown" },
"gdscript", "html", "css", "sql", "markdown", "org" },
-- Install parsers synchronously (only applied to `ensure_installed`)
sync_install = false,