#!/usr/bin/env bash DEST=${1-/etc/skel} NEOVIDE_HOME=${DEST}/.config/neovide NEOVIDE_CONFIG=${NEOVIDE_HOME}/config.toml NVIM_HOME="${DEST}/.config/nvim" NVIM_PLUGINS_HOME=${NVIM_HOME}/lua/plugins mkdir -p "${NEOVIDE_HOME}" sudo apt update --qq sudo apt install -y curl \ gnupg ca-certificates git \ gcc-multilib g++-multilib cmake libssl-dev pkg-config \ libfreetype6-dev libasound2-dev libexpat1-dev libxcb-composite0-dev \ libbz2-dev libsndio-dev freeglut3-dev libxmu-dev libxi-dev libfontconfig1-dev \ libxcursor-dev printf "Using cargo to fetch, build and install, it's a rust thing." cargo install --git https://github.com/neovide/neovide conf_print_neovide_conf() { cat <<'EOF' backtraces-path = "${HOME}/.local/share/neovide/neovide_backtraces.log" # see below for the default platform specific location chdir = "/path/to/dir" fork = false frame = "full" # grid = "420x240" # mutually exclusive with `size` and `maximized` # size = "1200x800" # mutually exclusive with `grid` and `maximized` idle = true icon = "${HOME}/.local/share/nvim/lazy/neovide/assets/neovide.ico" maximized = false mouse-cursor-icon = "arrow" # "i-beam" neovim-bin = "/usr/bin/nvim" # in reality found dynamically on $PATH if unset no-multigrid = false opengl = false # macOS/Windows only # server = "/tmp/nvim.sock" # or "127.0.0.1:7777" srgb = false # platform-specific: false (Linux/macOS) or true (Windows) tabs = true title-hidden = false vsync = true # wayland-app-id = "neovide" wsl = false # x11-wm-class = "neovide" # x11-wm-class-instance = "neovide" [font] normal = [] # Will use the bundled Fira Code Nerd Font by default size = 14.0 [box-drawing] # "font-glyph", "native" or "selected-native" mode = "font-glyph" [box-drawing.sizes] default = [2, 4] # Thin and thick values respectively, for all sizes EOF } conf_print_neovide_conf | tee "${NEOVIDE_CONFIG}/neovide_config.toml" ## Font scaling t o match normal font size in neovide # vim.g.neovide_scale_factor controls the font scaling dynamically. # vim.g.neovide_increment_scale_factor sets the step size for scaling (e.g., 0.1 = 10% change per keypress). # vim.g.neovide_min_scale_factor and vim.g.neovide_max_scale_factor prevent extreme scaling. # Keymaps allow real-time adjustment using Ctrl+=, Ctrl+-, and Ctrl+0. conf_print_neovide_lua() { cat <", function() change_scale_factor(0.1) end, { desc = "Increase scale" }) vim.keymap.set("n", "", function() change_scale_factor(-0.1) end, { desc = "Decrease scale" }) vim.keymap.set("n", "", function() vim.g.neovide_scale_factor = 1.0 end, { desc = "Reset scale" }) -- Ctrl+Scrollwheel font size up/down like Nvy or VSCode. vim.keymap.set({ "n", "v" }, "", ":lua vim.g.neovide_scale_factor = vim.g.neovide_scale_factor + 0.1") vim.keymap.set({ "n", "v" }, "", ":lua vim.g.neovide_scale_factor = vim.g.neovide_scale_factor - 0.1") end, } EOF } conf_print_neovide_lua | tee "${NVIM_PLUGINS_HOME}/neovide_scaling.lua" conf_print_zsh_shell_wrapper() { cat <