Update config/nvim/init.lua

This commit is contained in:
Matthew Fisher 2024-08-21 18:09:56 -05:00
parent b4a57204ea
commit 14b2c19ebc

View File

@ -1,36 +1,54 @@
require("plugins") local ensure_packer = function()
local fn = vim.fn
local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
if fn.empty(fn.glob(install_path)) > 0 then
fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path})
vim.cmd [[packadd packer.nvim]]
return true
end
return false
end
require'nvim-treesitter.configs'.setup { require('config')
-- A list of parser names, or "all" (the listed parsers MUST always be installed) require('plugins')
ensure_installed = { "c", "lua", "vim", "vimdoc", "query", "markdown", "markdown_inline" }, local packer_bootstrap = ensure_packer()
-- Install parsers synchronously (only applied to `ensure_installed`) vim.opt.clipboard = 'unnamed'
sync_install = false,
-- Automatically install missing parsers when entering buffer return require('packer').startup(function(use)
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally use 'wbthomason/packer.nvim'
auto_install = true,
-- List of parsers to ignore installing (or "all") -- TreeSitter
ignore_install = { "javascript" }, use ('nvim-treesitter/nvim-treesitter', { run = ":TSUpdate"})
use {'nvim-telescope/telescope.nvim', tag = '0.1.8', requires = { {'nvim-lua/plenary.nvim'} }}
highlight = { use ({"williamboman/mason.nvim"})
enable = true, use ({"williamboman/mason-lspconfig.nvim"})
use ({'VonHeikemen/lsp-zero.nvim', branch = 'v4.x'})
use ({'neovim/nvim-lspconfig'})
use ({'hrsh7th/nvim-cmp'})
use ({'hrsh7th/cmp-nvim-lsp'})
use ({"L3MON4D3/LuaSnip"})
use ({"rafamadriz/friendly-snippets"})
use {
'hrsh7th/nvim-cmp',
config = function ()
require'cmp'.setup {
snippet = {
expand = function(args)
require'luasnip'.lsp_expand(args.body)
end
},
-- Or use a function for more flexibility, e.g. to disable slow treesitter highlight for large files }
disable = function(lang, buf) end
local max_filesize = 100 * 1024 -- 100 KB }
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf)) use { 'saadparwaiz1/cmp_luasnip' }
if ok and stats and stats.size > max_filesize then
return true
end
end,
-- Setting this to true will run `:h syntax` and tree-sitter at the same time. -- Automatically set up your configuration after cloning packer.nvim
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). -- Put this at the end after all plugins
-- Using this option may slow down your editor, and you may see some duplicate highlights. if packer_bootstrap then
-- Instead of true it can also be a list of languages require('packer').sync()
additional_vim_regex_highlighting = false, end
}, end)
}