vimwiki
vimwiki copied to clipboard
Following HTML link is broken if shell is PowerShell
Plug 'vimwiki/vimwiki'
let g:vimwiki_list = [
\ {'path': '~/OneDrive/vimwiki', 'list_margin': 2},
\ {'path': '~/vimwiki', 'list_margin': 2} ]
let g:vimwiki_ext2syntax = {}
let g:vimwiki_folding = 'syntax'
autocmd FileType vimwiki setlocal tw=80
autocmd FileType vimwiki setlocal nowrap
autocmd FileType vimwiki setlocal foldmethod=syntax
autocmd FileType vimwiki setlocal foldlevel=2
Mediawiki. I am using Windows / PowerShell (core) and my shell is set to pwsh -nop -nol. Any attempt to open HTML link ends in E371: Command not found. In autoload/vimwiki/base.vim in win32_handler it tries to call start which does not exist (it is an alias normally). Replacing start with Start-Process in line 328 fixes the problem.
Version 2023.04.04.
Hi @avysk,
Thank you for the report and the fix. Could you please create a PR working on both PowerShell and Batch ?
I'm having an issue very similar with HTML links, E371: Command not found.
For me the problem is on line: 316
Changing: execute 'silent ! start "Title" /B ' . url To: execute 'silent ! start ' . url fixes it.
This might be a vim bug because the code looks correct.
I started gvim without any vimrc using: gvim -u NONE and doing :! start "Title" /B https://www.google.com :! start "" /b https://www.google.com :! start "" https://www.google.com all give "E371: Command not found. shell returned -1" :! start https://www.google.com works.
Also no issue if i open cmd.exe and do [$ start "" /b https://www.google.com]. Weird.
I'm having an issue very similar with HTML links, E371: Command not found.
For me the problem is on line: 316
Changing: execute 'silent ! start "Title" /B ' . url To: execute 'silent ! start ' . url fixes it.
The problem appears to be single quotes in the url string, which appear when shellslash is set.
Vim 9 or Windows 11 appears to have changed how !start works: It no longer accepts "Title"
and may issue E371: Command not found.
execute 'silent !start ' .. url works for cmd.exe.
execute 'silent ! start ' .. eval(url) works for pwsh.exe and pwoershell.exe.