1
0
Fork 0

zsh: fix in-nvim detection

This commit is contained in:
tastytea 2022-08-30 22:23:45 +02:00
parent 80961265ea
commit 9ac5d0065f
Signed by: tastytea
SSH Key Fingerprint: SHA256:FBkvrOlhq5use1XEttyUGT4bUTDVA1ar9SgIc9P03cM
2 changed files with 8 additions and 7 deletions

View File

@ -18,13 +18,8 @@ fi
# Set preferred editor.
if type nvim >& -; then
if [[ -v ${NVIM} ]]; then
# Open files from :terminal in parent instance
VISUAL="${VISUAL} --server ${NVIM} --remote"
else
local sockdir="${XDG_RUNTIME_DIR:-${XDG_STATE_HOME:-${HOME}/.local/state}}"
VISUAL="$(command -v nvim) --server ${sockdir}/nvim.sock"
fi
local sockdir="${XDG_RUNTIME_DIR:-${XDG_STATE_HOME:-${HOME}/.local/state}}"
VISUAL="$(command -v nvim) --server ${sockdir}/nvim.sock"
elif command -v emacsclient > /dev/null; then
# Add Defaults env_keep += "SSH_CONNECTION" to /etc/sudoers.d/ssh_vars
export EMACS_SOCKET_NAME="${HOME}/.emacs.d/server/server"

View File

@ -134,6 +134,12 @@ fi
[[ ${COLORTERM} == *(truecolor|24bit)* ]] && export NVIM_TUI_ENABLE_TRUE_COLOR=1
# Open files from :terminal in parent instance
if [[ -v NVIM ]]; then
export VISUAL="$(command -v nvim) --server ${NVIM} --remote"
export EDITOR=${VISUAL}
fi
export GPG_TTY=$(tty)
case ${TERM} in