Update nvim to fix parser issue
This commit is contained in:
2 files changed
+17
-11
No files matched your search
@@ -33,27 +33,30 @@ build() {
|
|||||||
cp -r "$startdir/plugin" "$XDG_CONFIG_HOME/nvim/"
|
cp -r "$startdir/plugin" "$XDG_CONFIG_HOME/nvim/"
|
||||||
cp "$startdir/lazyvim.json" "$XDG_CONFIG_HOME/nvim/"
|
cp "$startdir/lazyvim.json" "$XDG_CONFIG_HOME/nvim/"
|
||||||
|
|
||||||
# Add custom option to disable relative numbers
|
|
||||||
echo "vim.opt.relativenumber = false" >>"$XDG_CONFIG_HOME/nvim/lua/config/options.lua"
|
echo "vim.opt.relativenumber = false" >>"$XDG_CONFIG_HOME/nvim/lua/config/options.lua"
|
||||||
|
|
||||||
# Prime LazyVim - download all plugins and TreeSitter parsers in one session
|
echo "Installing LazyVim plugins..."
|
||||||
# Run for minimum 60 seconds to ensure everything completes
|
|
||||||
echo ":: Installing LazyVim plugins and TreeSitter parsers (minimum 60 seconds)..."
|
|
||||||
nvim --headless \
|
nvim --headless \
|
||||||
"+Lazy! sync" \
|
"+Lazy! sync" \
|
||||||
"+qa!" || true
|
"+qa!" || true
|
||||||
|
|
||||||
|
echo "Ensuring critical TreeSitter parsers are compiled..."
|
||||||
|
nvim --headless \
|
||||||
|
"+TSInstall bash c diff dtd html javascript jsdoc lua luadoc markdown markdown_inline python regex toml tsx typescript vim vimdoc xml yaml" \
|
||||||
|
"+qa!" || true
|
||||||
}
|
}
|
||||||
|
|
||||||
package() {
|
package() {
|
||||||
cd "$srcdir"
|
cd "$srcdir"
|
||||||
|
|
||||||
# Install everything to /usr/share/omarchy-nvim
|
|
||||||
install -dm755 "$pkgdir/usr/share/$pkgname"
|
install -dm755 "$pkgdir/usr/share/$pkgname"
|
||||||
|
|
||||||
# Copy all the built artifacts
|
|
||||||
cp -a "$XDG_CONFIG_HOME/nvim" "$pkgdir/usr/share/$pkgname/config"
|
cp -a "$XDG_CONFIG_HOME/nvim" "$pkgdir/usr/share/$pkgname/config"
|
||||||
cp -a "$XDG_DATA_HOME/nvim" "$pkgdir/usr/share/$pkgname/data"
|
cp -a "$XDG_DATA_HOME/nvim" "$pkgdir/usr/share/$pkgname/data"
|
||||||
cp -a "$XDG_CACHE_HOME/nvim" "$pkgdir/usr/share/$pkgname/cache"
|
|
||||||
|
# Remove broken symlinks from queries directory
|
||||||
|
# These will be recreated at runtime by the setup script
|
||||||
|
find "$pkgdir/usr/share/$pkgname/data/site/queries" -type l -delete
|
||||||
|
|
||||||
# Fix permissions to be readable by all users
|
# Fix permissions to be readable by all users
|
||||||
chmod -R 755 "$pkgdir/usr/share/$pkgname"
|
chmod -R 755 "$pkgdir/usr/share/$pkgname"
|
||||||
|
|||||||
@@ -37,25 +37,28 @@ rm -rf $DATA_DIR $CACHE_DIR $STATE_DIR
|
|||||||
# Create directories if needed
|
# Create directories if needed
|
||||||
mkdir -p "$(dirname "$CONFIG_DIR")"
|
mkdir -p "$(dirname "$CONFIG_DIR")"
|
||||||
mkdir -p "$(dirname "$DATA_DIR")"
|
mkdir -p "$(dirname "$DATA_DIR")"
|
||||||
mkdir -p "$(dirname "$CACHE_DIR")"
|
|
||||||
|
|
||||||
# Copy files
|
# Copy files (cache will be regenerated on first use)
|
||||||
cp -r "$PACKAGE_DIR/config" "$CONFIG_DIR"
|
cp -r "$PACKAGE_DIR/config" "$CONFIG_DIR"
|
||||||
cp -r "$PACKAGE_DIR/data" "$DATA_DIR"
|
cp -r "$PACKAGE_DIR/data" "$DATA_DIR"
|
||||||
cp -r "$PACKAGE_DIR/cache" "$CACHE_DIR"
|
|
||||||
|
|
||||||
# Ensure proper ownership of all nvim directories
|
# Ensure proper ownership of all nvim directories
|
||||||
chown -R "${USER}:${USER}" "$CONFIG_DIR"
|
chown -R "${USER}:${USER}" "$CONFIG_DIR"
|
||||||
chown -R "${USER}:${USER}" "$DATA_DIR"
|
chown -R "${USER}:${USER}" "$DATA_DIR"
|
||||||
chown -R "${USER}:${USER}" "$CACHE_DIR"
|
|
||||||
|
|
||||||
# Create link for current theme
|
# Create link for current theme
|
||||||
ln -snf "${HOME}/.config/omarchy/current/theme/neovim.lua" "${CONFIG_DIR}/lua/plugins/theme.lua"
|
ln -snf "${HOME}/.config/omarchy/current/theme/neovim.lua" "${CONFIG_DIR}/lua/plugins/theme.lua"
|
||||||
|
|
||||||
|
# Restore git working trees
|
||||||
for dir in $DATA_DIR/lazy/*/; do
|
for dir in $DATA_DIR/lazy/*/; do
|
||||||
if [ -d "$dir/.git" ]; then
|
if [ -d "$dir/.git" ]; then
|
||||||
git --git-dir="$dir/.git" --work-tree="$dir" restore .
|
git --git-dir="$dir/.git" --work-tree="$dir" restore .
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Recreate TreeSitter query symlinks
|
||||||
|
for query_lang in "$DATA_DIR/lazy/nvim-treesitter/runtime/queries"/*; do
|
||||||
|
ln -sf "$query_lang" "$DATA_DIR/site/queries/$(basename "$query_lang")"
|
||||||
|
done
|
||||||
|
|
||||||
echo "Neovim setup complete!"
|
echo "Neovim setup complete!"
|
||||||
Reference in new issue
Block a user