From f754f7762c45371674260a92367ba611f5ee4580 Mon Sep 17 00:00:00 2001 From: Eric Torres Date: Wed, 7 Dec 2022 18:22:35 -0800 Subject: [PATCH] Remove redundant zshrc code from os-specific config files --- zsh-linux/.config/zsh-linux/zshrc | 66 +------------------------------ zsh-macos/.config/zsh-macos/zshrc | 66 +------------------------------ 2 files changed, 2 insertions(+), 130 deletions(-) diff --git a/zsh-linux/.config/zsh-linux/zshrc b/zsh-linux/.config/zsh-linux/zshrc index bc72c77..26f4ca2 100755 --- a/zsh-linux/.config/zsh-linux/zshrc +++ b/zsh-linux/.config/zsh-linux/zshrc @@ -1,65 +1 @@ -# User-specific zsh configuration - -# Default umask value -umask 0027 - -# ========== Functions ========== -# Fuzzy-find a file and open it in less -_run_fless() { - fless && zle reset-prompt -} - -zle -N _run_fless -bindkey -M viins '^n' _run_fless - -# Fuzzy find a file and then edit it - -_run_fedit() { - fedit && zle reset-prompt -} - -_run_etcedit() { - fedit --etc && zle reset-prompt -} - -zle -N _run_fedit -bindkey -M viins '^o' _run_fedit - -zle -N _run_etcedit -bindkey -M viins '^e' _run_etcedit - -# Fuzzy cd from anywhere -# Dependencies -# * fzf -# * mlocate - -cf() { - [[ -z "${*}" ]] && return 1 - [[ ! -x $(which fzf) ]] && return 1 - - #dir="$(locate --all --ignore-case --null -- "${@}" | fzf --read0 --select-1 --exit-0)" - #dir="$(locate -0i -- "${@}" | fzf --read0 --select-1 --exit-0)" - dir="$(fd --ignore-file "${XDG_CONFIG_HOME}/fd_ignore" --print0 --type d -- "${@}" | fzf --read0 --select-1 --exit-0)" - - [[ -z "${dir}" ]] && return 1 - - if [[ -f "${dir}" ]]; then - cd "${dir%/*}" - else - cd "${dir}" - fi -} - -autoload -Uz cf - -# Make a directory, then change into it - -mkcd() { - [[ ! -d "${1}" ]] && mkdir --parents -- "${1}" - cd "${1}" || exit -} - -autoload -Uz mkcd - -[ -f "${ZDOTDIR}/conf.d/fzf.zsh" ] && source "${ZDOTDIR}/conf.d/fzf.zsh" -test -e /Users/etorres/.config/zsh/.iterm2_shell_integration.zsh && source /Users/etorres/.config/zsh/.iterm2_shell_integration.zsh || true +# Linux-specific zsh configuration diff --git a/zsh-macos/.config/zsh-macos/zshrc b/zsh-macos/.config/zsh-macos/zshrc index 7b5f8b6..c266ba5 100755 --- a/zsh-macos/.config/zsh-macos/zshrc +++ b/zsh-macos/.config/zsh-macos/zshrc @@ -1,65 +1 @@ -# User-specific zsh configuration - -# Default umask value -umask 0027 - -# ========== Functions ========== -# Fuzzy-find a file and open it in less -_run_fless() { - fless && zle reset-prompt -} - -zle -N _run_fless -bindkey -M viins '^n' _run_fless - -# Fuzzy find a file and then edit it - -_run_fedit() { - fedit && zle reset-prompt -} - -_run_etcedit() { - fedit --etc && zle reset-prompt -} - -zle -N _run_fedit -bindkey -M viins '^o' _run_fedit - -zle -N _run_etcedit -bindkey -M viins '^e' _run_etcedit - -# Fuzzy cd from anywhere -# Dependencies -# * fzf -# * mlocate - -cf() { - [[ -z "${*}" ]] && return 1 - [[ ! -x $(which fzf) ]] && return 1 - - #dir="$(locate --all --ignore-case --null -- "${@}" | fzf --read0 --select-1 --exit-0)" - #dir="$(locate -0i -- "${@}" | fzf --read0 --select-1 --exit-0)" - dir="$(fd --ignore-file "${XDG_CONFIG_HOME}/fd_ignore" --print0 --type d -- "${@}" | fzf --read0 --select-1 --exit-0)" - - [[ -z "${dir}" ]] && return 1 - - if [[ -f "${dir}" ]]; then - cd "${dir%/*}" - else - cd "${dir}" - fi -} - -autoload -Uz cf - -# Make a directory, then change into it - -mkcd() { - [[ ! -d "${1}" ]] && gmkdir --parents -- "${1}" - cd "${1}" || exit -} - -autoload -Uz mkcd - -[ -f "${ZDOTDIR}/conf.d/fzf.zsh" ] && source "${ZDOTDIR}/conf.d/fzf.zsh" -test -e /Users/etorres/.config/zsh/.iterm2_shell_integration.zsh && source /Users/etorres/.config/zsh/.iterm2_shell_integration.zsh || true +# macOS-specific zsh configuration