diff options
| -rwxr-xr-x | compile/oksh.sh | 31 | ||||
| -rwxr-xr-x | distro/arch-install.sh | 77 | ||||
| -rwxr-xr-x | distro/arch.sh | 269 | ||||
| -rw-r--r-- | distro/devuan.sh | 227 | ||||
| -rw-r--r-- | dotfiles/nvim/nvim0.12.lua | 145 | ||||
| -rwxr-xr-x | install.sh | 6 | ||||
| -rw-r--r-- | kshrc | 13 |
7 files changed, 706 insertions, 62 deletions
diff --git a/compile/oksh.sh b/compile/oksh.sh new file mode 100755 index 0000000..1a44c0f --- /dev/null +++ b/compile/oksh.sh @@ -0,0 +1,31 @@ +#!/bin/sh +set -ex +codedir="$HOME/scm/pub" +okshdir="${codedir}/ibara-oksh" +if ! [ -d "$okshdir" ] ; then + git clone https://github.com/ibara/oksh "$okshdir" +fi +cd "$okshdir" +git checkout oksh-7.6 +./configure +make +sudo make install +cd - + +if ! grep /usr/local/bin/oksh /etc/shells ; then + sudo sh -c 'echo /usr/local/bin/oksh >> /etc/shells' +fi + +if ! grep -qF 'export ENV=$HOME/.kshrc' ~/.profile; then + echo 'export ENV=$HOME/.kshrc' >> ~/.profile +fi + +set +x +if ! grep ^$(id -un) /etc/passwd | grep /usr/local/bin/oksh ; then + printf "Change shell to oksh? [y]es/[n]o: " + read -r resp + if [ "$resp" = "y" ] ; then + chsh -s /usr/local/bin/oksh + fi +fi +set -x diff --git a/distro/arch-install.sh b/distro/arch-install.sh new file mode 100755 index 0000000..6cfb095 --- /dev/null +++ b/distro/arch-install.sh @@ -0,0 +1,77 @@ +#!/bin/sh +set -ex + +do_edit() { +printf "Edit \"$1\" ? : " +read -r resp +case $resp in + Y|y) arch-chroot "${_install_path}" nvim "$1" ;; + *) ;; +esac +} + +do_chroot() { + arch-chroot "$_install_path" "$@" +} + +_install_path="${INSTALL_PATH:-/mnt}" +_tz="${TZ:-America/New_York}" +_hostname="${INSTALL_HOSTNAME:-arch}" +PACSTRAP="${PACSTRAP:-1}" + +set +x +if ! awk '{print $2}' /proc/mounts | grep -q '^'"$_install_path"'$' ; then + echo "Cannot install to \"$_install_path\" because it is not a mountpoint" + echo "if you've mounted somewhere other than /mnt use:" + echo " env INSTALL_PATH=<path> ./arch-install.sh" + echo where '<path>' is the mount point in question + exit 1 +fi +set -x + +if [ $PACSTRAP -eq 1 ] ; then +pacstrap -K "$_install_path" \ + arch-install-scripts \ + base \ + base-devel \ + cryptsetup \ + dosfstools \ + e2fsprogs \ + efibootmgr \ + git \ + gptfdisk \ + grub \ + linux \ + linux-firmware \ + linux-firmware-marvell \ + lvm2 \ + networkmanager \ + nvim \ + sof-firmware \ + tmux \ + xfsprogs \ + +fi + + +genfstab -U "$_install_path" >> "${_install_path}/etc/fstab" + +do_edit /etc/fstab + +do_edit /etc/locale.gen + +do_chroot locale-gen + +do_chroot ln -sf "/usr/share/zoneinfo/$_tz" /etc/localtime + +do_edit /etc/mkinitcpio.conf + +do_chroot mkinitcpio -p linux + +do_edit /etc/default/grub + +do_chroot grub-install --target=x86_64-efi --removable --efi-directory=/boot/efi + +do_chroot grub-mkconfig -o /boot/grub/grub.cfg + +do_chroot passwd diff --git a/distro/arch.sh b/distro/arch.sh index 55e0a31..72b5db4 100755 --- a/distro/arch.sh +++ b/distro/arch.sh @@ -1,16 +1,38 @@ #!/bin/sh set -e -if [ "$(id -u)" -ne 0 ] ; then - echo "Run as root" +if [ "$(id -u)" -eq 0 ] ; then + echo "Run as normal user w/ sudo access" exit 1; fi +codedir="$HOME/scm" +okshdir="${codedir}/pub/ibara-oksh" +rivercfgdir="${codedir}/wl/rivercfg" +yaydir="${codedir}/pub/yay" + +GRAPHICS="${GRAPHICS:-yes}" +THUNDERBOLT="${THUNDERBOLT:-yes}" +PACKAGES="${PACKAGES:-yes}" +FONTS="${FONTS:-yes}" +YAY="${YAY:-yes}" +BRAVE="${BRAVE:-yes}" +OKSH="${OKSH:-yes}" +RIVER="${RIVER:-yes}" +V4L2LOOPBACK="${V4L2LOOPBACK:-yes}" +LOGIND="${LOGIND:-yes}" +DWM="${DWM:-no}" +DPW="${DPW:-yes}" + +dpwdir="${codedir}/me/dpw" +dwmdir="${codedir}/x/dwm" +dwmStdir="${codedir}/x/st" +dwmDmenudir="${codedir}/x/dmenu" +dwmSesdir="${codedir}/x/session" + pkgs=" alsa-utils ansible arandr -avr-gcc -avr-libc base base-devel bind @@ -23,7 +45,6 @@ chromium cmake colordiff ctags -docker dosfstools dunst ed @@ -32,6 +53,7 @@ ethtool evince evolution exfat-utils +fastfetch feh firefox fuse @@ -41,25 +63,18 @@ gdisk gimp git git-lfs -gpa hdparm htop inkscape iotop iperf3 -jdk11-openjdk -jdk8-openjdk kdenlive +less libconfig # dmenu-pinentry libfido2 libvirt # If you want libxcb libxkbcommon -lightdm -lightdm-gtk-greeter -linux -linux-firmware -linux-zen lvm2 lxappearance man-pages @@ -70,7 +85,6 @@ multipath-tools # kpartx ncdu ncmpc ncspot -neofetch neovim net-tools networkmanager @@ -101,17 +115,15 @@ qemu qt5ct # https://wiki.archlinux.org/title/qt#Appearance rclone redshift -rlwrap # used for clj +ripgrep rsync scrot +sddm seahorse shellcheck -shellcheck -sipcalc smartmontools speedtest-cli swig # ykman -the_silver_searcher tmux usbutils v4l2loopback-dkms @@ -123,7 +135,9 @@ whois wireguard-tools wireless_tools wl-clipboard -wlroots +wlroots0.17 +wlroots0.18 +wlroots0.19 xclip xdotool xfce4 @@ -140,58 +154,195 @@ zathura-ps zstd " +if [ "$PACKAGES" = "yes" ] ; then #shellcheck disable=SC2046 -pacman -S --needed $(echo "$pkgs" | awk '{print $1}' | tr '\n' ' ') +sudo pacman -S --needed $(echo "$pkgs" | awk '{print $1}' | tr '\n' ' ') +fi +if [ "$LOGIND" = "yes" ] ; then fn="/etc/systemd/logind.conf" bak="$fn.$(date +%s)" -cp "$fn" "$bak" -ed "$fn" <<EOF -/^\[Login -/^KillUserProcesses= -d -i -KillUserProcesses=yes -. -/^HandleLidSwitch= -d -i -HandleLidSwitch=ignore -. -w -q -EOF -if diff -q "$fn" "$bak" >/dev/null ; then - rm "$bak" +sudo cp "$fn" "$bak" +sudo sed -i -E -e 's/^.*KillUserProcesses=.*$/KillUserProcesses=yes/g' "$fn" +sudo sed -i -E -e 's/^.*HandleLidSwitch=.*$/HandleLidSwitch=ignore/g' "$fn" +if sudo diff -q "$fn" "$bak" >/dev/null ; then + sudo rm "$bak" +fi fi +grep -q '^KillUserProcesses=yes' /etc/systemd/logind.conf || \ + echo "You may want to set KillUserProcesses=yes in /etc/systemd/logind.conf" +grep -q '^HandleLidSwitch=ignore' /etc/systemd/logind.conf || \ + echo "You may want to set HandleLidSwitch=ignore in /etc/systemd/logind.conf" -cat > /etc/udev/rules.d/99-removable.rules <<EOF +if [ "$THUNDERBOLT" = "yes" ] ; then +sudo sh -c 'cat > /etc/udev/rules.d/99-removable.rules <<EOF # /etc/udev/rules.d/99-removable.rules ACTION=="add", SUBSYSTEM=="thunderbolt", ATTR{authorized}=="0", ATTR{authorized}="1" -EOF - +EOF' +fi -cat > /etc/pacman.d/hooks/95-bootbackup.hook <<EOF -# /etc/pacman.d/hooks/95-bootbackup.hook -[Trigger] -Operation = Upgrade -Operation = Install -Operation = Remove -Type = Path -Target = usr/lib/modules/*/vmlinuz - -[Action] -Depends = rsync -Description = Backing up /boot... -When = PostTransaction -Exec = /bin/sh -c 'tar -C / -cf /.bootbackup."\$(date +%m.%d.%Y)".tar boot' -EOF -cat > /etc/modprobe.d/v4l2loopback.conf <<EOF +if [ "$V4L2LOOPBACK" = yes ] ; then +sudo sh -c 'cat > /etc/modprobe.d/v4l2loopback.conf <<EOF options v4l2loopback video_nr=10,11,12 card_label="OBS Virtual Camera,Extra Loopback 1,Extra Loopback 2" -EOF +EOF' -cat > /etc/modules-load.d/v4l2loopback.conf <<EOF +sudo sh -c 'cat > /etc/modules-load.d/v4l2loopback.conf <<EOF v4l2loopback +EOF' +fi + +if [ "$OKSH" = yes ] ; then + if ! [ -d "$okshdir" ] ; then + git clone https://github.com/ibara/oksh "$okshdir" + fi + cd "$okshdir" + git checkout oksh-7.6 + ./configure + make + sudo make install + cd - + + if ! grep /usr/local/bin/oksh /etc/shells ; then + sudo sh -c 'echo /usr/local/bin/oksh >> /etc/shells' + fi + + if ! grep -qF 'export ENV=$HOME/.kshrc' ~/.profile; then + echo 'export ENV=$HOME/.kshrc' >> ~/.profile + fi + + set +x + if ! grep "^$(id -un)" /etc/passwd | grep /usr/local/bin/oksh ; then + printf "Change shell to oksh? [y]es/[n]o: " + read -r resp + if [ "$resp" = "y" ] ; then + chsh -s /usr/local/bin/oksh + fi + fi + set -x + + +fi + +if [ "$FONTS" = yes ] ; then + if ! [ -d ~/.fonts ]; then + git clone https://git.riedstra.dev/mitch/fonts ~/.fonts + fi +fi + +if [ "$RIVER" = yes ] ; then + if ! [ -d "$rivercfgdir" ] ; then + git clone https://git.riedstra.dev/wl/rivercfg "$rivercfgdir" + fi + cd "$rivercfgdir" + sudo pacman -S river foot swaylock waybar wlr-randr bemenu bemenu-wayland swaybg grim slurp + ./link.sh + cd - + + wlcustomdir="$rivercfgdir"/../wlcustom + if ! [ -d "$wlcustomdir" ] ; then + git clone https://git.riedstra.dev/wl/wlcustom "$wlcustomdir" + fi + cd "$wlcustomdir" + sudo make install + cd - +fi + +if [ "$DPW" = yes ] ; then + if ! [ -d "$dpwdir" ] ; then + git clone https://git.riedstra.dev/mitch/dpw "$dpwdir" + fi + cd "$dpwdir" + make PREFIX="$HOME" install + cd - +fi + +if [ "$YAY" = yes ] ; then + if ! [ -d "$yaydir" ] ; then + git clone https://aur.archlinux.org/yay.git "$yaydir" + fi + cd "$yaydir" + yay --version || makepkg -si + cd - +fi + +if [ "$BRAVE" = yes ] ;then +if [ "$YAY" == yes ] ; then + yay -Sy brave-bin +else + echo "You need to install yay ( env YAY=yes ./distro/arch.sh or so )" + echo "In order to install brave via this script" +fi +fi + + +if [ "$DWM" = yes ] ; then + sudo pacman -S picom + + if ! [ -d "$dwmdir" ] ; then + git clone https://git.riedstra.dev/x/dwm "$dwmdir" + fi + cd "$dwmdir" + make + sudo make clean install + cd - + + if ! [ -d "$dwmStdir" ] ; then + git clone https://git.riedstra.dev/x/st "$dwmStdir" + fi + cd "$dwmStdir" + make + sudo make clean install + cd - + + if ! [ -d "$dwmDmenudir" ] ; then + git clone https://git.riedstra.dev/x/dmenu "$dwmDmenudir" + fi + cd "$dwmDmenudir" + make + sudo make clean install + cd - + + if ! [ -d "$dwmSesdir" ] ; then + git clone https://git.riedstra.dev/x/session "$dwmSesdir" + fi + cd "$dwmSesdir" + sudo make install + cd - + + if ! [ -f ~/.xinitrc ] ; then +cat > ~/.xinitrc <<EOF +export ENV=\$HOME/.kshrc +export SSH_ASKPASS=dmenu_askpass +xsetroot -grey & +xset r rate 300 50 & +dwm EOF + chmod +x ~/.xinitrc + fi + +fi + + +if [ "$GRAPHICS" = yes ] ; then +case $(lspci | grep VGA) in + *Intel*) + # OpenCL Drivers + pacman -S --needed intel-compute-runtime + ;; + *AMD*) + # OpenCL Drivers + echo "Note ROCM isn't supported by all AMD GPUs" + pacman -S --needed rocm-opencl-runtime + ;; + *Nvidia*) + echo "Note older GPUs need 'nvidia' and/or 'nvidia-lts' instead of nvidia-open" + pacman -S --needed nvidia-open nvidia-open-lts nvidia-utils opencl-nvidia + ;; + *) + echo "No GPU detected" +esac +fi + +echo "You may wish to run systemctl enable sddm if you haven't already" diff --git a/distro/devuan.sh b/distro/devuan.sh new file mode 100644 index 0000000..9824f20 --- /dev/null +++ b/distro/devuan.sh @@ -0,0 +1,227 @@ +#!/bin/sh +# distro/devuan.sh +echo "This script is designed to be run twice, once as root ( e.g. 'su -' )" +echo "Then again as your normal user without sudo, it will call sudo as needed" +if [ "$(id -u)" -eq 0 ] ; then + if ! grep -q 'EDITOR=' ~/.bashrc ; then + echo "EDITOR=vi" >> ~/.bashrc + fi + echo '%sudo ALL=(ALL:ALL) ALL' > /etc/sudoers.d/sudo_enable + printf "Enter username to add to sudo group (enter to skip): " + read -r _un + if ! [ -z "$_un" ] ; then + gpasswd -a "$_un" sudo + else + echo skipping... + fi + touch /etc/.sudo_configured + echo "now run as a regular user" + exit 0 +else + if ! [ -r /etc/.sudo_configured ] ; then + echo "Run as root first, then as a regular user" + exit 1 + fi +fi +set -ex + +codedir="$HOME/scm/pub" +nvimdir="${codedir}/neovim-nvim" +_nvim_msg=0 +okshdir="${codedir}/ibara-oksh" + +dwmdir="${codedir}/x/dwm" +dwmStdir="${codedir}/x/st" +dwmDmenudir="${codedir}/x/dmenu" +dwmSesdir="${codedir}/x/session" + +BRAVE="${BRAVE:-yes}" +NVIM="${NVIM:-yes}" +OKSH="${OKSH:-yes}" +PACKAGES="${PACKAGES:-yes}" +FONTS="${FONTS:-yes}" +DWM="${DWM:-no}" +RUSTICL="${RUSTICL:-yes}" +THUNDERBOLT="${THUNDERBOLT:-yes}" + + + +if [ "$PACKAGES" = yes ] ; then +# Get rid of the CDROM source, lol +sudo sed -i '/cdrom:/d' /etc/apt/sources.list + +sudo apt update + +sudo apt install -y git curl \ + tmux \ + htop \ + neofetch \ + oathtool \ + pavucontrol \ + scdaemon \ + vim \ + evemu-tools \ + evtest \ + libarchive-tools \ + evolution \ + gimp \ + git-lfs \ + ncdu \ + nload \ + pv \ + pwgen \ + ripgrep \ + wireguard-tools \ + zstd \ + dunst \ + xclip \ + restic \ + tree \ + feh \ + sipcalc \ + bluez-alsa-utils \ + bluez-firmware \ + pulseaudio-module-bluetooth \ + + +fi + +if [ "$THUNDERBOLT" = "yes" ] ; then +cat > /etc/udev/rules.d/99-removable.rules <<EOF +# /etc/udev/rules.d/99-removable.rules +ACTION=="add", SUBSYSTEM=="thunderbolt", ATTR{authorized}=="0", ATTR{authorized}="1" +EOF +fi + +if [ "$RUSTICL" = "yes" ] ; then + sudo apt install -y \ + mesa-opencl-icd + + printf "\033[1;32m" + echo "Note, for GPU accelerated darktable with RustiCL you may need to:" + echo "export RUSTICL_ENABLE=radeonsi; darktable -d opencl" + echo "or similar, for intel change radeonsi to 'iris'" + printf "\033[0m" +fi + +if [ "$NVIM" = yes ] ; then + sudo apt build-dep -y neovim + + if ! [ -d "$nvimdir" ] ; then + git clone https://github.com/neovim/neovim "$nvimdir" + fi + cd "$nvimdir" + git fetch --force --tags + git checkout v0.11.2 + rm -rf build || echo "" + make CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX=$HOME/.local" -j"$(nproc)" + make install + cd - + + _paq_dir="${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/pack/paqs/start/paq-nvim + if ! [ -d "$_paq_dir" ] ; then + git clone --depth=1 https://github.com/savq/paq-nvim.git "$_paq_dir" + _nvim_msg=1 + fi +fi + +if [ "$OKSH" = yes ] ; then + if ! [ -d "$okshdir" ] ; then + git clone https://github.com/ibara/oksh "$okshdir" + fi + cd "$okshdir" + git checkout oksh-7.6 + ./configure + make + sudo make install + cd - + + if ! grep /usr/local/bin/oksh /etc/shells ; then + sudo sh -c 'echo /usr/local/bin/oksh >> /etc/shells' + fi + + if ! grep -qF 'export ENV=$HOME/.kshrc' ~/.profile; then + echo 'export ENV=$HOME/.kshrc' >> ~/.profile + fi + + set +x + if ! grep ^$(id -un) /etc/passwd | grep /usr/local/bin/oksh ; then + printf "Change shell to oksh? [y]es/[n]o: " + read -r resp + if [ "$resp" = "y" ] ; then + chsh -s /usr/local/bin/oksh + fi + fi + set -x + + +fi + +if [ "$BRAVE" = yes ] ; then +sudo curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg \ + https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg + +sudo curl -fsSLo /etc/apt/sources.list.d/brave-browser-release.sources \ + https://brave-browser-apt-release.s3.brave.com/brave-browser.sources + +sudo apt update + +sudo apt install -y brave-browser + +fi + +if [ "$FONTS" = yes ] ; then + if ! [ -d ~/.fonts ]; then + git clone https://git.riedstra.dev/mitch/fonts ~/.fonts + fi + sudo rm /etc/fonts/conf.d/70-no-bitmaps.conf || echo "" +fi + +if [ "$DWM" = yes ] ; then + sudo apt -y install compton + sudo apt -y build-dep dwm st + + if ! [ -d "$dwmdir" ] ; then + git clone https://git.riedstra.dev/x/dwm "$dwmdir" + fi + cd "$dwmdir" + make + sudo make clean install + cd - + + if ! [ -d "$dwmStdir" ] ; then + git clone https://git.riedstra.dev/x/st "$dwmStdir" + fi + cd "$dwmStdir" + make + sudo make clean install + cd - + + if ! [ -d "$dwmDmenudir" ] ; then + git clone https://git.riedstra.dev/x/dmenu "$dwmDmenudir" + fi + cd "$dwmDmenudir" + make + sudo make clean install + cd - + + if ! [ -d "$dwmSesdir" ] ; then + git clone https://git.riedstra.dev/x/session "$dwmSesdir" + fi + cd "$dwmSesdir" + sudo make install + cd - + + if ! [ -f ~/.xinitrc ] ; then +cat > ~/.xinitrc <<EOF +export ENV=\$HOME/.kshrc +dwm +EOF + chmod +x ~/.xinitrc + fi + +fi + +if [ $_nvim_msg -eq 1 ] ; then + printf "\033[1;31m%s\033[0m\n" "You will need to run ':PacSync' in neovim" +fi diff --git a/dotfiles/nvim/nvim0.12.lua b/dotfiles/nvim/nvim0.12.lua new file mode 100644 index 0000000..b8346a1 --- /dev/null +++ b/dotfiles/nvim/nvim0.12.lua @@ -0,0 +1,145 @@ +-- Configuration for nvim 0.12+ +-- Not replacing my main configuration yet as this isn't released or +-- in any distribution package managers at the moment + +-- Themes +vim.pack.add({'https://github.com/shaunsingh/nord.nvim'}) +vim.pack.add({'https://github.com/ellisonleao/gruvbox.nvim'}) + +vim.pack.add({'https://github.com/nvim-treesitter/nvim-treesitter'}) + +-- Required for telescope +vim.pack.add({'https://github.com/nvim-lua/plenary.nvim'}) +vim.pack.add({'https://github.com/nvim-telescope/telescope.nvim'}) + +local hooks = function(ev) + local name, kind = ev.data.spec.name, ev.data.kind + + if name == 'nvim-treesitter' then + vim.system(":TSUpdate") + end +end + +vim.api.nvim_create_autocmd('PackChanged', {callback = hooks}) + +require'nvim-treesitter.configs'.setup { + hightlight = { + enable = true, + } +} + +-------------------------------------------------------------------------------- +-- telescope +-------------------------------------------------------------------------------- +vim.keymap.set('n', '<leader>?', require('telescope.builtin').oldfiles, { desc = '[?] Find recently opened files' }) +vim.keymap.set('n', '<leader>sb', require('telescope.builtin').buffers, { desc = '[ ] Find existing buffers' }) +vim.keymap.set('n', '<leader>/', function() + -- You can pass additional configuration to telescope to change theme, layout, etc. + require('telescope.builtin').current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { + winblend = 10, + previewer = false, + }) +end, { desc = '[/] Fuzzily search in current buffer]' }) + +vim.keymap.set('n', '<leader>sf', require('telescope.builtin').find_files, { desc = '[S]earch [F]iles' }) +vim.keymap.set('n', '<leader>sh', require('telescope.builtin').help_tags, { desc = '[S]earch [H]elp' }) +vim.keymap.set('n', '<leader>sw', require('telescope.builtin').grep_string, { desc = '[S]earch current [W]ord' }) +vim.keymap.set('n', '<leader>sg', require('telescope.builtin').live_grep, { desc = '[S]earch by [G]rep' }) +vim.keymap.set('n', '<leader>sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' }) +local builtin = require('telescope.builtin') +vim.keymap.set('n', '<C-p>', builtin.find_files, {}) +vim.keymap.set('n', '<C-o>', builtin.git_files, {}) +vim.keymap.set('n', '<leader>ps', function() + builtin.grep_string({ search = vim.fn.input("Grep > ") }) +end) +-------------------------------------------------------------------------------- + +-------------------------------------------------------------------------------- +-- Nord theme config +-------------------------------------------------------------------------------- +-- vim.g.nord_contrast = true +-- vim.g.nord_borders = false +vim.g.nord_disable_background = true +vim.g.nord_italic = false +-- vim.g.nord_uniform_diff_background = true +vim.g.nord_bold = false + +-- Load the colorscheme +require('nord').set() +-------------------------------------------------------------------------------- + + +-- "Basic" nvim config: + +vim.opt.nu = true +vim.opt.rnu = true + +vim.keymap.set("n", "<leader>l", function() vim.cmd('set list!') end) +vim.opt.listchars = 'tab:▸ ,eol:¬,trail:•' +-- vim.opt.listchars = 'tab:| ,eol:$,trail:.' + +-- tw == textwidth +vim.opt.tw = 80 +vim.opt.colorcolumn = "80" + +vim.opt.ic = true +vim.opt.hls = true + +vim.opt.scrolloff = 8 + +vim.opt.tabstop = 4 +vim.opt.softtabstop = 4 +vim.opt.shiftwidth = 4 +vim.opt.smartindent = true +vim.opt.expandtab = false +vim.opt.wrap = false + +-- I know how to setup my editor, I don't need your changes to my vim +-- configuration. +vim.opt.modeline = false + +-- Use \-s to pop open a spelling menu. use ]s to search forwards and [s to go +-- +-- backwards. +-- Apparently this also doesn't work if spell checking isn't enabled +-- at the time you enable it. +vim.opt.spell = true +vim.keymap.set("n", "<leader>ss", "ea<C-X><C-S>") +vim.opt.spell = false + + +-- Always show status line +vim.opt.laststatus = 2 + +-- Automatically keep window sizes equal and do it automatically +vim.cmd("set ea") +vim.cmd("autocmd VimResized * wincmd =") + + +vim.diagnostic.config({ + virtual_text = true, + signs = true, + underline = true, + -- update_in_insert = false, + severity_sort = true, +}) + + +-- For LSP, :help lsp-defaults can be useful to get the keybindings down + +-- clangd language server config... +-- 'bear' can be useful for generating compile_commands.json with clangd +vim.lsp.config['clangd'] = { + cmd = {'clangd'}, + filetypes = { 'c', 'cpp' }, + root_markers = {'compile_commands.json' }, +} +vim.lsp.enable('clangd') + + +vim.lsp.config['gopls'] = { + cmd = {'gopls'}, + filetypes = { 'go' }, + root_markers = {'go.mod' }, +} +vim.lsp.enable('gopls') @@ -39,6 +39,12 @@ if ! [ -d "$_nvimdir" ] ; then fi setLink -s "$(pwd)/dotfiles/nvim/init.lua" -d "$_nvimdir/init.lua" +_paq_dir="${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/pack/paqs/start/paq-nvim +if ! [ -d "$_paq_dir" ] ; then + git clone --depth=1 https://github.com/savq/paq-nvim.git "$_paq_dir" + printf "\033[1;31m%s\033[0m\n" "You will need to run ':PacSync' in neovim" +fi + _ghosttydir="$HOME/.config/ghostty" if ! [ -d "$_ghosttydir" ] ; then mkdir "$_ghosttydir" @@ -325,9 +325,9 @@ checkSSHAgentForward() { && [ -z "$TMUX" ] ; then echo "SSH_AUTH_SOCK=\"$SSH_AUTH_SOCK\"; export SSH_AUTH_SOCK" \ - > "$HOME"/.ssh/agent + > "$HOME"/.ssh/agent_conf elif [ -n "$TMUX" ]; then - . "$HOME"/.ssh/agent + . "$HOME"/.ssh/agent_conf fi } @@ -337,7 +337,14 @@ checkSSHAgent() { pkill -9 ssh-agent fi - ssh_agent_conf="$HOME/.ssh/agent" + # So OpenSSH 10.1 steps on my configuration, rather than passing in + # -T which doesn't exist on older SSH, simply move my configuration + # out of the way. + if [ -f "$HOME/.ssh/agent" ] ; then + rm "$HOME/.ssh/agent" + fi + + ssh_agent_conf="$HOME/.ssh/agent_conf" if [ -e "$ssh_agent_conf" ] ; then #shellcheck disable=SC1090 . "$ssh_agent_conf" |
