diff --git a/files/home/.aliases b/files/home/.aliases index 3561c0d..4bdde4c 100644 --- a/files/home/.aliases +++ b/files/home/.aliases @@ -9,6 +9,7 @@ alias zen='curl -s https://api.github.com/zen && echo' alias la='ls -la' alias vi='vim' alias copilot='gh copilot' +if [[ -z "${CODESPACES:-}" ]]; then cs() { local codespace="${1:-}" if [[ -z "$codespace" ]]; then @@ -27,6 +28,7 @@ cs() { fi return $rc } +fi alias colby='copilot --allow-all-tools --allow-all-paths' alias gs='git s' alias gd='git d' @@ -41,6 +43,7 @@ gb() { local b; b="$(git branch --all --sort=-committerdate --format='%(refname: glo() { git log --oneline --color --decorate | fzf --ansi --preview 'git show --color --stat {1}' --bind 'enter:become(echo {1})'; } f() { local f; f="$(fzf --preview 'head -100 {}')" && ${EDITOR:-vim} "$f"; } +if [[ -z "${CODESPACES:-}" ]]; then ssh() { local ssh_target="${@: -1}" [[ -n "$TMUX" ]] && tmux rename-window "ssh:$ssh_target" @@ -70,4 +73,5 @@ ssh() { return $rc } s() { local h; h="$(_dots_ssh_hosts | fzf)" && ssh "$h"; } +fi diff --git a/files/home/.profile b/files/home/.profile index f11dae2..1d28d35 100644 --- a/files/home/.profile +++ b/files/home/.profile @@ -2,7 +2,11 @@ export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}" export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}" export WORKSPACE="${WORKSPACE:-$HOME/Workspace}" -export DOTFILES="${DOTFILES:-$HOME/.dotfiles}" +if [[ -n "${CODESPACES:-}" ]]; then + export DOTFILES="${DOTFILES:-/workspaces/.codespaces/.persistedshare/dotfiles}" +else + export DOTFILES="${DOTFILES:-$HOME/.dotfiles}" +fi export EDITOR=vim export VISUAL=vim export PAGER=less diff --git a/files/home/.tmux.conf b/files/home/.tmux.conf index 8a299b4..d2ca48a 100644 --- a/files/home/.tmux.conf +++ b/files/home/.tmux.conf @@ -27,8 +27,8 @@ set -g set-clipboard on setw -g mode-keys vi bind -T copy-mode-vi v send -X begin-selection bind -T copy-mode-vi y send -X copy-pipe-and-cancel "pbcopy 2>/dev/null || xclip -selection clipboard 2>/dev/null || xsel --clipboard" -bind -T copy-mode-vi MouseDown1Pane send -X cancel -bind -T copy-mode-vi MouseDragEnd1Pane send -X copy-pipe-and-cancel "pbcopy 2>/dev/null || xclip -selection clipboard 2>/dev/null || xsel --clipboard" +bind -T copy-mode-vi MouseDown1Pane send -X clear-selection +bind -T copy-mode-vi MouseDragEnd1Pane send -X copy-pipe "pbcopy 2>/dev/null || xclip -selection clipboard 2>/dev/null || xsel --clipboard" # Splits bind | split-window -h -c "#{pane_current_path}" diff --git a/files/home/.zshrc b/files/home/.zshrc index add50f2..45b74ad 100644 --- a/files/home/.zshrc +++ b/files/home/.zshrc @@ -107,6 +107,7 @@ _dots_load_keybindings() { bindkey '^E' _dots_edit_widget # Ctrl+G: remote connect + if [[ -z "${CODESPACES:-}" ]]; then _dots_ssh_hosts() { local ssh_log="${XDG_DATA_HOME:-$HOME/.local/share}/ssh/log" local cs_cache="$_dots_cache_dir/codespaces" @@ -138,6 +139,7 @@ _dots_load_keybindings() { } zle -N _dots_ssh_widget bindkey '^G' _dots_ssh_widget + fi # Ctrl+F: find in files _dots_find_in_files_widget() { diff --git a/script/install b/script/install index eb7c0e5..ab1e004 100755 --- a/script/install +++ b/script/install @@ -160,7 +160,7 @@ run() { else time_color="$RED" fi - printf "\n${CYAN}>>> ${CYAN_BOLD}${script_name}, ${NC}" + printf "${CYAN}>>> ${CYAN_BOLD}${script_name}, ${NC}" printf "completed in ${time_color}${execution_ms_formatted}ms${NC}\n" done }