~tardypad/dotfiles

ref: 7dd5e02494e2821ff6b4fd5758a590ef03b5403b dotfiles/packages/vim/Makefile -rw-r--r-- 1.8 KiB
7dd5e024 — Damien Tardy-Panis add mako package config 3 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
vim:
	$(start_setup)

    # create necessary runtime directories
	@mkdir --parents $(DESTDIR)$(HOME)/.vim/backup
	@mkdir --parents $(DESTDIR)$(HOME)/.vim/swap
	@mkdir --parents $(DESTDIR)$(HOME)/.vim/undo
	@mkdir --parents $(DESTDIR)$(HOME)/.vim/sessions

ifeq ($(IS_LOCAL_INSTALL),'true')
  # backup locally added new spelling words
	@if ! diff packages/vim/spell/en.utf-8.add $(DESTDIR)$(HOME)/.vim/spell/en.utf-8.add &> /dev/null; then \
		cp $(DESTDIR)$(HOME)/.vim/spell/en.utf-8.add vim_spell_en.bkp; \
	fi
endif

	$(call copy_file,vimrc,$(HOME)/.vimrc)
	$(call copy_file,plugins.vim,$(HOME)/.vim/plugins.vim)
	$(call copy_folder,config.d,$(HOME)/.vim/config.d)
	$(call copy_folder,colors,$(HOME)/.vim/colors)
	$(call copy_folder,ftdetect,$(HOME)/.vim/ftdetect)
	$(call copy_folder,ftplugin,$(HOME)/.vim/ftplugin)
	$(call copy_folder,indent,$(HOME)/.vim/indent)
	$(call copy_folder,spell,$(HOME)/.vim/spell)
	$(call copy_folder,snips,$(HOME)/.vim/snips)

  # install the plugins manager
	@curl --silent --location --create-dirs \
		https://raw.githubusercontent.com/junegunn/vim-plug/0.10.0/plug.vim \
		--output "$(DESTDIR)$(HOME)/.vim/autoload/plug.vim"; \

  # Manually install icinga2 syntax
  # not a real plugin, just one file of a bigger repository
	@curl --silent --location --create-dirs \
		https://raw.githubusercontent.com/Icinga/icinga2/3cb2c1d1435f19bc5e46fa8f8518645f62549dde/tools/syntax/vim/syntax/icinga2.vim \
		--output "$(DESTDIR)$(HOME)/.vim/plugged/icinga2/syntax/icinga2.vim"; \

ifeq ($(IS_LOCAL_INSTALL),'true')
    # load only the plugins definition and install/clean/update them
	@vim -N --noplugin -u "$(HOME)/.vim/plugins.vim" \
		+PlugInstall +PlugClean! +PlugUpdate +qall \
		> /dev/null 2>&1

    # generate spell file
	@vim +"mkspell $(HOME)/.vim/spell/en.utf-8.add.spl $(HOME)/.vim/spell/en.utf-8.add" +qall \
		> /dev/null 2>&1
endif

	$(end_setup)