diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 0000000..9470b8d --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,15 @@ +{ + "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, + "harpoon": { "branch": "master", "commit": "1bc17e3e42ea3c46b33c0bbad6a880792692a1b3" }, + "lazy.nvim": { "branch": "main", "commit": "48b52b5cfcf8f88ed0aff8fde573a5cc20b1306d" }, + "lsp-zero.nvim": { "branch": "v4.x", "commit": "9823b3e27deaf9f0152f3bc22f05b54f21e234e8" }, + "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, + "nvim-lspconfig": { "branch": "master", "commit": "056f569f71e4b726323b799b9cfacc53653bceb3" }, + "nvim-treesitter": { "branch": "master", "commit": "c436d45eeeeb78e5482cb28b59de1d7a77c93d86" }, + "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, + "plenary.nvim": { "branch": "master", "commit": "ec289423a1693aeae6cd0d503bac2856af74edaa" }, + "telescope.nvim": { "branch": "master", "commit": "6312868392331c9c0f22725041f1ec2bef57c751" }, + "undotree": { "branch": "master", "commit": "56c684a805fe948936cda0d1b19505b84ad7e065" }, + "vim-dichromatic": { "branch": "master", "commit": "9765a72ce24ddae48afe12c316583a22c82ad812" }, + "vim-fugitive": { "branch": "master", "commit": "d4877e54cef67f5af4f950935b1ade19ed6b7370" } +} diff --git a/lua/flip/init.lua b/lua/flip/init.lua index ee282f3..a3d288f 100644 --- a/lua/flip/init.lua +++ b/lua/flip/init.lua @@ -1,3 +1,3 @@ -require("flip.packer") require("flip.remap") require("flip.set") +require("flip.lazy") diff --git a/lua/flip/lazy.lua b/lua/flip/lazy.lua new file mode 100644 index 0000000..122fb7f --- /dev/null +++ b/lua/flip/lazy.lua @@ -0,0 +1,31 @@ +-- Bootstrap lazy.nvim +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not (vim.uv or vim.loop).fs_stat(lazypath) then + local lazyrepo = "https://github.com/folke/lazy.nvim.git" + local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) + if vim.v.shell_error ~= 0 then + vim.api.nvim_echo({ + { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, + { out, "WarningMsg" }, + { "\nPress any key to exit..." }, + }, true, {}) + vim.fn.getchar() + os.exit(1) + end +end +vim.opt.rtp:prepend(lazypath) + +-- Make sure to setup `mapleader` and `maplocalleader` before +-- loading lazy.nvim so that mappings are correct. This is done by loading the remap before lazy + +-- Setup lazy.nvim +require("lazy").setup({ + spec = { + -- import plugins + { import = "plugins" }, + }, + -- Configure any other settings here. See documentation for details + install = { colorscheme = { "habamax" } }, + -- automatically check for plugin updates + checker = { enabled = true }, +}) diff --git a/lua/flip/packer.lua b/lua/flip/packer.lua deleted file mode 100644 index fae3c28..0000000 --- a/lua/flip/packer.lua +++ /dev/null @@ -1,52 +0,0 @@ --- This file can be loaded by calling `lua require('plugins')` from your init.vim - --- Only required if you have packer configured as `opt` -vim.cmd [[packadd packer.nvim]] - -return require('packer').startup(function(use) - -- Packer can manage itself - use 'wbthomason/packer.nvim' - - use { - 'nvim-telescope/telescope.nvim', tag = '0.1.6', - -- or , branch = '0.1.x', - requires = { { 'nvim-lua/plenary.nvim' } } - } - - -- Color stuff - use({ - 'romainl/vim-dichromatic', - config = function() - vim.cmd('colorscheme dichromatic') - end - }) - - -- Miscellaneous packages that fit on a line - use('nvim-treesitter/nvim-treesitter', { run = ':TSUpdate' }) - use('nvim-treesitter/playground') - use('theprimeagen/harpoon') - use('mbbill/undotree') - use('tpope/vim-fugitive') - - -- LSP stuff - use { - 'VonHeikemen/lsp-zero.nvim', - branch = 'v2.x', - requires = { - -- LSP Support - { 'neovim/nvim-lspconfig' }, -- Required - { -- Optional - 'williamboman/mason.nvim', - run = function() - pcall(vim.cmd, 'MasonUpdate') - end, - }, - { 'williamboman/mason-lspconfig.nvim' }, -- Optional - - -- Autocompletion - { 'hrsh7th/nvim-cmp' }, -- Required - { 'hrsh7th/cmp-nvim-lsp' }, -- Required - { 'L3MON4D3/LuaSnip' }, -- Required - } - } -end) diff --git a/after/plugin/colors.lua b/lua/plugins/colors.lua similarity index 100% rename from after/plugin/colors.lua rename to lua/plugins/colors.lua diff --git a/after/plugin/harpoon.lua b/lua/plugins/harpoon.lua similarity index 100% rename from after/plugin/harpoon.lua rename to lua/plugins/harpoon.lua diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua new file mode 100644 index 0000000..0920b60 --- /dev/null +++ b/lua/plugins/init.lua @@ -0,0 +1,32 @@ +-- Load prerequisites for plugins here + +return { + { + "nvim-lua/plenary.nvim", + name = "plenary" + } +} + +return { + { + "nvim-telescope/telescope.nvim", + tag = "0.1.6", + requires = { + { "nvim-lua/plenary.nvim" } } + }, + { "romainl/vim-dichromatic", config = function() vim.cmd('colorscheme dichromatic') end }, + { + "nvim-treesitter/nvim-treesitter", + build = function() + require("nvim-treesitter.install").update({ with_sync = true })() + end + }, + "nvim-treesitter/playground", + "theprimeagen/harpoon", + "mbbill/undotree", + "tpope/vim-fugitive", + { 'VonHeikemen/lsp-zero.nvim', branch = 'v4.x' }, + { 'neovim/nvim-lspconfig' }, + { 'hrsh7th/cmp-nvim-lsp' }, + { 'hrsh7th/nvim-cmp' }, +} diff --git a/after/plugin/lsp.lua b/lua/plugins/lsp.lua similarity index 100% rename from after/plugin/lsp.lua rename to lua/plugins/lsp.lua diff --git a/after/plugin/telescope.lua b/lua/plugins/telescope.lua similarity index 100% rename from after/plugin/telescope.lua rename to lua/plugins/telescope.lua diff --git a/after/plugin/treesitter.lua b/lua/plugins/treesitter.lua similarity index 100% rename from after/plugin/treesitter.lua rename to lua/plugins/treesitter.lua diff --git a/after/plugin/undotree.lua b/lua/plugins/undotree.lua similarity index 100% rename from after/plugin/undotree.lua rename to lua/plugins/undotree.lua diff --git a/after/plugin/vim-fugitive.lua b/lua/plugins/vim-fugitive.lua similarity index 100% rename from after/plugin/vim-fugitive.lua rename to lua/plugins/vim-fugitive.lua