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) vim.opt.rtp:prepend(lazypath)
require("lazy").setup({ require("lazy").setup({
{ "ellisonleao/gruvbox.nvim", priority = 1000 , config = true, opts = ...}, { "ellisonleao/gruvbox.nvim", priority = 1000, config = true, opts = ... },
{'mg979/vim-visual-multi'}, { 'mg979/vim-visual-multi' },
{'williamboman/mason.nvim'}, { 'williamboman/mason.nvim' },
{'williamboman/mason-lspconfig.nvim'}, { 'williamboman/mason-lspconfig.nvim' },
{'VonHeikemen/lsp-zero.nvim', branch = 'v3.x'}, { 'VonHeikemen/lsp-zero.nvim', branch = 'v3.x' },
{'neovim/nvim-lspconfig'}, { 'neovim/nvim-lspconfig' },
{'hrsh7th/cmp-nvim-lsp'}, { 'hrsh7th/cmp-nvim-lsp' },
{'hrsh7th/nvim-cmp'}, { 'hrsh7th/cmp-buffer' },
{'L3MON4D3/LuaSnip'}, { 'hrsh7th/nvim-cmp' },
{'nvim-treesitter/nvim-treesitter'}, { 'hrsh7th/cmp-path' },
{'mbbill/undotree'}, { 'L3MON4D3/LuaSnip' },
{'nvim-telescope/telescope.nvim', branch = '0.1.x', { 'nvim-treesitter/nvim-treesitter' },
dependencies = { 'nvim-lua/plenary.nvim' }}, { 'mbbill/undotree' },
{
'nvim-telescope/telescope.nvim',
branch = '0.1.x',
dependencies = { 'nvim-lua/plenary.nvim' }
},
{ {
"iamcco/markdown-preview.nvim", "iamcco/markdown-preview.nvim",
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
@@ -55,39 +60,54 @@ vim.cmd([[colorscheme gruvbox]])
local lsp_zero = require('lsp-zero') local lsp_zero = require('lsp-zero')
lsp_zero.preset('recommended') lsp_zero.preset('recommended')
lsp_zero.on_attach(function(client, bufnr) lsp_zero.on_attach(function(client, bufnr)
lsp_zero.default_keymaps({buffer = bufnr}) lsp_zero.default_keymaps({ buffer = bufnr })
end) end)
lsp_zero.setup() lsp_zero.setup()
require('mason').setup({}) require('mason').setup({})
require('mason-lspconfig').setup({ require('mason-lspconfig').setup({
ensure_installed = {}, ensure_installed = {},
handlers = { handlers = {
lsp_zero.default_setup, lsp_zero.default_setup,
}, },
}) })
require'nvim-treesitter.configs'.setup { local cmp = require('cmp')
-- A list of parser names, or "all" local cmp_format = lsp_zero.cmp_format({ details = true })
ensure_installed = { "javascript", "typescript", "c", "lua", "rust", "python", cmp.setup({
"gdscript", "html", "css", "sql", "markdown" }, sources = {
{ name = 'nvim_lsp' },
{ name = 'luasnip' },
{ name = 'buffer' },
{ name = 'path' },
},
--- (Optional) Show source name in completion menu
formatting = cmp_format,
})
-- Install parsers synchronously (only applied to `ensure_installed`) require 'nvim-treesitter.configs'.setup {
sync_install = false, -- A list of parser names, or "all"
ensure_installed = { "javascript", "typescript", "c", "lua", "rust", "python",
"gdscript", "html", "css", "sql", "markdown", "org" },
-- Automatically install missing parsers when entering buffer -- Install parsers synchronously (only applied to `ensure_installed`)
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally sync_install = false,
auto_install = true,
highlight = { -- Automatically install missing parsers when entering buffer
-- `false` will disable the whole extension -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
enable = true, auto_install = true,
-- Setting this to true will run `:h syntax` and tree-sitter at the same time. highlight = {
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). -- `false` will disable the whole extension
-- Using this option may slow down your editor, and you may see some duplicate highlights. enable = true,
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = false, -- Setting this to true will run `:h syntax` and tree-sitter at the same time.
}, -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = false,
},
} }
local builtin = require('telescope.builtin') local builtin = require('telescope.builtin')