diff --git a/.helpers/lazy.nvim b/.helpers/lazy.nvim new file mode 100755 index 0000000..f837142 --- /dev/null +++ b/.helpers/lazy.nvim @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +set -o errexit +set -o nounset +set -o pipefail + +LAZY_NVIM_SOURCE="https://github.com/folke/lazy.nvim.git" +LAZY_NVIM_DESTINATION="${XDG_DATA_HOME}/nvim/lazy/lazy.nvim" +LAZY_STATE_DIR="${XDG_STATE_HOME}/nvim/lazy" + +mkdir -p ${LAZY_STATE_DIR} + +if [ -d ${LAZY_NVIM_DESTINATION}/.git ]; then + echo "INFO: lazy.nvim is already installed" + exit 0 +fi + +echo "INFO: Cloning ${LAZY_NVIM_SOURCE} to ${LAZY_NVIM_DESTINATION}..." +git clone --filter=blob:none --single-branch ${LAZY_NVIM_SOURCE} ${LAZY_NVIM_DESTINATION} diff --git a/.helpers/nvim-packer b/.helpers/nvim-packer deleted file mode 100755 index 0dd35be..0000000 --- a/.helpers/nvim-packer +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -PACKER_NVIM_SOURCE="https://github.com/wbthomason/packer.nvim" -PACKER_NVIM_DESTINATION="${XDG_DATA_HOME}/nvim/site/pack/packer/start/packer.nvim" - -if [ -d ${PACKER_NVIM_DESTINATION}/.git ]; then - echo "INFO: packer.nvim is already installed." - exit 0 -fi - -echo "INFO: Cloning ${PACKER_NVIM_SOURCE} to ${PACKER_NVIM_DESTINATION}..." -git clone --depth=1 ${PACKER_NVIM_SOURCE} ${PACKER_NVIM_DESTINATION} diff --git a/Makefile b/Makefile index d7d785b..4aff51c 100644 --- a/Makefile +++ b/Makefile @@ -9,8 +9,8 @@ update: clean: backup @bash ./.helpers/config clean -install_packer: - @bash ./.helpers/nvim-packer +install_lazy: + @bash ./.helpers/lazy.nvim package: @bash ./.helpers/config package diff --git a/nvim/lua/options.lua b/nvim/lua/options.lua index 6f05a6a..37f3a0c 100644 --- a/nvim/lua/options.lua +++ b/nvim/lua/options.lua @@ -35,11 +35,6 @@ set.encoding = "utf-8" set.fileencoding = "utf-8" set.fileencodings = "utf-8" --- Colour scheme -set.termguicolors = true -set.background = "dark" -cmd "colorscheme tokyonight-night" - -- UI and UX set.number = true -- enable line numbers set.relativenumber = true -- enable relative line numbers diff --git a/nvim/lua/plugins/init.lua b/nvim/lua/plugins/init.lua index 19fb649..c346706 100644 --- a/nvim/lua/plugins/init.lua +++ b/nvim/lua/plugins/init.lua @@ -1,45 +1,66 @@ -return require("packer").startup(function(use) - -- Packer can manage itself - use { - "wbthomason/packer.nvim", - commit = "1d0cf98a561f7fd654c970c49f917d74fafe1530", -- 2023-01-11 - } +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +local set = vim.opt +local cmd = vim.cmd - use { +vim.opt.runtimepath:prepend(lazypath) + +local plugins = { + { "folke/tokyonight.nvim", - tag = "v1.10.0", -- 2023-03-23 - config = require("plugins.config.tokyonight"), - } - - use { + tag = "v1.10.0", -- 2023-03-23 + priority = 1000, + config = function() + require("plugins.config.tokyonight") + set.termguicolors = true + set.background = "dark" + cmd "colorscheme tokyonight-night" + end, + }, + { "neovim/nvim-lspconfig", commit = "10fa01d553ce10646350461ac5ddc71f189e9d1a", -- 2023-04-10 - config = require("plugins.config.lsp"), - } - - use { + config = function() + require("plugins.config.lsp") + end, + }, + { "nvim-treesitter/nvim-treesitter", commit = "cc360a9beb1b30d172438f640e2c3450358c4086", -- 2023-04-10 - config = require("plugins.config.treesitter"), - run = ":TSUpdate", - } - - use { + config = function() + require("plugins.config.treesitter") + end, + build = function() + require("nvim-treesitter.install").update({ with_sync = true }) + end, + }, + { "nvim-tree/nvim-web-devicons", commit = "f16ec8f6e5d23e4349501dae46e0a661918e086e", -- 2023-04-08 - } - - use { + }, + { "akinsho/bufferline.nvim", tag = "v3.6.0", -- 2023.03.30 - requires = "nvim-tree/nvim-web-devicons", - config = require("plugins.config.bufferline"), - } - - use { + dependencies = { + "nvim-tree/nvim-web-devicons", + }, + config = function() + require("plugins.config.bufferline") + end, + }, + { "is0n/tui-nvim", commit = "2eeff3ac921f53bdb837d23d6e4501d97807994c", -- 2022.05.07 - config = require("plugins.config.tui_nvim"), - } + config = function() + require("plugins.config.tui_nvim") + end, + }, +} -end) +require("lazy").setup(plugins, { + lockfile = vim.fn.stdpath("state") .. "/lazy/lock.json", + performance = { + cache = { + enabled = true, + } + } +})