This commit is contained in:
Christoffer Martinsson 2024-04-14 10:21:57 +02:00
parent 18fd281fa4
commit 9399c20b32
3 changed files with 145 additions and 133 deletions

View File

@ -68,7 +68,6 @@ vim.api.nvim_create_autocmd(
{ pattern = "*", command = "set nocursorline", group = cursorLineGrp } { pattern = "*", command = "set nocursorline", group = cursorLineGrp }
) )
-- Auto format on save -- Auto format on save
vim.cmd [[autocmd BufWritePre * lua vim.lsp.buf.format()]] vim.cmd [[autocmd BufWritePre * lua vim.lsp.buf.format()]]
@ -165,18 +164,18 @@ require('lazy').setup({
"simrat39/rust-tools.nvim", "simrat39/rust-tools.nvim",
}, },
-- { {
-- "ray-x/lsp_signature.nvim", "ray-x/lsp_signature.nvim",
-- config = function() config = function()
-- require "lsp_signature".setup { require "lsp_signature".setup {
-- bind = true, -- This is mandatory, otherwise border config won't get registered. bind = true, -- This is mandatory, otherwise border config won't get registered.
-- handler_opts = { handler_opts = {
-- border = "solid" border = "solid"
-- } }
-- } }
-- end end
-- }, },
--
{ {
"jay-babu/mason-null-ls.nvim", "jay-babu/mason-null-ls.nvim",
event = { "BufReadPre", "BufNewFile" }, event = { "BufReadPre", "BufNewFile" },

View File

@ -1,2 +1,14 @@
#!/bin/bash #!/bin/bash
nvim # Start virtual here client in non-service mode
sudo vhclientx86_64 &
vhclientx86_64 -t LIST
tmux rename-window "BASH"
# Check if the projects directory exists, if not create it
if [ ! -d ~/projects ]; then
mkdir ~/projects
fi
# Start nvim in projects directory
cd ~/projects
tmux new-window -n "NVIM" nvim

239
update.sh
View File

@ -2,21 +2,21 @@
set -e set -e
# Ubuntu 20.04 workaround # Ubuntu 20.04 workaround
printf -- '\033[33m Remove neovim if already installed\n\033[37m' printf -- '\033[33m Remove neovim if already installed\n\033[37m'
sudo apt -y purge --auto-remove neovim sudo apt -y purge --auto-remove neovim
# Install system packages # Install system packages
printf -- '\033[33m Installing system packages\n\033[37m' printf -- '\033[33m Installing system packages\n\033[37m'
sudo apt update && sudo apt -y upgrade sudo apt update && sudo apt -y upgrade
sudo apt -y install ninja-build gettext cmake unzip curl python3 python3-pip python3-venv \ sudo apt -y install ninja-build gettext cmake unzip curl python3 python3-pip python3-venv \
build-essential libssl-dev libffi-dev python3-dev file tmux libudev-dev pkg-config locales build-essential libssl-dev libffi-dev python3-dev file tmux libudev-dev pkg-config locales
# Setup locals # Setup locals
printf -- '\033[33m Setup locals\n\033[37m' printf -- '\033[33m Setup locals\n\033[37m'
sudo locale-gen "en_US.UTF-8" sudo locale-gen "en_US.UTF-8"
sudo update-locale LANG=en_US.UTF-8 sudo update-locale LANG=en_US.UTF-8
# Install fzf # Install fzf
printf -- '\033[33m Installing fzf\n\033[37m' printf -- '\033[33m Installing fzf\n\033[37m'
rm -rf ~/.fzf rm -rf ~/.fzf
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
@ -25,193 +25,194 @@ source ~/.fzf.bash
# Install VirtualHere client # Install VirtualHere client
printf -- '\033[33m Installing VirtualHere client\n\033[37m' printf -- '\033[33m Installing VirtualHere client\n\033[37m'
cd ~ cd ~
wget https://www.virtualhere.com/sites/default/files/usbclient/scripts/virtualhereclient.service wget https://www.virtualhere.com/sites/default/files/usbclient/scripts/virtualhereclient.service
wget https://www.virtualhere.com/sites/default/files/usbclient/vhclientx86_64 wget https://www.virtualhere.com/sites/default/files/usbclient/vhclientx86_64
chmod +x ./vhclientx86_64 chmod +x ./vhclientx86_64
sudo mv ./vhclientx86_64 /usr/sbin sudo mv ./vhclientx86_64 /usr/sbin
# sudo mv virtualhereclient.service /etc/systemd/system/virtualhereclient.service echo "$USER ALL=(ALL:ALL) NOPASSWD: /usr/sbin/vhclientx86_64" | sudo tee /etc/sudoers.d/$USER+vhclientx86_64
# sudo systemctl daemon-reload # sudo mv virtualhereclient.service /etc/systemd/system/virtualhereclient.service
# sudo systemctl enable virtualhereclient.service # sudo systemctl daemon-reload
# sudo systemctl start virtualhereclient.service # sudo systemctl enable virtualhereclient.service
# sudo systemctl start virtualhereclient.service
# Install teensy udev rules (only for non docker system) # Install teensy udev rules (only for non docker system)
if [ ! -f /.dockerenv ]; then if [ ! -f /.dockerenv ]; then
printf -- '\033[33m Installing teensy udev rules\n\033[37m' printf -- '\033[33m Installing teensy udev rules\n\033[37m'
sudo rm -f /tmp/00-teensy.rules /etc/udev/rules.d/00-teensy.rules /lib/udev/rules.d/00-teensy.rules sudo rm -f /tmp/00-teensy.rules /etc/udev/rules.d/00-teensy.rules /lib/udev/rules.d/00-teensy.rules
sudo wget -O /tmp/00-teensy.rules https://www.pjrc.com/teensy/00-teensy.rules sudo wget -O /tmp/00-teensy.rules https://www.pjrc.com/teensy/00-teensy.rules
sudo install -o root -g root -m 0664 /tmp/00-teensy.rules /lib/udev/rules.d/00-teensy.rules sudo install -o root -g root -m 0664 /tmp/00-teensy.rules /lib/udev/rules.d/00-teensy.rules
sudo service udev restart sudo service udev restart
sudo udevadm control --reload-rules sudo udevadm control --reload-rules
sudo udevadm trigger sudo udevadm trigger
fi fi
# Install neovim # Install neovim
printf -- '\033[33m Installing neovim\n\033[37m' printf -- '\033[33m Installing neovim\n\033[37m'
cd ~ cd ~
if [ -d ~/neovim ]; then rm -rf ~/neovim; fi if [ -d ~/neovim ]; then rm -rf ~/neovim; fi
git clone https://github.com/neovim/neovim git clone https://github.com/neovim/neovim
cd neovim && git checkout stable cd neovim && git checkout stable
make CMAKE_BUILD_TYPE=RelWithDebInfo make CMAKE_BUILD_TYPE=RelWithDebInfo
cd build && cpack -G DEB && sudo dpkg -i nvim-linux64.deb cd build && cpack -G DEB && sudo dpkg -i nvim-linux64.deb
if [ -d ~/neovim ]; then rm -rf ~/neovim; fi if [ -d ~/neovim ]; then rm -rf ~/neovim; fi
# Install rust # Install rust
printf -- '\033[33m Installing Rust\n\033[37m' printf -- '\033[33m Installing Rust\n\033[37m'
cd ~ cd ~
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source "$HOME/.cargo/env" source "$HOME/.cargo/env"
rustup self update rustup self update
rustup update stable rustup update stable
# Install rust embedded stuff # Install rust embedded stuff
printf -- '\033[33m Installing Rust embedded stuff\n\033[37m' printf -- '\033[33m Installing Rust embedded stuff\n\033[37m'
cd ~ cd ~
rustup target add thumbv6m-none-eabi rustup target add thumbv6m-none-eabi
cargo install elf2uf2-rs --locked cargo install elf2uf2-rs --locked
cargo install probe-run cargo install probe-run
# Install tree sitter cli # Install tree sitter cli
printf -- '\033[33m Installing tree sitter cli\n\033[37m' printf -- '\033[33m Installing tree sitter cli\n\033[37m'
cd ~ cd ~
cargo install tree-sitter-cli cargo install tree-sitter-cli
# Install ripgrep # Install ripgrep
printf -- '\033[33m Installing ripgrep\n\033[37m' printf -- '\033[33m Installing ripgrep\n\033[37m'
cargo install ripgrep cargo install ripgrep
# sudo apt install -y ripgrep # sudo apt install -y ripgrep
# Install fd # Install fd
printf -- '\033[33m Installing fd\n\033[37m' printf -- '\033[33m Installing fd\n\033[37m'
sudo apt install -y fd-find sudo apt install -y fd-find
# Install lazygit # Install lazygit
printf -- '\033[33m Installing lazygit\n\033[37m' printf -- '\033[33m Installing lazygit\n\033[37m'
cd ~ cd ~
LAZYGIT_VERSION=$(curl -s "https://api.github.com/repos/jesseduffield/lazygit/releases/latest" | grep -Po '"tag_name": "v\K[^"]*') LAZYGIT_VERSION=$(curl -s "https://api.github.com/repos/jesseduffield/lazygit/releases/latest" | grep -Po '"tag_name": "v\K[^"]*')
curl -Lo lazygit.tar.gz "https://github.com/jesseduffield/lazygit/releases/latest/download/lazygit_${LAZYGIT_VERSION}_Linux_x86_64.tar.gz" curl -Lo lazygit.tar.gz "https://github.com/jesseduffield/lazygit/releases/latest/download/lazygit_${LAZYGIT_VERSION}_Linux_x86_64.tar.gz"
tar xf lazygit.tar.gz lazygit tar xf lazygit.tar.gz lazygit
sudo install lazygit /usr/local/bin sudo install lazygit /usr/local/bin
rm ~/lazygit && rm ~/lazygit.tar.gz rm ~/lazygit && rm ~/lazygit.tar.gz
# Install gdu # Install gdu
printf -- '\033[33m Installing gdu\n\033[37m' printf -- '\033[33m Installing gdu\n\033[37m'
sudo add-apt-repository -y ppa:daniel-milde/gdu sudo add-apt-repository -y ppa:daniel-milde/gdu
sudo apt update sudo apt update
sudo apt install -y gdu sudo apt install -y gdu
# Install ruby # Install ruby
printf -- '\033[33m Installing ruby\n\033[37m' printf -- '\033[33m Installing ruby\n\033[37m'
sudo apt install -y ruby ruby-dev sudo apt install -y ruby ruby-dev
sudo gem install neovim sudo gem install neovim
# Install bottom # Install bottom
printf -- '\033[33m Installing bottom\n\033[37m' printf -- '\033[33m Installing bottom\n\033[37m'
cd ~ cd ~
curl -LO https://github.com/ClementTsang/bottom/releases/download/0.9.1/bottom_0.9.1_amd64.deb curl -LO https://github.com/ClementTsang/bottom/releases/download/0.9.1/bottom_0.9.1_amd64.deb
sudo dpkg -i bottom_0.9.1_amd64.deb sudo dpkg -i bottom_0.9.1_amd64.deb
rm ~/bottom_0.9.1_amd64.deb rm ~/bottom_0.9.1_amd64.deb
# Install go # Install go
printf -- '\033[33m Installing go\n\033[37m' printf -- '\033[33m Installing go\n\033[37m'
sudo apt install -y golang sudo apt install -y golang
# Install php # Install php
printf -- '\033[33m Installing php\n\033[37m' printf -- '\033[33m Installing php\n\033[37m'
sudo apt install -y php php-curl php-xml php-mbstring sudo apt install -y php php-curl php-xml php-mbstring
# Install luarocks # Install luarocks
printf -- '\033[33m Installing luarocks\n\033[37m' printf -- '\033[33m Installing luarocks\n\033[37m'
sudo apt install -y luarocks sudo apt install -y luarocks
# Install composer # Install composer
printf -- '\033[33m Installing composer\n\033[37m' printf -- '\033[33m Installing composer\n\033[37m'
sudo apt install -y composer sudo apt install -y composer
# Install java # Install java
printf -- '\033[33m Installing java\n\033[37m' printf -- '\033[33m Installing java\n\033[37m'
sudo apt install -y default-jdk sudo apt install -y default-jdk
# Install julia # Install julia
printf -- '\033[33m Installing julia\n\033[37m' printf -- '\033[33m Installing julia\n\033[37m'
wget https://julialang-s3.julialang.org/bin/linux/x64/1.9/julia-1.9.0-linux-x86_64.tar.gz wget https://julialang-s3.julialang.org/bin/linux/x64/1.9/julia-1.9.0-linux-x86_64.tar.gz
tar -xvzf julia-1.9.0-linux-x86_64.tar.gz tar -xvzf julia-1.9.0-linux-x86_64.tar.gz
sudo cp -r julia-1.9.0 /opt/ sudo cp -r julia-1.9.0 /opt/
sudo ln -sf /opt/julia-1.9.0/bin/julia /usr/local/bin/julia sudo ln -sf /opt/julia-1.9.0/bin/julia /usr/local/bin/julia
rm julia-1.9.0-linux-x86_64.tar.gz* rm julia-1.9.0-linux-x86_64.tar.gz*
rm -rf julia-1.9.0 rm -rf julia-1.9.0
# Install node # Install node
printf -- '\033[33m Installing node\n\033[37m' printf -- '\033[33m Installing node\n\033[37m'
cd ~ cd ~
curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash - curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt install -y nodejs sudo apt install -y nodejs
# Install platformio # Install platformio
printf -- '\033[33m Installing platformio\n\033[37m' printf -- '\033[33m Installing platformio\n\033[37m'
pip3 install platformio pip3 install platformio
# Install pynvim # Install pynvim
printf -- '\033[33m Installing pynvim\n\033[37m' printf -- '\033[33m Installing pynvim\n\033[37m'
pip3 install pynvim pip3 install pynvim
# Install neovim for node # Install neovim for node
printf -- '\033[33m Installing neovim for node\n\033[37m' printf -- '\033[33m Installing neovim for node\n\033[37m'
sudo npm install -g neovim sudo npm install -g neovim
# Symlink nvim config # Symlink nvim config
printf -- '\033[33m Symlinking nvim config\n\033[37m' printf -- '\033[33m Symlinking nvim config\n\033[37m'
mkdir -p ~/.config/nvim mkdir -p ~/.config/nvim
ln -sf ~/code_server/config/nvim/init.lua ~/.config/nvim/init.lua ln -sf ~/code_server/config/nvim/init.lua ~/.config/nvim/init.lua
# Symlink git config # Symlink git config
printf -- '\033[33m Symlinking git config\n\033[37m' printf -- '\033[33m Symlinking git config\n\033[37m'
ln -sf ~/code_server/gitconfig ~/.gitconfig ln -sf ~/code_server/gitconfig ~/.gitconfig
# Symlink tmux config # Symlink tmux config
printf -- '\033[33m Symlinking tmux config\n\033[37m' printf -- '\033[33m Symlinking tmux config\n\033[37m'
ln -sf ~/code_server/tmux.conf ~/.tmux.conf ln -sf ~/code_server/tmux.conf ~/.tmux.conf
# Symlink clang-format config # Symlink clang-format config
printf -- '\033[33m Symlinking clang-format config\n\033[37m' printf -- '\033[33m Symlinking clang-format config\n\033[37m'
ln -sf ~/code_server/clang-format ~/.clang-format ln -sf ~/code_server/clang-format ~/.clang-format
# Symlink lazygit config # Symlink lazygit config
printf -- '\033[33m Symlinking lazygit config\n\033[37m' printf -- '\033[33m Symlinking lazygit config\n\033[37m'
mkdir -p ~/.config/lazygit mkdir -p ~/.config/lazygit
ln -sf ~/code_server/config/lazygit/config.yml ~/.config/lazygit/config.yml ln -sf ~/code_server/config/lazygit/config.yml ~/.config/lazygit/config.yml
# Symlink luacheck config # Symlink luacheck config
printf -- '\033[33m Symlinking luacheck config\n\033[37m' printf -- '\033[33m Symlinking luacheck config\n\033[37m'
ln -sf ~/code_server/luacheckrc ~/.luacheckrc ln -sf ~/code_server/luacheckrc ~/.luacheckrc
# Symlink update script # Symlink update script
printf -- '\033[33m Symlinking update script\n\033[37m' printf -- '\033[33m Symlinking update script\n\033[37m'
mkdir -p ~/.local/bin mkdir -p ~/.local/bin
ln -sf ~/code_server/update_wrapper.sh ~/.local/bin/update ln -sf ~/code_server/update_wrapper.sh ~/.local/bin/update
# Symlink start script # Symlink start script
printf -- '\033[33m Symlinking start script\n\033[37m' printf -- '\033[33m Symlinking start script\n\033[37m'
ln -sf ~/code_server/start.sh ~/.start ln -sf ~/code_server/start.sh ~/.start
# Restore default .bashrc # Restore default .bashrc
printf -- '\033[33m Restoring default .bashrc\n\033[37m' printf -- '\033[33m Restoring default .bashrc\n\033[37m'
sudo /bin/cp /etc/skel/.bashrc ~/.bashrc sudo /bin/cp /etc/skel/.bashrc ~/.bashrc
# Add path to bashrc # Add path to bashrc
printf -- '\033[33m Adding path to bashrc\n\033[37m' printf -- '\033[33m Adding path to bashrc\n\033[37m'
echo 'PATH="$HOME/.local/bin:$HOME/.cargo/bin:$PATH"' >> ~/.bashrc echo 'PATH="$HOME/.local/bin:$HOME/.cargo/bin:$PATH"' >> ~/.bashrc
echo 'alias vi="nvim"' >> ~/.bashrc echo 'alias vi="nvim"' >> ~/.bashrc
echo 'alias vim="nvim"' >> ~/.bashrc echo 'alias vim="nvim"' >> ~/.bashrc
echo 'source ~/.fzf.bash' >> ~/.bashrc echo 'source ~/.fzf.bash' >> ~/.bashrc
# Add tmux/nvim autostart to bashrc # Add tmux/nvim autostart to bashrc
printf -- '\033[33m Adding tmux/nvim autostart to bashrc\n\033[37m' printf -- '\033[33m Adding tmux/nvim autostart to bashrc\n\033[37m'
echo "# TMUX" >> ~/.bashrc echo "# TMUX" >> ~/.bashrc
echo "if [[ ! \$TERM =~ screen ]]; then" >> ~/.bashrc echo "if [[ ! \$TERM =~ screen ]]; then" >> ~/.bashrc
echo "if which tmux >/dev/null 2>&1; then" >> ~/.bashrc echo "if which tmux >/dev/null 2>&1; then" >> ~/.bashrc
echo ' test -z "$TMUX" && (tmux attach || tmux new-session ~/.start)' >> ~/.bashrc echo ' test -z "$TMUX" && (tmux attach || tmux new-session ~/.start)' >> ~/.bashrc
echo "fi" >> ~/.bashrc echo "fi" >> ~/.bashrc
echo "fi" >> ~/.bashrc echo "fi" >> ~/.bashrc
printf -- '\033[32m \n\n***** Update complete! Please restart your terminal. *****\n\n\033[37m' printf -- '\033[32m \n\n***** Update complete! Please restart your terminal. *****\n\n\033[37m'