Fix remote copy / paste for nvim
This commit is contained in:
@@ -78,6 +78,7 @@ set -g detach-on-destroy off
|
||||
set -g extended-keys on
|
||||
set -g extended-keys-format csi-u
|
||||
set -g terminal-features[3] "xterm-kitty:extkeys"
|
||||
set -as terminal-features ",*:clipboard"
|
||||
set -sg escape-time 10
|
||||
|
||||
# Status bar
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
echo "Enable secure remote Neovim clipboard support"
|
||||
|
||||
nvim_config_dir="$HOME/.config/nvim"
|
||||
nvim_options="$nvim_config_dir/lua/config/options.lua"
|
||||
nvim_provider="$nvim_config_dir/lua/config/remote_clipboard.lua"
|
||||
|
||||
provider_source="/usr/share/omarchy-nvim/config/lua/config/remote_clipboard.lua"
|
||||
|
||||
if [[ -d $nvim_config_dir ]]; then
|
||||
mkdir -p "$(dirname "$nvim_provider")"
|
||||
install -m 0644 "$provider_source" "$nvim_provider"
|
||||
|
||||
if [[ -f $nvim_options ]] && ! grep -qF 'config.remote_clipboard' "$nvim_options"; then
|
||||
tmp=$(mktemp)
|
||||
{
|
||||
printf '%s\n' 'require("config.remote_clipboard").setup()'
|
||||
cat "$nvim_options"
|
||||
} >"$tmp"
|
||||
mv "$tmp" "$nvim_options"
|
||||
fi
|
||||
fi
|
||||
|
||||
tmux_config="$HOME/.config/tmux/tmux.conf"
|
||||
if [[ -f $tmux_config ]] && ! grep -Eq '(^|[[:space:],"])\*:clipboard([[:space:]",]|$)' "$tmux_config"; then
|
||||
printf '\n# Enable OSC 52 clipboard forwarding for remote Neovim yanks.\nset -as terminal-features ",*:clipboard"\n' >>"$tmux_config"
|
||||
fi
|
||||
Reference in New Issue
Block a user