Skip to content

Commit

Permalink
Add lazy and remove packer
Browse files Browse the repository at this point in the history
  • Loading branch information
cpow committed Mar 9, 2023
1 parent e302201 commit 19e8a9c
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 52 deletions.
10 changes: 6 additions & 4 deletions lua/core/plugin_config/lsp_config.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
require("mason-lspconfig").setup({
ensure_installed = { "sumneko_lua", "solargraph" }
})
require("mason-lspconfig").setup()

local capabilities = require('cmp_nvim_lsp').default_capabilities(vim.lsp.protocol.make_client_capabilities())

Expand All @@ -20,7 +18,7 @@ vim.keymap.set('n', 'K', '<Cmd>Lspsaga hover_doc<cr>', { silent = true })
vim.keymap.set({"n","v"}, "<leader>ca", "<cmd>Lspsaga code_action<CR>", { silent = true })
vim.keymap.set("n", "<leader>rn", "<cmd>Lspsaga rename<CR>", { silent = true })

require("lspconfig").sumneko_lua.setup {
require("lspconfig").lua_ls.setup {
capabilities = capabilities,
settings = {
Lua = {
Expand All @@ -40,3 +38,7 @@ require("lspconfig").sumneko_lua.setup {
require("lspconfig").solargraph.setup {
capabilities = capabilities,
}

require("lspconfig").pyright.setup {
capabilities = capabilities,
}
92 changes: 44 additions & 48 deletions lua/core/plugins.lua
Original file line number Diff line number Diff line change
@@ -1,55 +1,51 @@
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
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)

local packer_bootstrap = ensure_packer()

return require('packer').startup(function(use)
use 'wbthomason/packer.nvim'
use 'ellisonleao/gruvbox.nvim'
use 'dracula/vim'
use 'nvim-tree/nvim-tree.lua'
use 'nvim-tree/nvim-web-devicons'
use 'nvim-lualine/lualine.nvim'
use 'nvim-treesitter/nvim-treesitter'
use 'bluz71/vim-nightfly-colors'
use 'vim-test/vim-test'
use 'lewis6991/gitsigns.nvim'
use 'preservim/vimux'
use 'christoomey/vim-tmux-navigator'
use 'tpope/vim-fugitive'
local plugins = {
'wbthomason/packer.nvim',
'ellisonleao/gruvbox.nvim',
{
'dracula/vim',
lazy = false,
},
'nvim-tree/nvim-tree.lua',
'nvim-tree/nvim-web-devicons',
'nvim-lualine/lualine.nvim',
'nvim-treesitter/nvim-treesitter',
'bluz71/vim-nightfly-colors',
'vim-test/vim-test',
'lewis6991/gitsigns.nvim',
'preservim/vimux',
'christoomey/vim-tmux-navigator',
'tpope/vim-fugitive',
-- completion
use 'hrsh7th/nvim-cmp'
use 'hrsh7th/cmp-nvim-lsp'
use 'L3MON4D3/LuaSnip'
use 'saadparwaiz1/cmp_luasnip'
use "rafamadriz/friendly-snippets"

use "github/copilot.vim"

use {
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim",
"neovim/nvim-lspconfig",
"glepnir/lspsaga.nvim",
}

use {
'hrsh7th/nvim-cmp',
'hrsh7th/cmp-nvim-lsp',
'L3MON4D3/LuaSnip',
'saadparwaiz1/cmp_luasnip',
"rafamadriz/friendly-snippets",
"github/copilot.vim",
"williamboman/mason.nvim",
"neovim/nvim-lspconfig",
"williamboman/mason-lspconfig.nvim",
"glepnir/lspsaga.nvim",
{
'nvim-telescope/telescope.nvim',
tag = '0.1.0',
requires = { {'nvim-lua/plenary.nvim'} }
dependencies = { {'nvim-lua/plenary.nvim'} }
}
}

local opts = {}

-- Automatically set up your configuration after cloning packer.nvim
-- Put this at the end after all plugins
if packer_bootstrap then
require('packer').sync()
end
end)
require("lazy").setup(plugins, opts)

0 comments on commit 19e8a9c

Please sign in to comment.