2

You can use the gx command to open a URL in vim. Is this possible when using vim within Ubuntu in WSL?

jtpereyda
  • 2,517

1 Answers1

6

In vim, run:

let g:netrw_browsex_viewer="cmd.exe /C start" 

Based on this answer, this answer, and this quetion.

You can also put this in your .vimrc file. Since I share my vimrc file between computers, I used the following to make .vimrc_local file for this OS-specific setting:

" From: https://devel.tech/snippets/n/vIIMz8vZ/load-vim-source-files-only-if-they-exist/
function! SourceIfExists(file)
  if filereadable(expand(a:file))
    exe 'source' a:file
  endif
endfunction

call SourceIfExists("~/.vimrc_local")
jtpereyda
  • 2,517