Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev Env Tweaks #156

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions configs/neovim/lazyvim.json

This file was deleted.

25 changes: 11 additions & 14 deletions install/terminal/app-neovim.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,22 @@ cd -

# Only attempt to set configuration if Neovim has never been run
if [ ! -d "$HOME/.config/nvim" ]; then
# Use LazyVim
git clone https://github.com/LazyVim/starter ~/.config/nvim
# Use LazyVim
git clone https://github.com/LazyVim/starter ~/.config/nvim

# Disable update notification popup in starter config
sed -i 's/checker = { enabled = true }/checker = { enabled = true, notify = false }/g' ~/.config/nvim/lua/config/lazy.lua
# Disable update notification popup in starter config
sed -i 's/checker = { enabled = true }/checker = { enabled = true, notify = false }/g' ~/.config/nvim/lua/config/lazy.lua

# Make everything match the terminal transparency
mkdir -p ~/.config/nvim/plugin/after
cp ~/.local/share/omakub/configs/neovim/transparency.lua ~/.config/nvim/plugin/after/
# Make everything match the terminal transparency
mkdir -p ~/.config/nvim/plugin/after
cp ~/.local/share/omakub/configs/neovim/transparency.lua ~/.config/nvim/plugin/after/

# Default to Tokyo Night theme
cp ~/.local/share/omakub/themes/tokyo-night/neovim.lua ~/.config/nvim/lua/plugins/theme.lua

# Enable default extras
cp ~/.local/share/omakub/configs/neovim/lazyvim.json ~/.config/nvim/lazyvim.json
# Default to Tokyo Night theme
cp ~/.local/share/omakub/themes/tokyo-night/neovim.lua ~/.config/nvim/lua/plugins/theme.lua
fi

# Replace desktop launcher with one running inside Alacritty
if [[ -d ~/.local/share/applications ]]; then
sudo rm -rf /usr/share/applications/nvim.desktop
source ~/.local/share/omakub/applications/Neovim.sh
sudo rm -rf /usr/share/applications/nvim.desktop
source ~/.local/share/omakub/applications/Neovim.sh
fi
97 changes: 59 additions & 38 deletions install/terminal/select-dev-language.sh
Original file line number Diff line number Diff line change
@@ -1,45 +1,66 @@
# Install default programming languages
if [[ -v OMAKUB_FIRST_RUN_LANGUAGES ]]; then
languages=$OMAKUB_FIRST_RUN_LANGUAGES
languages=$OMAKUB_FIRST_RUN_LANGUAGES
else
AVAILABLE_LANGUAGES=("Ruby on Rails" "Node.js" "Go" "PHP" "Python" "Elixir" "Rust" "Java")
languages=$(gum choose "${AVAILABLE_LANGUAGES[@]}" --no-limit --height 10 --header "Select programming languages")
AVAILABLE_LANGUAGES=("Ruby on Rails" "Node.js" "Go" "PHP" "Python" "Elixir" "Rust" "Java")
languages=$(gum choose "${AVAILABLE_LANGUAGES[@]}" --no-limit --height 10 --header "Select programming languages")
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
for language in $languages; do
case $language in
Ruby)
mise use --global ruby@3.3
mise x ruby -- gem install rails --no-document
;;
Node.js)
mise use --global node@lts
;;
Go)
mise use --global go@latest
;;
PHP)
sudo add-apt-repository -y ppa:ondrej/php
sudo apt -y install php8.3 php8.3-{curl,apcu,intl,mbstring,opcache,pgsql,mysql,sqlite3,redis,xml,zip}
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php --quiet && sudo mv composer.phar /usr/local/bin/composer
rm composer-setup.php
;;
Python)
mise use --global python@latest
;;
Elixir)
mise use --global erlang@latest
mise use --global elixir@latest
mise x elixir -- mix local.hex --force
;;
Rust)
bash -c "$(curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs)" -- -y
;;
Java)
mise use --global java@latest
;;
esac
done
for language in $languages; do
case $language in
Ruby)
mise use --global ruby@3.3
mise x ruby -- gem install rails --no-document
;;
Node.js)
mise use --global node@lts

enable_lazyvim_extras "lazyvim.plugins.extras.lang.typescript"
;;
Go)
mise use --global go@latest

enable_lazyvim_extras "lazyvim.plugins.extras.lang.go"
;;
PHP)
sudo add-apt-repository -y ppa:ondrej/php
sudo apt -y install php8.3 php8.3-{curl,apcu,intl,mbstring,opcache,pgsql,mysql,sqlite3,redis,xml,zip}
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php --quiet && sudo mv composer.phar /usr/local/bin/composer
rm composer-setup.php

enable_lazyvim_extras "lazyvim.plugins.extras.lang.php" "lazyvim.plugins.extras.lang.typescript"

# Configure PHP's LSP to use intelephense instead of phpactor (default)
if ! grep -q 'php_lsp' ~/.config/nvim/lua/config/options.lua; then
echo 'vim.g.lazyvim_php_lsp = "intelephense"' >>~/.config/nvim/lua/config/options.lua
fi
;;
Python)
mise use --global python@latest
;;
Elixir)
mise use --global erlang@latest
mise use --global elixir@latest
mise x elixir -- mix local.hex --force
;;
Rust)
bash -c "$(curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs)" -- -y
;;
Java)
mise use --global java@latest
;;
esac
done
fi