Skip to content

Instantly share code, notes, and snippets.

@aspen-roller
Last active December 3, 2020 18:59
Show Gist options
  • Save aspen-roller/8862effd4f7e667cf60847ca5eadeaf7 to your computer and use it in GitHub Desktop.
Save aspen-roller/8862effd4f7e667cf60847ca5eadeaf7 to your computer and use it in GitHub Desktop.
slow vim load because of clipboard and X server #vim #debug
# https://stackoverflow.com/a/17719528
# this response led me to disable the X server connection
# already verified that my DISPLAY was set correctly
# and I have VcXsrv running
set clipboard=exclude:.*

Slow Vim Startup

In my case, I found that it was due to the clipboard loading. Here are the steps and fix.

# terminal 1
vim --startuptime vim.log
# terminal 2
less vim.log

# "setup clipboard" step took > 30 seconds
...
32003.362  31928.192: setup clipboard
...

# reference .vimrc for the fix

For WSL2, virtualized network components are created. So a different ip address is used inside of WSL2 versus Windows. You will need to create a firewall rule to allow traffic to pass between the 2 networks while running VcXsrv. TCP port 6000 has been referenced as needing inbound access.

microsoft/WSL#4585

New-NetFirewallRule -DisplayName "WSL" -Direction Inbound  -InterfaceAlias "vEthernet (WSL)"  -Action Allow -RemoteAddress "172.16.0.0/12"

Name                  : {acfd2235-385a-43a9-8a7b-820bcc5e2889}
DisplayName           : WSL
Description           :
DisplayGroup          :
Group                 :
Enabled               : True
Profile               : Any
Platform              : {}
Direction             : Inbound
Action                : Allow
EdgeTraversalPolicy   : Block
LooseSourceMapping    : False
LocalOnlyMapping      : False
Owner                 :
PrimaryStatus         : OK
Status                : The rule was parsed successfully from the store. (65536)
EnforcementStatus     : NotApplicable
PolicyStoreSource     : PersistentStore
PolicyStoreSourceType : Local

https://stackoverflow.com/questions/61110603/how-to-set-up-working-x11-forwarding-on-wsl2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment