-
Notifications
You must be signed in to change notification settings - Fork 19
/
install.sh
executable file
·40 lines (28 loc) · 952 Bytes
/
install.sh
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
#! /bin/bash
dst=./nvim-example-lua-plugin
if [[ ! -z $1 ]]; then
dst=$1
name=$(basename $1)
fi
mkdir -p "$dst"
git clone --depth 1 \
https://github.com/jacobsimpson/nvim-example-lua-plugin \
"$dst"
rm -Rf "$dst/.git" "$dst/install.sh" "$dst/README.asciidoc"
mv "$dst/README-example.md" "$dst/README.md"
if [[ ! -z $name ]]; then
mv "$dst/plugin/nvim-example-lua-plugin.vim" "$dst/plugin/$name.vim"
for f in $(find "$dst" -type f); do
printf ",s/nvim-example-lua-plugin/$dst/g\nw\n" | ed "$f" >& /dev/null
done
fi
echo "
To try out your new plugin locally, use:
nvim --cmd 'set rtp+=$dst'
To use it after uploading to Github, add the necessary plugin load command to
your Neovim config files.
Example - using Packer plugin manager, with the plugin installed locally:
use '$dst'
Example - using vim-plug plugin manager, after the new plugin has been uploaded to Github:
Plug '<github-username>/${name}'
"