Replace vim-plug with lazy-nvim

This commit is contained in:
Adam Cooper 2023-10-27 08:28:25 -04:00
parent aacc322e34
commit bae8cdc462

View file

@ -48,43 +48,56 @@ vim.api.nvim_set_keymap("t", "<c-k>", "<c-\\><c-n><c-w>k", { noremap = true })
vim.api.nvim_set_keymap("t", "<c-h>", "<c-\\><c-n><c-w>h", { noremap = true })
vim.api.nvim_set_keymap("t", "<c-l>", "<c-\\><c-n><c-w>l", { noremap = true })
-- vim-plug
vim.cmd([[
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.config/local/share/nvim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
vim.keymap.set({"i", "n", "t", "v"}, "<F10>", function () vim.cmd("nohlsearch") end)
function! Cond(cond, ...)
let opts = get(a:000, 0, {})
return a:cond ? extend(opts, { 'on': [], 'for': [] })
endfunction
-- lazy.nvim
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)
call plug#begin('~/.config/nvim/plugged')
Plug 'williamboman/mason.nvim'
Plug 'williamboman/mason-lspconfig.nvim'
Plug 'neovim/nvim-lspconfig'
Plug 'nvimdev/lspsaga.nvim'
Plug 'nvim-lualine/lualine.nvim'
Plug 'nvim-tree/nvim-web-devicons'
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim', { 'branch': '0.1.x' }
Plug 'nvim-treesitter/nvim-treesitter', { 'do': ':TSUpdate' }
Plug 'neovim/nvim-lspconfig'
Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'hrsh7th/cmp-buffer'
Plug 'hrsh7th/cmp-path'
Plug 'hrsh7th/cmp-cmdline'
Plug 'hrsh7th/nvim-cmp'
Plug 'hrsh7th/cmp-vsnip'
Plug 'hrsh7th/vim-vsnip'
Plug 'tpope/vim-fugitive'
Plug 'lewis6991/gitsigns.nvim'
Plug 'dracula/vim', { 'as': 'dracula' }
Plug 'tpope/vim-surround'
call plug#end()
]])
require("lazy").setup({
{
"dracula/vim",
name = "dracula",
lazy = false,
priority = 1000,
config = function ()
vim.cmd([[colorscheme dracula]])
end,
},
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim",
"neovim/nvim-lspconfig",
"nvimdev/lspsaga.nvim",
"nvim-lualine/lualine.nvim",
"nvim-tree/nvim-web-devicons",
"nvim-lua/plenary.nvim",
{ "nvim-telescope/telescope.nvim", branch = "0.1.x" },
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
},
"neovim/nvim-lspconfig",
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"hrsh7th/cmp-cmdline",
"hrsh7th/nvim-cmp",
"hrsh7th/cmp-vsnip",
"hrsh7th/vim-vsnip",
"tpope/vim-fugitive",
"lewis6991/gitsigns.nvim",
"tpope/vim-surround",
})
require('mason').setup()
require('mason-lspconfig').setup()
@ -94,7 +107,7 @@ require('lualine').setup {
tabline = {
lualine_a = { 'buffers' },
}
}
}
local builtin = require('telescope.builtin')
vim.keymap.set('n', '<leader>ff', builtin.find_files, {})