Update config/nvim/init.lua
This commit is contained in:
parent
b4a57204ea
commit
14b2c19ebc
@ -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'} }}
|
||||||
|
|
||||||
|
use ({"williamboman/mason.nvim"})
|
||||||
|
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
|
||||||
|
},
|
||||||
|
|
||||||
highlight = {
|
}
|
||||||
enable = true,
|
end
|
||||||
|
}
|
||||||
|
use { 'saadparwaiz1/cmp_luasnip' }
|
||||||
|
|
||||||
-- Or use a function for more flexibility, e.g. to disable slow treesitter highlight for large files
|
-- Automatically set up your configuration after cloning packer.nvim
|
||||||
disable = function(lang, buf)
|
-- Put this at the end after all plugins
|
||||||
local max_filesize = 100 * 1024 -- 100 KB
|
if packer_bootstrap then
|
||||||
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
|
require('packer').sync()
|
||||||
if ok and stats and stats.size > max_filesize then
|
end
|
||||||
return true
|
end)
|
||||||
end
|
|
||||||
end,
|
|
||||||
|
|
||||||
-- 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,
|
|
||||||
},
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user