aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--codespace.sh51
-rw-r--r--config/nvim/init.lua6
-rwxr-xr-xinstall.sh10
3 files changed, 58 insertions, 9 deletions
diff --git a/codespace.sh b/codespace.sh
new file mode 100644
index 0000000..212d6dc
--- /dev/null
+++ b/codespace.sh
@@ -0,0 +1,51 @@
+#!/usr/bin/env bash
+
+if [ "$CODESPACES" != "true" ]; then
+ echo "ERROR: not in a codespace." >&2
+ exit 1
+fi
+
+if [ ! -x "$(command -v gh)" ]; then
+ echo "ERROR: missing \`gh\` command." >&2
+ exit 1
+fi
+
+instopt() {
+ local repo="$1"; shift
+ local bin="$1"; shift
+ local pat="$1"; shift
+
+ local name="$(basename "$repo")"
+ echo "### $name ###"
+ mkdir -p "/opt/$name"
+ pushd "/opt/$name" >/dev/null
+
+ gh release download -R "$repo" -p "$pat" --clobber
+ if [[ "$pat" =~ \.zip$ ]]; then
+ unzip -o $pat "$@" >/dev/null
+ else
+ tar -xvf $pat "$@" >/dev/null
+ fi
+
+ local linkname="$HOME/.local/bin/$(basename "$bin")"
+ if [[ ! -e "$linkname" ]]; then
+ ln -s "$(pwd)/$bin" "$linkname"
+ fi
+
+ popd >/dev/null
+}
+
+instopt burntsushi/ripgrep \
+ rg '*-x86_64-unknown-linux-musl.tar.gz' --strip-components=1
+instopt denoland/deno \
+ deno '*-x86_64-unknown-linux-gnu.zip'
+instopt junegunn/fzf \
+ fzf '*-linux_amd64.tar.gz'
+instopt neovim/neovim \
+ bin/nvim '*-linux64.tar.gz' --strip-components=1
+instopt sharkdp/bat \
+ bat '*-x86_64-unknown-linux-gnu.tar.gz' --strip-components=1
+instopt sharkdp/fd \
+ fd '*-x86_64-unknown-linux-gnu.tar.gz' --strip-components=1
+instopt zellij-org/zellij \
+ zellij '*-x86_64-unknown-linux-musl.tar.gz'
diff --git a/config/nvim/init.lua b/config/nvim/init.lua
index 4f520f6..fc69880 100644
--- a/config/nvim/init.lua
+++ b/config/nvim/init.lua
@@ -99,12 +99,8 @@ set.opts {
listchars = {tab = "» ", nbsp = "␣", trail = "·"},
tabstop = 4,
shiftwidth = 4,
+ background = "light"
}
-- TODO: make this prettier.
vim.cmd [[call matchadd('ColorColumn', '\%81v.')]]
-if vim.fn.has("mac") == 1 then
- set.opts {
- bg = "light"
- }
-end
diff --git a/install.sh b/install.sh
index 914714f..91cb3d0 100755
--- a/install.sh
+++ b/install.sh
@@ -19,9 +19,11 @@ dotlink() {
}
gitinst() {
- if [[ ! -e "$2" ]]; then
- local remote="https://github.com/$1"
- git clone "$remote" "$2"
+ local remote="https://github.com/$1"
+ local dst="$HOME/$2"
+
+ if [ ! -e "$dst" ]; then
+ git clone "$remote" "$dst"
else
echo "skipping $1: '$2' already exists." >&2
fi
@@ -33,7 +35,7 @@ dotlink "config/emacs"
dotlink "config/nvim"
gitinst \
"wbthomason/packer.nvim" \
- "$HOME/.local/share/nvim/site/pack/packer/start/packer.nvim"
+ ".local/share/nvim/site/pack/packer/start/packer.nvim"
if which nvim &>/dev/null; then
nvim --headless -c "autocmd User PackerComplete quitall" -c "PackerSync"