Skip to content

Commit

Permalink
nvim: Makefile for plugin bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
alcarney committed May 7, 2024
1 parent c0d7e7c commit cc58a2b
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions nvim/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Makefile for bootstrapping my neovim config on machines without access to
# nix.

SITE_DIR := $(HOME)/.local/share/nvim/site/pack
START_DIR := $(SITE_DIR)/git/start
PLUGINS =

.PHONY: update

default: update

$(SITE_DIR):
mkdir -p $(SITE_DIR)

# A 'function' for defining a rule that bootstraps a plugin.
define PLUG =
$$(START_DIR)/$1/.git:
git clone $2 $$(subst .git,,$$@)

PLUGINS += $$(START_DIR)/$1/.git
endef


# To see the result of calling 'PLUG', change eval to info
#
# Common dependencies
$(eval $(call PLUG,everforest,https://github.com/neanias/everforest-nvim))

# Common dependencies
$(eval $(call PLUG,plenary,https://github.com/nvim-lua/plenary.nvim))


# LSP
$(eval $(call PLUG,nvim-lspconfig,https://github.com/neovim/nvim-lspconfig))
$(eval $(call PLUG,nvim-cmp,https://github.com/hrsh7th/nvim-cmp))
$(eval $(call PLUG,cmp-nvim-lsp,https://github.com/hrsh7th/cmp-nvim-lsp))

# "Apps"
$(eval $(call PLUG,telescope,https://github.com/nvim-telescope/telescope.nvim))
$(eval $(call PLUG,toggleterm,https://github.com/akinsho/toggleterm.nvim))

update: $(PLUGINS)
@for plug in $^ ; do git -C $${plug%.git} pull; done

0 comments on commit cc58a2b

Please sign in to comment.