-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall_nvim_plugin.sh
More file actions
48 lines (40 loc) · 1.24 KB
/
install_nvim_plugin.sh
File metadata and controls
48 lines (40 loc) · 1.24 KB
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
#!/bin/bash
set -e
echo "=== Installing GPTCode Neovim Plugin ==="
echo ""
if ! command -v nvim &> /dev/null; then
echo "Error: Neovim is not installed"
exit 1
fi
if ! command -v go &> /dev/null; then
echo "Error: Go is not installed"
exit 1
fi
NVIM_CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/nvim"
if [ ! -d "$NVIM_CONFIG" ]; then
echo "Error: Neovim config directory not found at $NVIM_CONFIG"
exit 1
fi
# Create plugin directory
PLUGIN_DIR="$NVIM_CONFIG/pack/plugins/start/gptcode"
echo "1. Creating plugin directory: $PLUGIN_DIR"
mkdir -p "$PLUGIN_DIR/lua"
# Copy lua files
echo "2. Copying Lua files..."
cp -v ./neovim/lua/gptcode/init.lua "$PLUGIN_DIR/lua/gptcode.lua"
# Ensure binary is in place
if [ ! -f "$HOME/.local/bin/gptcode" ]; then
echo ""
echo "Warning: gptcode binary not found at ~/.local/bin/gptcode"
echo "Building it now..."
go build -o "$HOME/.local/bin/gptcode" ./cmd/gptcode
echo "✓ Binary built and installed"
fi
echo ""
echo "✓ Plugin installed successfully!"
echo ""
echo "Next steps:"
echo "1. Restart Neovim or run: :luafile $PLUGIN_DIR/lua/gptcode.lua"
echo "2. Test with: :lua require('gptcode').start_code_conversation()"
echo ""
echo "The plugin is now using: ~/.local/bin/gptcode"