When using vim over SSH with X11 forwarding (might require +clipboard), netrw is really sluggish, taking up to multiple seconds when opening a directory listing.
To Reproduce
:e .
to open the directory listing in netrwsteps 3 and 4 should be quite sluggish
Expected behavior
I expect netrw to be as quick as without X11 forwarding. If I unset DISPLAY before starting vim, netrw is fast.
Workaround
If I execute let @* = @*
and let @+ = @+
before opening netrw, netrw is fast. But I have to do this manually. Adding the commands to my vimrc does not fix the problem.
Environment:
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Oct 27 2020 11:26:41)
Included patches: 1-1911
Compiled by bs@bs2
Huge version with GTK2 GUI. Features included (+) or not (-):
+acl -farsi +mouse_sgr +tag_binary
+arabic +file_in_path -mouse_sysmouse -tag_old_static
+autocmd +find_in_path +mouse_urxvt -tag_any_white
+autochdir +float +mouse_xterm -tcl
-autoservername +folding +multi_byte +termguicolors
+balloon_eval -footer +multi_lang +terminal
+balloon_eval_term +fork() -mzscheme +terminfo
+browse +gettext +netbeans_intg +termresponse
++builtin_terms -hangul_input +num64 +textobjects
+byte_offset +iconv +packages +textprop
+channel +insert_expand +path_extra +timers
+cindent +ipv6 -perl +title
+clientserver +job +persistent_undo +toolbar
+clipboard +jumplist +popupwin +user_commands
+cmdline_compl +keymap +postscript +vartabs
+cmdline_hist +lambda +printer +vertsplit
+cmdline_info +langmap +profile +virtualedit
+comments +libcall -python +visual
+conceal +linebreak +python3/dyn +visualextra
+cryptv +lispindent +quickfix +viminfo
+cscope +listcmds +reltime +vreplace
+cursorbind +localmap +rightleft +wildignore
+cursorshape +lua -ruby +wildmenu
+dialog_con_gui +menu +scrollbind +windows
+diff +mksession +signs +writebackup
+digraphs +modify_fname +smartindent +X11
+dnd +mouse +sound -xfontset
-ebcdic +mouseshape +spell +xim
+emacs_tags +mouse_dec +startuptime +xpm
+eval +mouse_gpm +statusline +xsmp_interact
+ex_extra -mouse_jsbterm -sun_workshop +xterm_clipboard
+extra_search +mouse_netterm +syntax -xterm_save
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
system gvimrc file: "$VIM/gvimrc"
user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
defaults file: "$VIMRUNTIME/defaults.vim"
system menu file: "$VIMRUNTIME/menu.vim"
fall-back for $VIM: "/home/bs/vim/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -O2 -fno-strength-reduce -Wall -D_REENTRANT -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -L/usr/local/lib -Wl,--as-needed -o vim -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lharfbuzz -lfontconfig -lfreetype -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE -lm -ltinfo -lselinux -lcanberra -lacl -lattr -lgpm -ldl -L/usr/lib -llua5.2
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Yes I'm finding this too with netrw. Only happening with ssh X11 forwarding and $DISPLAY
set. Doesn't happen otherwise.
Vim 8.2 (patches 1 - 1632).
Ubuntu 18.04. Gnome Terminal.
Apparently 'netrw' does something to the system clipboard. I saw the same issue came up on neovim:
[https://github.com/neovim/neovim/issues/6048](Very slow netrw operations....)
[https://github.com/neovim/neovim/issues/11089](netrw signficantly slower...)
For ssh, netrw just acts as glue; ie. it sets up a command for ssh and has the system execute it. As far as the clipboard goes: it copies the clipboard into a local variable, and only if the clipboard value has changed during the course of netrw's operation will netrw restore the clipboard value (thus avoiding having netrw always be the last one to modify the clipboard).
@cecamp this is not about using netrw to browse remote files via ssh, but about using ssh to log into a remote system and using vim there to browse the "local" files on that system.
Update:
I copied this fix to $VIMRUNTIME/autoload/netrw.vim
for the moment.
Netrw over ssh X11 fast now...
Fix Details:
Neovim: netrw.vim: do not save +/* registers
@dotdash -- thanks for that. In that case, check on the g:netrw_fastbrowse
setting; perhaps setting it to 2 will help.
As far as the clipboard goes: it copies the clipboard into a local variable, and only if the clipboard value has changed during the course of netrw's operation will netrw restore the clipboard value (thus avoiding having netrw always be the last one to modify the clipboard).
How about adding a configuration option to leave the clipboard alone if set. This would solve two problems:
People complaining could then set this variable and be fine.
@cecamp No, that doesn't help at all, unfortunately.
An option to disable restoration of the clipboard was added in the latest runtime file update.
89a9c15#diff-49e1f1e8a3b17eb217ce251d8200c88a2c9dede55a4373df3d2176a8403f7f28R2622
let g:netrw_clipboard = 0
But it seems that netrw can in fact modify the clipboard content: https://groups.google.com/g/vim_dev/c/P1lSMJNbTe0/m/7TIrLXnWAQAJ
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
so let's close it then.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Closed #7259.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.