mirror of
https://github.com/aljazceru/omakub.git
synced 2025-12-18 21:14:21 +01:00
Enable lazyvim extras based on the language
This commit is contained in:
@@ -6,6 +6,16 @@ else
|
|||||||
languages=$(gum choose "${AVAILABLE_LANGUAGES[@]}" --no-limit --height 10 --header "Select programming languages")
|
languages=$(gum choose "${AVAILABLE_LANGUAGES[@]}" --no-limit --height 10 --header "Select programming languages")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
enable_lazyvim_extras() {
|
||||||
|
local temp_file=$(mktemp /tmp/omakub.XXXXX)
|
||||||
|
local extras=("$@")
|
||||||
|
local jq_extras=$(printf '"%s",' "${extras[@]}")
|
||||||
|
jq_extras="[${jq_extras%,}]"
|
||||||
|
|
||||||
|
jq --argjson extras "$jq_extras" '.extras |= (. + $extras | unique)' ~/.config/nvim/lazyvim.json >"$temp_file" &&
|
||||||
|
mv "$temp_file" ~/.config/nvim/lazyvim.json
|
||||||
|
}
|
||||||
|
|
||||||
if [[ -n "$languages" ]]; then
|
if [[ -n "$languages" ]]; then
|
||||||
for language in $languages; do
|
for language in $languages; do
|
||||||
case $language in
|
case $language in
|
||||||
@@ -15,9 +25,13 @@ if [[ -n "$languages" ]]; then
|
|||||||
;;
|
;;
|
||||||
Node.js)
|
Node.js)
|
||||||
mise use --global node@lts
|
mise use --global node@lts
|
||||||
|
|
||||||
|
enable_lazyvim_extras "lazyvim.plugins.extras.lang.typescript"
|
||||||
;;
|
;;
|
||||||
Go)
|
Go)
|
||||||
mise use --global go@latest
|
mise use --global go@latest
|
||||||
|
|
||||||
|
enable_lazyvim_extras "lazyvim.plugins.extras.lang.go"
|
||||||
;;
|
;;
|
||||||
PHP)
|
PHP)
|
||||||
sudo add-apt-repository -y ppa:ondrej/php
|
sudo add-apt-repository -y ppa:ondrej/php
|
||||||
@@ -25,6 +39,8 @@ if [[ -n "$languages" ]]; then
|
|||||||
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
|
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
|
||||||
php composer-setup.php --quiet && sudo mv composer.phar /usr/local/bin/composer
|
php composer-setup.php --quiet && sudo mv composer.phar /usr/local/bin/composer
|
||||||
rm composer-setup.php
|
rm composer-setup.php
|
||||||
|
|
||||||
|
enable_lazyvim_extras "lazyvim.plugins.extras.lang.php" "lazyvim.plugins.extras.lang.typescript"
|
||||||
;;
|
;;
|
||||||
Python)
|
Python)
|
||||||
mise use --global python@latest
|
mise use --global python@latest
|
||||||
|
|||||||
Reference in New Issue
Block a user