diff options
author | Toby Vincent <tobyv13@gmail.com> | 2022-08-23 13:44:58 -0500 |
---|---|---|
committer | Toby Vincent <tobyv13@gmail.com> | 2022-08-23 13:44:58 -0500 |
commit | 9309c2e3842fe1dd0b26566674ff0dc8ab7420a1 (patch) | |
tree | 440c5d4199e983edb019c6ca774c75b878c353a2 | |
parent | 0f1cc96cc3e8006184ba4b965ce2bb7060a97dc7 (diff) |
fix(zsh): fix type in output redirection
-rwxr-xr-x | tmux/.local/bin/tmux-sessionizer | 7 | ||||
-rw-r--r-- | wsl/.local/share/zsh-wsl/zsh-wsl.plugin.zsh | 2 | ||||
-rw-r--r-- | zsh/.config/zsh/.zshrc | 10 |
3 files changed, 9 insertions, 10 deletions
diff --git a/tmux/.local/bin/tmux-sessionizer b/tmux/.local/bin/tmux-sessionizer index 8750a4f..927fb41 100755 --- a/tmux/.local/bin/tmux-sessionizer +++ b/tmux/.local/bin/tmux-sessionizer @@ -1,11 +1,12 @@ -#!/usr/bin/env bash +#!/bin/sh +# shellcheck disable=2016 if [ "$#" -eq 1 ]; then selected="$1" else selected=$( find ~/src ~/.dotfiles -maxdepth 2 -type d,f -path '*/.git' -printf '%h\n' -prune | - xargs -I{} sh -c 'stat -c %Y:"{}" $XDG_DATA_HOME/nvim/sessions/$(echo "{}" | sed "s|/|%|g").vim || + xargs -I{} sh -c 'stat -c %Y:"{}" $XDG_DATA_HOME/nvim/sessions/$(echo "{}" | sed "s|/|%|g").vim || (git -C "{}" rev-parse HEAD &>/dev/null && git -C "{}" --no-pager log -1 --all --format="%at:{}" 2>/dev/null || stat -c %Y:"{}" "{}"/.git)' | sort -r | cut -d':' -f2- | @@ -20,7 +21,7 @@ fi selected_name=$(basename "$selected" | tr . _) tmux_running=$(pgrep tmux) -if [[ -z $TMUX ]] && [[ -z $tmux_running ]]; then +if [ -z "$TMUX" ] && [ -z "$tmux_running" ]; then tmux new-session -s "$selected_name" -c "$selected" exit 0 fi diff --git a/wsl/.local/share/zsh-wsl/zsh-wsl.plugin.zsh b/wsl/.local/share/zsh-wsl/zsh-wsl.plugin.zsh index 247ef3c..69a3441 100644 --- a/wsl/.local/share/zsh-wsl/zsh-wsl.plugin.zsh +++ b/wsl/.local/share/zsh-wsl/zsh-wsl.plugin.zsh @@ -12,8 +12,6 @@ mkdir -p /tmp/xdg export DISPLAY="$(grep -m 1 nameserver /etc/resolv.conf | awk '{print $2}')":0 export BROWSER=wslview export XDG_RUNTIME_DIR=/tmp/xdg -# export GPG_AGENT_SOCK="$HOME/.gnupg/S.gpg-agent" -# export SSH_AUTH_SOCK="$HOME/.ssh/agent.sock" export GPG_TTY="$(tty)" alias wsl=wsl.exe diff --git a/zsh/.config/zsh/.zshrc b/zsh/.config/zsh/.zshrc index 36c6c64..0e6800d 100644 --- a/zsh/.config/zsh/.zshrc +++ b/zsh/.config/zsh/.zshrc @@ -59,15 +59,15 @@ export ZSH_AUTOSUGGEST_STRATEGY=(match_prev_cmd completion) # https://github.com/zsh-users/zsh-autosuggestions#suggestion-highlight-style export ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=#4f4738" -command -v fd >/dev/null 2&>1 && _fzf_compgen_path() { +command -v fd >/dev/null 2>&1 && _fzf_compgen_path() { fd --hidden --follow --exclude ".git" . "$1" } -command -v fd >/dev/null 2&>1 && _fzf_compgen_dir() { +command -v fd >/dev/null 2>&1 && _fzf_compgen_dir() { fd --type d --hidden --follow --exclude ".git" . "$1" } -command -v rga >/dev/null 2&>1 && rgi() { +command -v rga >/dev/null 2>&1 && rgi() { RG_PREFIX="rga --files-with-matches" local file file="$( @@ -81,5 +81,5 @@ command -v rga >/dev/null 2&>1 && rgi() { xdg-open "$file" } -command -v starship >/dev/null 2&>1 && source <(starship init zsh) -command -v sheldon >/dev/null 2&>1 && source <(sheldon source) +command -v starship >/dev/null 2>&1 && source <(starship init zsh) +command -v sheldon >/dev/null 2>&1 && source <(sheldon source) |