diff --git a/init.zsh b/init.zsh index 513e3ad..a10dc38 100644 --- a/init.zsh +++ b/init.zsh @@ -15,7 +15,7 @@ function load_plugin { } # cmd_exists function cmd_exists { - hash "${1}" >/dev/null 2>&1 + (( ${+commands[${1}]} )) } # source_user_file function source_user_file { @@ -116,7 +116,7 @@ if [[ -v NVIM ]]; then elif [[ "${is_in_distrobox}" == true ]]; then if [[ -v INSIDE_EMACS ]]; then [[ -z "${XDG_RUNTIME_DIR}" ]] && \ - export XDG_RUNTIME_DIR="/run/user/${UID}" + export XDG_RUNTIME_DIR="/run/user/1000" export EDITOR='distrobox-host-exec emacsclient -a nvim' alias emacs='distrobox-host-exec emacsclient -a nvim' else @@ -398,6 +398,8 @@ bindkey -M vicmd 'j' history-substring-search-down bindkey -M emacs '^P' history-substring-search-up bindkey -M emacs '^N' history-substring-search-down +cmd_exists fzf && source <(fzf --zsh) + # Only match at the beginning of the line HISTORY_SUBSTRING_SEARCH_PREFIXED="true" HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND=""