wezterm-edit-helper: no more need to hack the env vars, thanks to direnv.vim

This commit is contained in:
Daniel Lundin 2024-05-29 20:51:30 +02:00
parent 4607390b2d
commit 22880f43ab
No known key found for this signature in database

View file

@ -18,33 +18,7 @@ fi
fre --store_name "edit-history" --add "$_file"
_nvim_socket="$XDG_RUNTIME_DIR/nvim-persistent.sock"
nvim --server "$_nvim_socket" --remote "$_file"
function _nvim_setenv() {
nvim --server "$_nvim_socket" --remote-expr "execute(\"let \$${1} = \\\"${2}\\\"\")" 2>&1 >/dev/null
}
_nvim_setenv AR "$AR"
_nvim_setenv AS "$AS"
_nvim_setenv BUILD_COMMAND "$BUILD_COMMAND"
_nvim_setenv CC "$CC"
_nvim_setenv CXX "$CXX"
_nvim_setenv GOFLAGS "$GOFLAGS"
_nvim_setenv GOPACKAGESDRIVER "$GOPACKAGESDRIVER"
_nvim_setenv LC_ALL "$LC_ALL"
_nvim_setenv LD "$LD"
_nvim_setenv NM "$NM"
_nvim_setenv NM "$NM"
_nvim_setenv OBJCOPY "$OBJCOPY"
_nvim_setenv OBJDUMP "$OBJDUMP"
_nvim_setenv PATH "$PATH"
_nvim_setenv RANLIB "$RANLIB"
_nvim_setenv READELF "$READELF"
_nvim_setenv RUST_SRC_PATH "$RUST_SRC_PATH"
_nvim_setenv SIZE "$SIZE"
_nvim_setenv STRIP "$STRIP"
nvim --server "$XDG_RUNTIME_DIR/nvim-persistent.sock" --remote "$_file"
# Wezterm: switch tab to nvim
printf "\033]1337;SetUserVar=%s=%s\007" nvim_activate $(date +%s | base64)