Fix Previm browser opener

Configure Previm to open Markdown previews via /usr/bin/open on macOS, with an xdg-open fallback for Linux desktop environments.
This commit is contained in:
m1ngsama 2026-04-15 17:47:19 +08:00 committed by GitHub
parent 5604eddbdb
commit 4fb20177ef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

5
.vimrc
View file

@ -587,6 +587,11 @@ endif
" ============================================================================ " ============================================================================
" <leader>mp open live-reloading preview in browser " <leader>mp open live-reloading preview in browser
if has('macunix')
let g:previm_open_cmd = '/usr/bin/open'
elseif executable('xdg-open')
let g:previm_open_cmd = 'xdg-open'
endif
if exists('g:plugs["previm"]') if exists('g:plugs["previm"]')
nnoremap <leader>mp :PrevimOpen<CR> nnoremap <leader>mp :PrevimOpen<CR>
endif endif