diff --git a/autoload/wsl.vim b/autoload/wsl.vim new file mode 100644 index 0000000..1d0c4e6 --- /dev/null +++ b/autoload/wsl.vim @@ -0,0 +1,3 @@ +function! wsl#isDetected() abort + return $WSLENV !=# '' +endfunction diff --git a/vimrc b/vimrc index 5babb2c..638f243 100644 --- a/vimrc +++ b/vimrc @@ -102,6 +102,10 @@ Pack 'tpope/vim-fugitive' Pack 'tpope/vim-eunuch' " vim-vinegar - improved directory browser Pack 'tpope/vim-vinegar' +if wsl#isDetected() + " Make gx work in WSL + let g:netrw_browsex_viewer='cmd.exe /C start' +endif " vim-abolish - CamelCase to under_score to mixedCase " TODO: Copy the good bit remove this plugin Pack 'tpope/vim-abolish'