mirror of
https://github.com/gryf/.vim.git
synced 2025-12-17 11:30:29 +01:00
Added S-F5 (open in browser) for markdown filetype
This commit is contained in:
13
vimrc
13
vimrc
@@ -231,6 +231,19 @@ function s:SetMarkdownSettings() "{{{2
|
|||||||
setlocal autoindent
|
setlocal autoindent
|
||||||
setlocal formatoptions=tcq "set VIms default
|
setlocal formatoptions=tcq "set VIms default
|
||||||
|
|
||||||
|
function! <SID>ShowInBrowser()
|
||||||
|
let l:uri = expand("%:p:r") . ".html"
|
||||||
|
call system(g:browser . " " . l:uri)
|
||||||
|
echohl Statement
|
||||||
|
echo "Opened '" . l:uri ."' in " . g:browser
|
||||||
|
echohl None
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
if !exists(":ShowInBrowser")
|
||||||
|
command ShowInBrowser call s:ShowInBrowser()
|
||||||
|
map <S-F5> :ShowInBrowser<CR>
|
||||||
|
endif
|
||||||
|
|
||||||
autocmd BufWritePost *.md :silent make
|
autocmd BufWritePost *.md :silent make
|
||||||
endfunction
|
endfunction
|
||||||
"}}}
|
"}}}
|
||||||
|
|||||||
Reference in New Issue
Block a user