summaryrefslogtreecommitdiff
path: root/lua/plugins.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/plugins.lua')
-rw-r--r--lua/plugins.lua42
1 files changed, 42 insertions, 0 deletions
diff --git a/lua/plugins.lua b/lua/plugins.lua
index e6c54db..456c9c4 100644
--- a/lua/plugins.lua
+++ b/lua/plugins.lua
@@ -1,3 +1,45 @@
+
+function bootstrap_plugin_manager()
+ local lazy_nvim_repo_url = "https://github.com/folke/lazy.nvim.git"
+
+ local lazy_nvim_path = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
+
+ if not (vim.uv or vim.loop).fs_stat(lazy_nvim_path) then
+ local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazy_nvim_repo_url, lazy_nvim_path })
+
+ 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(lazy_nvim_path)
+end
+
+-- Make sure to setup `mapleader` and `maplocalleader` before
+-- loading lazy.nvim so that mappings are correct.
+-- This is also a good place to setup other settings (vim.opt)
+vim.g.mapleader = " "
+vim.g.maplocalleader = "\\"
+
+-- Setup lazy.nvim
+require("lazy").setup({
+ spec = {
+ -- add your plugins here
+ },
+ -- Configure any other settings here. See the documentation for more details.
+ -- colorscheme that will be used when installing plugins.
+ install = { colorscheme = { "habamax" } },
+ -- automatically check for plugin updates
+ checker = { enabled = true },
+})
+
return require("packer").startup(function(use)
use {
"wbthomason/packer.nvim",