Skip to content
Draft
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
9 changes: 1 addition & 8 deletions .tmux.conf
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ bind-key -T copy-mode-vi C-j select-pane -D
bind-key -T copy-mode-vi C-k select-pane -U
bind-key -T copy-mode-vi C-l select-pane -R

set-window-option -g mode-keys vi
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel

## COLORSCHEME: gruvbox dark
set-option -g status "on"

Expand Down Expand Up @@ -69,9 +65,6 @@ set-window-option -g window-status-bell-style fg=colour235,bg=colour167 #bg, red
# Bind ']' to use pbbaste
#bind ] run "reattach-to-user-namespace pbpaste | tmux load-buffer - && tmux paste-buffer"

bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel

## Theme settings mixed with colors (unfortunately, but there is no cleaner way)
set-option -g status-justify "left"
set-option -g status-left-style "none"
Expand All @@ -83,5 +76,5 @@ set-window-option -g window-status-separator ""
set-option -g status-left "#[fg=colour246, bg=colour254] #S #[fg=colour241, bg=colour255, nobold, noitalics, nounderscore] CODESPACE "
set-option -g status-right "#[fg=colour246,bg=colour254] %b %e %l:%M %P #[fg=colour241, bg=colour255, nobold, noitalics, nounderscore] #[fg=colour246,bg=colour254] "

set-window-option -g window-status-current-format "#[fg=colour239, bg=colour31, :nobold, noitalics, nounderscore]#[fg=colour255, bg=colour31] #I#[fg=colour255, bg=colour31, bold] #W #[fg=colour109, bg=colour255, nobold, noitalics, nounderscore] "
set-window-option -g window-status-current-format "#[fg=colour239, bg=colour31, nobold, noitalics, nounderscore]#[fg=colour255, bg=colour31] #I#[fg=colour255, bg=colour31, bold] #W #[fg=colour109, bg=colour255, nobold, noitalics, nounderscore] "
set-window-option -g window-status-format "#[fg=colour237,bg=colour239,noitalics]#[fg=colour246,bg=colour254] #I#[fg=colour246, bg=colour254] #W #[fg=colour239, bg=colour255, noitalics] "
16 changes: 8 additions & 8 deletions forward-ports
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
#!/bin/bash
set -e

trap "trap - SIGTERM && kill -- -$$" SIGINT SIGTERM EXIT
trap 'trap - SIGTERM && kill -- -$$' SIGINT SIGTERM EXIT

CODESPACE=$(gh cs list | grep Available | tail -n 1 | cut -f1)

# Sync any command history
gh cs -c $CODESPACE cp -e 'remote:$HOME/.zsh_history' /tmp/codespace_zsh_history
gh cs -c "$CODESPACE" cp -e 'remote:$HOME/.zsh_history' /tmp/codespace_zsh_history

touch $HOME/codespace_zsh_history
touch "$HOME/codespace_zsh_history"
REMOTE_WC=$(wc -l /tmp/codespace_zsh_history | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' | cut -d' ' -f1)
LOCAL_WC=$(wc -l $HOME/codespace_zsh_history | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' | cut -d' ' -f1)
LOCAL_WC=$(wc -l "$HOME/codespace_zsh_history" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' | cut -d' ' -f1)
echo "REMOTE_WC: $REMOTE_WC"
echo "LOCAL_WC: $LOCAL_WC"

if [ "$REMOTE_WC" -gt "$LOCAL_WC" ]; then
echo "Downloaded remote command history"
cp -f /tmp/codespace_zsh_history $HOME/codespace_zsh_history
cp -f /tmp/codespace_zsh_history "$HOME/codespace_zsh_history"
else
echo "Uploaded command history"
gh cs -c $CODESPACE cp -e $HOME/codespace_zsh_history 'remote:$HOME/.zsh_history'
gh cs -c "$CODESPACE" cp -e "$HOME/codespace_zsh_history" 'remote:$HOME/.zsh_history'
fi

# To set up the ssh config, put something like this in ~/.ssh/config
Expand All @@ -41,10 +41,10 @@ fi

# go install github.com/lemonade-command/lemonade@latest

cat ~/.ssh/codespaces.template | sed "s/CODESPACENAME/$CODESPACE/g" > ~/.ssh/codespaces
sed "s/CODESPACENAME/$CODESPACE/g" ~/.ssh/codespaces.template > ~/.ssh/codespaces

ssh -NT -R 2489:localhost:2489 codespace -o ExitOnForwardFailure=yes &

lemonade server &

gh cs -c $CODESPACE ports forward 80:7777
gh cs -c "$CODESPACE" ports forward 80:7777
2 changes: 1 addition & 1 deletion g2
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

G2_INSTALL=/workspaces/g2/bash /workspaces/g2/bash/g2 $@
G2_INSTALL=/workspaces/g2/bash /workspaces/g2/bash/g2 "$@"
20 changes: 10 additions & 10 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#!/bin/bash

sudo chsh -s "$(which zsh)" "$(whoami)"
mkdir -p $HOME/bin
cp -rf $(pwd)/.zshrc $HOME/.zshrc
cp -rf $(pwd)/.tmux.conf $HOME/.tmux.conf
cp -rf $(pwd)/.config $HOME
cp -rf $(pwd)/gitconfig $HOME/.gitconfig
cp -rf $(pwd)/.oh-my-zsh $HOME
cp $(pwd)/tmux-url-select $HOME/bin
cp $(pwd)/files $HOME/bin/files
cp -f $(pwd)/g2 $HOME/bin/g2
mkdir -p "$HOME/bin"
cp -rf "$(pwd)/.zshrc" "$HOME/.zshrc"
cp -rf "$(pwd)/.tmux.conf" "$HOME/.tmux.conf"
cp -rf "$(pwd)/.config" "$HOME"
cp -rf "$(pwd)/gitconfig" "$HOME/.gitconfig"
cp -rf "$(pwd)/.oh-my-zsh" "$HOME"
cp "$(pwd)/tmux-url-select" "$HOME/bin"
cp "$(pwd)/files" "$HOME/bin/files"
cp -f "$(pwd)/g2" "$HOME/bin/g2"

git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install --all
Expand Down Expand Up @@ -37,7 +37,7 @@ sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.
/home/linuxbrew/.linuxbrew/bin/nvim --headless +PlugInstall +qall

# Setup CoC further
cd ~/.local/share/nvim/plugged/coc.nvim
cd ~/.local/share/nvim/plugged/coc.nvim || exit
npm install yarn
./node_modules/yarn/bin/yarn install

Expand Down
1 change: 0 additions & 1 deletion tmux-url-select
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ sub display_highlighted_buffer {
if ($i++ == $selection) {
$is_first_line = 1 if ($+[0] < $buffer_first_newline_position);
return ACTIVE_LINK_HIGHLIGHT."$1\033[0m";
return;
}
return NORMAL_LINK_HIGHLIGHT."$1\033[0m" if NORMAL_LINK_HIGHLIGHT;
return $1;
Expand Down